Search Results for

    Show / Hide Table of Contents

    Class JsonPathHandler

    A type handler for the PostgreSQL jsonpath data type.

    Inheritance
    Object
    NpgsqlTypeHandler
    NpgsqlTypeHandler<String>
    JsonPathHandler
    Implements
    INpgsqlTypeHandler<String>
    Inherited Members
    NpgsqlTypeHandler<String>.ReadAsObject(NpgsqlReadBuffer, Int32, Boolean, FieldDescription)
    NpgsqlTypeHandler<String>.GetFieldType(FieldDescription)
    NpgsqlTypeHandler<String>.GetProviderSpecificFieldType(FieldDescription)
    NpgsqlTypeHandler<String>.CreateArrayHandler(PostgresArrayType, ArrayNullabilityMode)
    NpgsqlTypeHandler<String>.CreateRangeHandler(PostgresType)
    NpgsqlTypeHandler<String>.CreateMultirangeHandler(PostgresMultirangeType)
    NpgsqlTypeHandler.PostgresType
    NpgsqlTypeHandler.Read<TAny>(NpgsqlReadBuffer, Int32, Boolean, FieldDescription)
    NpgsqlTypeHandler.Read<TAny>(NpgsqlReadBuffer, Int32, FieldDescription)
    NpgsqlTypeHandler.ReadCustom<TAny>(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 class JsonPathHandler : NpgsqlTypeHandler<string>, INpgsqlTypeHandler<string>
    Remarks

    See https://www.postgresql.org/docs/current/datatype-json.html#DATATYPE-JSONPATH.

    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

    JsonPathHandler(PostgresType, Encoding)

    Declaration
    protected JsonPathHandler(PostgresType postgresType, Encoding encoding)
    Parameters
    Type Name Description
    PostgresType postgresType
    Encoding encoding

    Methods

    GetTextReader(Stream)

    Declaration
    public TextReader GetTextReader(Stream stream)
    Parameters
    Type Name Description
    Stream stream
    Returns
    Type Description
    TextReader

    Read(NpgsqlReadBuffer, Int32, Boolean, FieldDescription)

    Reads a value of type TDefault with the given length from the provided buffer, using either sync or async I/O.

    Declaration
    public override async ValueTask<string> Read(NpgsqlReadBuffer buf, int len, bool async, FieldDescription fieldDescription = null)
    Parameters
    Type Name Description
    NpgsqlReadBuffer buf

    The buffer from which to read.

    Int32 len

    The byte length of the value. The buffer might not contain the full length, requiring I/O to be performed.

    Boolean async

    If I/O is required to read the full length of the value, whether it should be performed synchronously or asynchronously.

    FieldDescription fieldDescription

    Additional PostgreSQL information about the type, such as the length in varchar(30).

    Returns
    Type Description
    ValueTask<String>

    The fully-read value.

    Overrides
    Npgsql.Internal.TypeHandling.NpgsqlTypeHandler<System.String>.Read(Npgsql.Internal.NpgsqlReadBuffer, System.Int32, System.Boolean, Npgsql.BackendMessages.FieldDescription)

    ValidateAndGetLength(String, ref NpgsqlLengthCache, NpgsqlParameter)

    Called to validate and get the length of a value of a generic NpgsqlParameter<T>.

    Declaration
    public override int ValidateAndGetLength(string value, ref NpgsqlLengthCache lengthCache, NpgsqlParameter parameter)
    Parameters
    Type Name Description
    String value
    NpgsqlLengthCache lengthCache
    NpgsqlParameter parameter
    Returns
    Type Description
    Int32
    Overrides
    Npgsql.Internal.TypeHandling.NpgsqlTypeHandler<System.String>.ValidateAndGetLength(System.String, Npgsql.Internal.TypeHandling.NpgsqlLengthCache, Npgsql.NpgsqlParameter)

    Write(String, NpgsqlWriteBuffer, NpgsqlLengthCache, NpgsqlParameter, Boolean, CancellationToken)

    Called to write the value of a generic NpgsqlParameter<T>.

    Declaration
    public override async Task Write(string value, NpgsqlWriteBuffer buf, NpgsqlLengthCache lengthCache, NpgsqlParameter parameter, bool async, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    String value
    NpgsqlWriteBuffer buf
    NpgsqlLengthCache lengthCache
    NpgsqlParameter parameter
    Boolean async
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    Overrides
    Npgsql.Internal.TypeHandling.NpgsqlTypeHandler<System.String>.Write(System.String, Npgsql.Internal.NpgsqlWriteBuffer, Npgsql.Internal.TypeHandling.NpgsqlLengthCache, Npgsql.NpgsqlParameter, System.Boolean, System.Threading.CancellationToken)

    Implements

    INpgsqlTypeHandler<T>
    In This Article
    Back to top © Copyright 2022 The Npgsql Development Team