types

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Bool = BoolType{}

Bool is the standard boolean.

View Source
var BoolArray = BoolArrayType{}

BoolArray is the standard boolean array.

View Source
var Uuid = UuidType{}

Uuid is the UUID type.

Functions

func DeserializeType

func DeserializeType(serializedType []byte) (types.ExtendedType, error)

DeserializeType is able to deserialize the given serialized type into an appropriate extended type. All extended types will be defined by DoltgreSQL.

func MustSerializeType

func MustSerializeType(extendedType types.ExtendedType) []byte

MustSerializeType internally calls SerializeType and panics on error. In general, panics should only occur when a type has not yet had its serialization implemented yet.

func SerializeType

func SerializeType(extendedType types.ExtendedType) ([]byte, error)

SerializeType is able to serialize the given extended type into a byte slice. All extended types will be defined by DoltgreSQL.

Types

type BoolArrayType

type BoolArrayType struct{}

BoolArrayType is the extended type implementation of the PostgreSQL boolean.

func (BoolArrayType) CollationCoercibility

func (b BoolArrayType) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the types.ExtendedType interface.

func (BoolArrayType) Compare

func (b BoolArrayType) Compare(v1 any, v2 any) (int, error)

Compare implements the types.ExtendedType interface.

func (BoolArrayType) Convert

func (b BoolArrayType) Convert(val any) (any, sql.ConvertInRange, error)

Convert implements the types.ExtendedType interface.

func (BoolArrayType) DeserializeValue

func (b BoolArrayType) DeserializeValue(val []byte) (any, error)

DeserializeValue implements the types.ExtendedType interface.

func (BoolArrayType) Equals

func (b BoolArrayType) Equals(otherType sql.Type) bool

Equals implements the types.ExtendedType interface.

func (BoolArrayType) FormatSerializedValue

func (b BoolArrayType) FormatSerializedValue(val []byte) (string, error)

FormatSerializedValue implements the types.ExtendedType interface.

func (BoolArrayType) FormatValue

func (b BoolArrayType) FormatValue(val any) (string, error)

FormatValue implements the types.ExtendedType interface.

func (BoolArrayType) MaxSerializedWidth

func (b BoolArrayType) MaxSerializedWidth() types.ExtendedTypeSerializedWidth

MaxSerializedWidth implements the types.ExtendedType interface.

func (BoolArrayType) MaxTextResponseByteLength

func (b BoolArrayType) MaxTextResponseByteLength(ctx *sql.Context) uint32

MaxTextResponseByteLength implements the types.ExtendedType interface.

func (BoolArrayType) Promote

func (b BoolArrayType) Promote() sql.Type

Promote implements the types.ExtendedType interface.

func (BoolArrayType) SQL

func (b BoolArrayType) SQL(ctx *sql.Context, dest []byte, v any) (sqltypes.Value, error)

SQL implements the types.ExtendedType interface.

func (BoolArrayType) SerializeValue

func (b BoolArrayType) SerializeValue(val any) ([]byte, error)

SerializeValue implements the types.ExtendedType interface.

func (BoolArrayType) SerializedCompare

func (b BoolArrayType) SerializedCompare(v1 []byte, v2 []byte) (int, error)

SerializedCompare implements the types.ExtendedType interface.

func (BoolArrayType) String

func (b BoolArrayType) String() string

String implements the types.ExtendedType interface.

func (BoolArrayType) Type

func (b BoolArrayType) Type() query.Type

Type implements the types.ExtendedType interface.

func (BoolArrayType) ValueType

func (b BoolArrayType) ValueType() reflect.Type

ValueType implements the types.ExtendedType interface.

func (BoolArrayType) Zero

func (b BoolArrayType) Zero() any

Zero implements the types.ExtendedType interface.

type BoolType

type BoolType struct{}

BoolType is the extended type implementation of the PostgreSQL boolean.

func (BoolType) CollationCoercibility

func (b BoolType) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the types.ExtendedType interface.

func (BoolType) Compare

func (b BoolType) Compare(v1 any, v2 any) (int, error)

Compare implements the types.ExtendedType interface.

func (BoolType) Convert

func (b BoolType) Convert(val any) (any, sql.ConvertInRange, error)

Convert implements the types.ExtendedType interface.

func (BoolType) DeserializeValue

func (b BoolType) DeserializeValue(val []byte) (any, error)

DeserializeValue implements the types.ExtendedType interface.

func (BoolType) Equals

func (b BoolType) Equals(otherType sql.Type) bool

Equals implements the types.ExtendedType interface.

func (BoolType) FormatSerializedValue

func (b BoolType) FormatSerializedValue(val []byte) (string, error)

FormatSerializedValue implements the types.ExtendedType interface.

func (BoolType) FormatValue

func (b BoolType) FormatValue(val any) (string, error)

FormatValue implements the types.ExtendedType interface.

func (BoolType) MaxSerializedWidth

func (b BoolType) MaxSerializedWidth() types.ExtendedTypeSerializedWidth

MaxSerializedWidth implements the types.ExtendedType interface.

func (BoolType) MaxTextResponseByteLength

func (b BoolType) MaxTextResponseByteLength(ctx *sql.Context) uint32

MaxTextResponseByteLength implements the types.ExtendedType interface.

func (BoolType) Promote

func (b BoolType) Promote() sql.Type

Promote implements the types.ExtendedType interface.

func (BoolType) SQL

func (b BoolType) SQL(ctx *sql.Context, dest []byte, v any) (sqltypes.Value, error)

SQL implements the types.ExtendedType interface.

func (BoolType) SerializeValue

func (b BoolType) SerializeValue(val any) ([]byte, error)

SerializeValue implements the types.ExtendedType interface.

func (BoolType) SerializedCompare

func (b BoolType) SerializedCompare(v1 []byte, v2 []byte) (int, error)

SerializedCompare implements the types.ExtendedType interface.

func (BoolType) String

func (b BoolType) String() string

String implements the types.ExtendedType interface.

func (BoolType) Type

func (b BoolType) Type() query.Type

Type implements the types.ExtendedType interface.

func (BoolType) ValueType

func (b BoolType) ValueType() reflect.Type

ValueType implements the types.ExtendedType interface.

func (BoolType) Zero

func (b BoolType) Zero() any

Zero implements the types.ExtendedType interface.

type UuidType

type UuidType struct{}

UuidType is the extended type implementation of the PostgreSQL UUID.

func (UuidType) CollationCoercibility

func (b UuidType) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)

CollationCoercibility implements the types.ExtendedType interface.

func (UuidType) Compare

func (b UuidType) Compare(v1 any, v2 any) (int, error)

Compare implements the types.ExtendedType interface.

func (UuidType) Convert

func (b UuidType) Convert(val any) (any, sql.ConvertInRange, error)

Convert implements the types.ExtendedType interface.

func (UuidType) DeserializeValue

func (b UuidType) DeserializeValue(val []byte) (any, error)

DeserializeValue implements the types.ExtendedType interface.

func (UuidType) Equals

func (b UuidType) Equals(otherType sql.Type) bool

Equals implements the types.ExtendedType interface.

func (UuidType) FormatSerializedValue

func (b UuidType) FormatSerializedValue(val []byte) (string, error)

FormatSerializedValue implements the types.ExtendedType interface.

func (UuidType) FormatValue

func (b UuidType) FormatValue(val any) (string, error)

FormatValue implements the types.ExtendedType interface.

func (UuidType) MaxSerializedWidth

func (b UuidType) MaxSerializedWidth() types.ExtendedTypeSerializedWidth

MaxSerializedWidth implements the types.ExtendedType interface.

func (UuidType) MaxTextResponseByteLength

func (b UuidType) MaxTextResponseByteLength(ctx *sql.Context) uint32

MaxTextResponseByteLength implements the types.ExtendedType interface.

func (UuidType) Promote

func (b UuidType) Promote() sql.Type

Promote implements the types.ExtendedType interface.

func (UuidType) SQL

func (b UuidType) SQL(ctx *sql.Context, dest []byte, v any) (sqltypes.Value, error)

SQL implements the types.ExtendedType interface.

func (UuidType) SerializeValue

func (b UuidType) SerializeValue(val any) ([]byte, error)

SerializeValue implements the types.ExtendedType interface.

func (UuidType) SerializedCompare

func (b UuidType) SerializedCompare(v1 []byte, v2 []byte) (int, error)

SerializedCompare implements the types.ExtendedType interface.

func (UuidType) String

func (b UuidType) String() string

String implements the types.ExtendedType interface.

func (UuidType) Type

func (b UuidType) Type() query.Type

Type implements the types.ExtendedType interface.

func (UuidType) ValueType

func (b UuidType) ValueType() reflect.Type

ValueType implements the types.ExtendedType interface.

func (UuidType) Zero

func (b UuidType) Zero() any

Zero implements the types.ExtendedType interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL