Search Results for

    Show / Hide Table of Contents

    Class ArrayHandler

    Non-generic base class for all type handlers which handle PostgreSQL arrays. Extend from ArrayHandler<TElement> instead.

    Inheritance
    Object
    NpgsqlTypeHandler
    ArrayHandler
    ArrayHandler<TElement>
    Inherited Members
    NpgsqlTypeHandler.PostgresType
    NpgsqlTypeHandler.Read<TAny>(NpgsqlReadBuffer, Int32, Boolean, FieldDescription)
    NpgsqlTypeHandler.Read<TAny>(NpgsqlReadBuffer, Int32, FieldDescription)
    NpgsqlTypeHandler.ReadAsObject(NpgsqlReadBuffer, Int32, Boolean, FieldDescription)
    NpgsqlTypeHandler.ValidateAndGetLength<TAny>(TAny, NpgsqlLengthCache, NpgsqlParameter)
    NpgsqlTypeHandler.ValidateAndGetLengthCustom<TAny>(TAny, NpgsqlLengthCache, NpgsqlParameter)
    NpgsqlTypeHandler.WriteWithLength<TAny>(TAny, NpgsqlWriteBuffer, NpgsqlLengthCache, NpgsqlParameter, Boolean, CancellationToken)
    NpgsqlTypeHandler.WriteWithLengthCustom<TAny>(TAny, NpgsqlWriteBuffer, NpgsqlLengthCache, NpgsqlParameter, Boolean, CancellationToken)
    NpgsqlTypeHandler.ValidateObjectAndGetLength(Object, NpgsqlLengthCache, NpgsqlParameter)
    NpgsqlTypeHandler.WriteObjectWithLength(Object, NpgsqlWriteBuffer, NpgsqlLengthCache, NpgsqlParameter, Boolean, CancellationToken)
    NpgsqlTypeHandler.CreateConversionButNoParamException(Type)
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Npgsql.Internal.TypeHandlers
    Assembly: Npgsql.dll
    Syntax
    public abstract class ArrayHandler : NpgsqlTypeHandler
    Remarks

    https://www.postgresql.org/docs/current/static/arrays.html.

    The type handler API allows customizing Npgsql's behavior in powerful ways. However, although it is public, it should be considered somewhat unstable, and may change in breaking ways, including in non-major releases. Use it at your own risk.

    Constructors

    ArrayHandler(PostgresType, NpgsqlTypeHandler, ArrayNullabilityMode, Int32)

    Declaration
    protected ArrayHandler(PostgresType arrayPostgresType, NpgsqlTypeHandler elementHandler, ArrayNullabilityMode arrayNullabilityMode, int lowerBound = 1)
    Parameters
    Type Name Description
    PostgresType arrayPostgresType
    NpgsqlTypeHandler elementHandler
    ArrayNullabilityMode arrayNullabilityMode
    Int32 lowerBound

    Methods

    CreateArrayHandler(PostgresArrayType, ArrayNullabilityMode)

    Creates a type handler for arrays of this handler's type.

    Declaration
    public override NpgsqlTypeHandler CreateArrayHandler(PostgresArrayType pgArrayType, ArrayNullabilityMode arrayNullabilityMode)
    Parameters
    Type Name Description
    PostgresArrayType pgArrayType
    ArrayNullabilityMode arrayNullabilityMode
    Returns
    Type Description
    NpgsqlTypeHandler
    Overrides
    NpgsqlTypeHandler.CreateArrayHandler(PostgresArrayType, ArrayNullabilityMode)

    CreateMultirangeHandler(PostgresMultirangeType)

    Creates a type handler for multiranges of this handler's type.

    Declaration
    public override NpgsqlTypeHandler CreateMultirangeHandler(PostgresMultirangeType pgMultirangeType)
    Parameters
    Type Name Description
    PostgresMultirangeType pgMultirangeType
    Returns
    Type Description
    NpgsqlTypeHandler
    Overrides
    NpgsqlTypeHandler.CreateMultirangeHandler(PostgresMultirangeType)

    CreateRangeHandler(PostgresType)

    Creates a type handler for ranges of this handler's type.

    Declaration
    public override NpgsqlTypeHandler CreateRangeHandler(PostgresType pgRangeType)
    Parameters
    Type Name Description
    PostgresType pgRangeType
    Returns
    Type Description
    NpgsqlTypeHandler
    Overrides
    NpgsqlTypeHandler.CreateRangeHandler(PostgresType)

    GetFieldType(FieldDescription)

    Declaration
    public override Type GetFieldType(FieldDescription fieldDescription = null)
    Parameters
    Type Name Description
    FieldDescription fieldDescription
    Returns
    Type Description
    Type
    Overrides
    NpgsqlTypeHandler.GetFieldType(FieldDescription)

    GetProviderSpecificFieldType(FieldDescription)

    Declaration
    public override Type GetProviderSpecificFieldType(FieldDescription fieldDescription = null)
    Parameters
    Type Name Description
    FieldDescription fieldDescription
    Returns
    Type Description
    Type
    Overrides
    NpgsqlTypeHandler.GetProviderSpecificFieldType(FieldDescription)

    ReadArray<TRequestedElement>(NpgsqlReadBuffer, Boolean, Int32, Boolean)

    Reads an array of element type TRequestedElement from the given buffer buf.

    Declaration
    protected async ValueTask<Array> ReadArray<TRequestedElement>(NpgsqlReadBuffer buf, bool async, int expectedDimensions = 0, bool readAsObject = false)
    Parameters
    Type Name Description
    NpgsqlReadBuffer buf
    Boolean async
    Int32 expectedDimensions
    Boolean readAsObject
    Returns
    Type Description
    ValueTask<Array>
    Type Parameters
    Name Description
    TRequestedElement

    ReadCustom<TRequestedArray>(NpgsqlReadBuffer, Int32, Boolean, FieldDescription)

    Declaration
    protected override async ValueTask<TRequestedArray> ReadCustom<TRequestedArray>(NpgsqlReadBuffer buf, int len, bool async, FieldDescription fieldDescription = null)
    Parameters
    Type Name Description
    NpgsqlReadBuffer buf
    Int32 len
    Boolean async
    FieldDescription fieldDescription
    Returns
    Type Description
    ValueTask<TRequestedArray>
    Type Parameters
    Name Description
    TRequestedArray
    Overrides
    NpgsqlTypeHandler.ReadCustom<TAny>(NpgsqlReadBuffer, Int32, Boolean, FieldDescription)

    ReadList<TRequestedElement>(NpgsqlReadBuffer, Boolean)

    Reads a generic list containing elements of type TRequestedElement from the given buffer buf.

    Declaration
    protected async ValueTask<List<TRequestedElement>> ReadList<TRequestedElement>(NpgsqlReadBuffer buf, bool async)
    Parameters
    Type Name Description
    NpgsqlReadBuffer buf
    Boolean async
    Returns
    Type Description
    ValueTask<List<TRequestedElement>>
    Type Parameters
    Name Description
    TRequestedElement
    In This Article
    Back to top © Copyright 2022 The Npgsql Development Team