types

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 15

Documentation

Index

Constants

View Source
const (
	NullabilityUnspecified = proto.Type_NULLABILITY_UNSPECIFIED
	NullabilityNullable    = proto.Type_NULLABILITY_NULLABLE
	NullabilityRequired    = proto.Type_NULLABILITY_REQUIRED
)

Variables

This section is empty.

Functions

func GetShortTypeName added in v0.7.0

func GetShortTypeName(name TypeName) string

func GetTypeNameToTypeMap added in v0.7.0

func GetTypeNameToTypeMap() map[string]Type

func TypeToProto

func TypeToProto(t Type) *proto.Type

TypeToProto properly constructs the appropriate protobuf message for the given type.

Types

type AggregationPhase

type AggregationPhase = proto.AggregationPhase

type AnyType added in v1.0.0

type AnyType struct {
	Name             string
	TypeVariationRef uint32
	Nullability      Nullability
}

AnyType to represent AnyType, this type is to indicate "any" type of argument This type is not used in function invocation. It is only used in function definition

func (AnyType) GetParameterizedParams added in v1.0.0

func (s AnyType) GetParameterizedParams() []interface{}

func (AnyType) HasParameterizedParam added in v1.0.0

func (s AnyType) HasParameterizedParam() bool

func (AnyType) MatchWithNullability added in v1.0.0

func (m AnyType) MatchWithNullability(ot Type) bool

func (AnyType) MatchWithoutNullability added in v1.0.0

func (m AnyType) MatchWithoutNullability(ot Type) bool

func (AnyType) SetNullability added in v1.0.0

func (t AnyType) SetNullability(n Nullability) FuncDefArgType

func (AnyType) String added in v1.0.0

func (t AnyType) String() string

type BinaryType

type BinaryType = PrimitiveType[[]byte]

create type aliases to the generic structs

type BooleanParameter

type BooleanParameter bool

BooleanParameter is a type parameter like <true> for a type.

func (BooleanParameter) Equals

func (b BooleanParameter) Equals(p TypeParam) bool

func (BooleanParameter) ToProto

func (b BooleanParameter) ToProto() *proto.Type_Parameter

type BooleanType

type BooleanType = PrimitiveType[bool]

create type aliases to the generic structs

type CompositeType added in v1.0.0

type CompositeType interface {
	Type
	// ParameterString this returns parameter string
	// for e.g. parameter decimal<P, S>, ParameterString returns "P,S"
	ParameterString() string
	// BaseString this returns long name for parameter string
	// for e.g. parameter decimal<P, S>, BaseString returns "decimal"
	BaseString() string
}

CompositeType this represents a concrete type having components

type DataTypeParameter

type DataTypeParameter struct {
	Type
}

DataTypeParameter is like the i32 in LIST<i32>

func (*DataTypeParameter) Equals

func (d *DataTypeParameter) Equals(p TypeParam) bool

func (*DataTypeParameter) ToProto

func (d *DataTypeParameter) ToProto() *proto.Type_Parameter

type Date

type Date int32

type DateType

type DateType = PrimitiveType[Date]

create type aliases to the generic structs

type DecimalType

type DecimalType struct {
	Nullability      Nullability
	TypeVariationRef uint32
	Scale, Precision int32
}

DecimalType is a decimal type with concrete precision and scale parameters, e.g. Decimal(10, 2).

func (*DecimalType) BaseString added in v0.7.0

func (*DecimalType) BaseString() string

func (*DecimalType) Equals

func (s *DecimalType) Equals(rhs Type) bool

func (*DecimalType) GetNullability

func (s *DecimalType) GetNullability() Nullability

func (*DecimalType) GetType

func (s *DecimalType) GetType() Type

func (*DecimalType) GetTypeVariationReference

func (s *DecimalType) GetTypeVariationReference() uint32

func (*DecimalType) ParameterString added in v0.7.0

func (s *DecimalType) ParameterString() string

func (*DecimalType) ShortString

func (*DecimalType) ShortString() string

func (*DecimalType) String

func (s *DecimalType) String() string

func (*DecimalType) ToProto

func (s *DecimalType) ToProto() *proto.Type

func (*DecimalType) ToProtoFuncArg

func (s *DecimalType) ToProtoFuncArg() *proto.FunctionArgument

func (*DecimalType) WithNullability

func (s *DecimalType) WithNullability(n Nullability) Type

type Enum

type Enum string

func (Enum) String

func (e Enum) String() string

func (Enum) ToProtoFuncArg

func (e Enum) ToProtoFuncArg() *proto.FunctionArgument

type EnumParameter

type EnumParameter string

EnumParameter is a type parameter that is some enum value

func (EnumParameter) Equals

func (b EnumParameter) Equals(p TypeParam) bool

func (EnumParameter) ToProto

func (p EnumParameter) ToProto() *proto.Type_Parameter

type FixedBinary

type FixedBinary []byte

type FixedBinaryType

type FixedBinaryType = FixedLenType[FixedBinary]

create type aliases to the generic structs

type FixedChar

type FixedChar string

type FixedCharType

type FixedCharType = FixedLenType[FixedChar]

create type aliases to the generic structs

type FixedLenType

type FixedLenType[T FixedChar | VarChar | FixedBinary | IntervalDayToSecond] struct {
	Nullability      Nullability
	TypeVariationRef uint32
	Length           int32
}

FixedLenType is any of the types which also need to track their specific length as they have a fixed length.

func (*FixedLenType[T]) BaseString added in v0.7.0

func (s *FixedLenType[T]) BaseString() string

func (*FixedLenType[T]) Equals

func (s *FixedLenType[T]) Equals(rhs Type) bool

func (*FixedLenType[T]) GetLength added in v1.0.0

func (s *FixedLenType[T]) GetLength() int32

func (*FixedLenType[T]) GetNullability

func (s *FixedLenType[T]) GetNullability() Nullability

func (*FixedLenType[T]) GetType

func (s *FixedLenType[T]) GetType() Type

func (*FixedLenType[T]) GetTypeVariationReference

func (s *FixedLenType[T]) GetTypeVariationReference() uint32

func (*FixedLenType[T]) ParameterString added in v0.7.0

func (s *FixedLenType[T]) ParameterString() string

func (*FixedLenType[T]) ShortString

func (*FixedLenType[T]) ShortString() string

func (*FixedLenType[T]) String

func (s *FixedLenType[T]) String() string

func (*FixedLenType[T]) ToProtoFuncArg

func (s *FixedLenType[T]) ToProtoFuncArg() *proto.FunctionArgument

func (*FixedLenType[T]) WithLength added in v0.7.0

func (s *FixedLenType[T]) WithLength(length int32) FixedType

func (*FixedLenType[T]) WithNullability

func (s *FixedLenType[T]) WithNullability(n Nullability) Type

type FixedType added in v0.7.0

type FixedType interface {
	CompositeType
	WithLength(int32) FixedType
	GetLength() int32
}

func FixedTypeNameToType added in v0.7.0

func FixedTypeNameToType(name TypeName) (FixedType, error)

type Float32Type

type Float32Type = PrimitiveType[float32]

create type aliases to the generic structs

type Float64Type

type Float64Type = PrimitiveType[float64]

create type aliases to the generic structs

type FuncArg

type FuncArg interface {
	fmt.Stringer
	ToProtoFuncArg() *proto.FunctionArgument
}

FuncArg corresponds to the protobuf FunctionArgument. Anything which could be a function argument should meet this interface. This is either an Expression, a Type, or an Enum (string).

type FuncDefArgType added in v1.0.0

type FuncDefArgType interface {
	fmt.Stringer
	//SetNullability set nullability as given argument
	SetNullability(Nullability) FuncDefArgType
	// HasParameterizedParam returns true if the type has at least one parameterized parameters
	// if all parameters are concrete then it returns false
	HasParameterizedParam() bool
	// GetParameterizedParams returns all parameterized parameters
	// it doesn't return concrete parameters
	GetParameterizedParams() []interface{}

	// MatchWithNullability This API return true if Type argument
	// is compatible with this param otherwise it returns false.
	// This method expects that nullability of argument is same as this type.
	MatchWithNullability(ot Type) bool
	// MatchWithoutNullability This API return true if Type argument
	// is compatible with this param otherwise it returns false.
	// This method ignores nullability for matching.
	MatchWithoutNullability(ot Type) bool
}

FuncDefArgType this represents a type used in function argument These type can't be present in plan (not serializable)

type FunctionOption

type FunctionOption = proto.FunctionOption

type FunctionRef

type FunctionRef uint32

func (FunctionRef) String

func (f FunctionRef) String() string

type Int16Type

type Int16Type = PrimitiveType[int16]

create type aliases to the generic structs

type Int32Type

type Int32Type = PrimitiveType[int32]

create type aliases to the generic structs

type Int64Type

type Int64Type = PrimitiveType[int64]

create type aliases to the generic structs

type Int8Type

type Int8Type = PrimitiveType[int8]

create type aliases to the generic structs

type IntegerParameter

type IntegerParameter int64

IntegerParameter is the type parameter like 10 in VARCHAR<10>

func (IntegerParameter) Equals

func (b IntegerParameter) Equals(p TypeParam) bool

func (IntegerParameter) ToProto

func (p IntegerParameter) ToProto() *proto.Type_Parameter

type IntervalCompoundType added in v0.8.0

type IntervalCompoundType struct {
	// contains filtered or unexported fields
}

IntervalCompoundType this is used to represent a type of interval compound.

func NewIntervalCompoundType added in v0.8.0

func NewIntervalCompoundType() IntervalCompoundType

NewIntervalCompoundType creates a type of new interval compound.

func (IntervalCompoundType) Equals added in v0.8.0

func (m IntervalCompoundType) Equals(rhs Type) bool

func (IntervalCompoundType) GetNullability added in v0.8.0

func (m IntervalCompoundType) GetNullability() Nullability

func (IntervalCompoundType) GetPrecisionProtoVal added in v0.8.0

func (m IntervalCompoundType) GetPrecisionProtoVal() int32

func (IntervalCompoundType) GetType added in v0.8.0

func (m IntervalCompoundType) GetType() Type

func (IntervalCompoundType) GetTypeVariationReference added in v0.8.0

func (m IntervalCompoundType) GetTypeVariationReference() uint32

func (IntervalCompoundType) ShortString added in v0.8.0

func (IntervalCompoundType) ShortString() string

func (IntervalCompoundType) String added in v0.8.0

func (m IntervalCompoundType) String() string

func (IntervalCompoundType) ToProto added in v0.8.0

func (m IntervalCompoundType) ToProto() *proto.Type

func (IntervalCompoundType) ToProtoFuncArg added in v0.8.0

func (m IntervalCompoundType) ToProtoFuncArg() *proto.FunctionArgument

func (IntervalCompoundType) WithNullability added in v0.8.0

func (m IntervalCompoundType) WithNullability(n Nullability) Type

func (IntervalCompoundType) WithPrecision added in v0.8.0

func (m IntervalCompoundType) WithPrecision(precision TimePrecision) IntervalCompoundType

func (IntervalCompoundType) WithTypeVariationRef added in v0.8.0

func (m IntervalCompoundType) WithTypeVariationRef(typeVariationRef uint32) IntervalCompoundType

type IntervalDayType

type IntervalDayType = FixedLenType[IntervalDayToSecond]

create type aliases to the generic structs

type IntervalYearToMonthType added in v0.8.0

type IntervalYearToMonthType struct {
	// contains filtered or unexported fields
}

IntervalYearToMonthType this is used to represent a type of interval which represents YearToMonth.

func NewIntervalYearToMonthType added in v0.8.0

func NewIntervalYearToMonthType() IntervalYearToMonthType

NewIntervalYearToMonthType creates a type of new interval YearToMonth. Created type has nullability as Nullable

func (IntervalYearToMonthType) Equals added in v0.8.0

func (m IntervalYearToMonthType) Equals(rhs Type) bool

func (IntervalYearToMonthType) GetNullability added in v0.8.0

func (m IntervalYearToMonthType) GetNullability() Nullability

func (IntervalYearToMonthType) GetType added in v0.8.0

func (m IntervalYearToMonthType) GetType() Type

func (IntervalYearToMonthType) GetTypeVariationReference added in v0.8.0

func (m IntervalYearToMonthType) GetTypeVariationReference() uint32

func (IntervalYearToMonthType) ShortString added in v0.8.0

func (IntervalYearToMonthType) ShortString() string

func (IntervalYearToMonthType) String added in v0.8.0

func (m IntervalYearToMonthType) String() string

func (IntervalYearToMonthType) ToProto added in v0.8.0

func (m IntervalYearToMonthType) ToProto() *proto.Type

func (IntervalYearToMonthType) ToProtoFuncArg added in v0.8.0

func (m IntervalYearToMonthType) ToProtoFuncArg() *proto.FunctionArgument

func (IntervalYearToMonthType) WithNullability added in v0.8.0

func (m IntervalYearToMonthType) WithNullability(n Nullability) Type

func (IntervalYearToMonthType) WithTypeVariationRef added in v0.8.0

func (m IntervalYearToMonthType) WithTypeVariationRef(typeVariationRef uint32) IntervalYearToMonthType

type IntervalYearType

type IntervalYearType = PrimitiveType[IntervalYearToMonth]

create type aliases to the generic structs

type ListType

type ListType struct {
	Nullability      Nullability
	TypeVariationRef uint32

	Type Type
}

func (*ListType) BaseString added in v1.0.0

func (*ListType) BaseString() string

func (*ListType) Equals

func (t *ListType) Equals(rhs Type) bool

func (*ListType) GetNullability

func (s *ListType) GetNullability() Nullability

func (*ListType) GetType

func (s *ListType) GetType() Type

func (*ListType) GetTypeVariationReference

func (s *ListType) GetTypeVariationReference() uint32

func (*ListType) ParameterString added in v1.0.0

func (s *ListType) ParameterString() string

func (*ListType) ShortString

func (*ListType) ShortString() string

func (*ListType) String

func (t *ListType) String() string

func (*ListType) ToProto

func (t *ListType) ToProto() *proto.Type

func (*ListType) ToProtoFuncArg

func (t *ListType) ToProtoFuncArg() *proto.FunctionArgument

func (*ListType) WithNullability

func (s *ListType) WithNullability(n Nullability) Type

type MapType

type MapType struct {
	Nullability      Nullability
	TypeVariationRef uint32
	Key, Value       Type
}

func (*MapType) BaseString added in v1.0.0

func (*MapType) BaseString() string

func (*MapType) Equals

func (t *MapType) Equals(rhs Type) bool

func (*MapType) GetNullability

func (s *MapType) GetNullability() Nullability

func (*MapType) GetType

func (s *MapType) GetType() Type

func (*MapType) GetTypeVariationReference

func (s *MapType) GetTypeVariationReference() uint32

func (*MapType) ParameterString added in v1.0.0

func (t *MapType) ParameterString() string

func (*MapType) ShortString

func (t *MapType) ShortString() string

func (*MapType) String

func (t *MapType) String() string

func (*MapType) ToProto

func (t *MapType) ToProto() *proto.Type

func (*MapType) ToProtoFuncArg

func (t *MapType) ToProtoFuncArg() *proto.FunctionArgument

func (*MapType) WithNullability

func (s *MapType) WithNullability(n Nullability) Type

type NamedStruct

type NamedStruct struct {
	Names  []string
	Struct StructType
}

func NewNamedStructFromProto

func NewNamedStructFromProto(n *proto.NamedStruct) NamedStruct

func (NamedStruct) String

func (n NamedStruct) String() string

func (NamedStruct) ToProto

func (n NamedStruct) ToProto() *proto.NamedStruct

type NullParameter

type NullParameter struct{}

NullParameter is an explicitly null/unspecified parameter, to select the default value (if any).

func (NullParameter) Equals

func (NullParameter) Equals(p TypeParam) bool

func (NullParameter) ToProto

func (NullParameter) ToProto() *proto.Type_Parameter

type Nullability

type Nullability = proto.Type_Nullability

type ParameterizedDecimalType added in v1.0.0

type ParameterizedDecimalType struct {
	Nullability      Nullability
	TypeVariationRef uint32
	Precision        integer_parameters.IntegerParameter
	Scale            integer_parameters.IntegerParameter
}

ParameterizedDecimalType is a decimal type which to hold function arguments example: Decimal<P,S> or Decimal<P,0> or Decimal(10, 2)

func (*ParameterizedDecimalType) GetParameterizedParams added in v1.0.0

func (m *ParameterizedDecimalType) GetParameterizedParams() []interface{}

func (*ParameterizedDecimalType) HasParameterizedParam added in v1.0.0

func (m *ParameterizedDecimalType) HasParameterizedParam() bool

func (*ParameterizedDecimalType) MatchWithNullability added in v1.0.0

func (m *ParameterizedDecimalType) MatchWithNullability(ot Type) bool

func (*ParameterizedDecimalType) MatchWithoutNullability added in v1.0.0

func (m *ParameterizedDecimalType) MatchWithoutNullability(ot Type) bool

func (*ParameterizedDecimalType) SetNullability added in v1.0.0

func (*ParameterizedDecimalType) String added in v1.0.0

func (m *ParameterizedDecimalType) String() string

type ParameterizedFixedBinaryType added in v1.0.0

type ParameterizedFixedBinaryType = parameterizedTypeSingleIntegerParam[*FixedBinaryType]

create type aliases to the generic structs

type ParameterizedFixedCharType added in v1.0.0

type ParameterizedFixedCharType = parameterizedTypeSingleIntegerParam[*FixedCharType]

create type aliases to the generic structs

type ParameterizedIntervalDayType added in v1.2.0

type ParameterizedIntervalDayType = parameterizedTypeSingleIntegerParam[*IntervalDayType]

create type aliases to the generic structs

type ParameterizedListType added in v1.0.0

type ParameterizedListType struct {
	Nullability      Nullability
	TypeVariationRef uint32
	Type             FuncDefArgType
}

ParameterizedListType is a list type having parameter of ParameterizedAbstractType basically a list of which type is another abstract parameter example: List<Decimal(P,S)>. Kindly note concrete types List<Decimal(38, 0)> is not represented by this type Concrete type is represented by ListType

func (*ParameterizedListType) GetParameterizedParams added in v1.0.0

func (m *ParameterizedListType) GetParameterizedParams() []interface{}

func (*ParameterizedListType) HasParameterizedParam added in v1.0.0

func (m *ParameterizedListType) HasParameterizedParam() bool

func (*ParameterizedListType) MatchWithNullability added in v1.0.0

func (m *ParameterizedListType) MatchWithNullability(ot Type) bool

func (*ParameterizedListType) MatchWithoutNullability added in v1.0.0

func (m *ParameterizedListType) MatchWithoutNullability(ot Type) bool

func (*ParameterizedListType) SetNullability added in v1.0.0

func (m *ParameterizedListType) SetNullability(n Nullability) FuncDefArgType

func (*ParameterizedListType) String added in v1.0.0

func (m *ParameterizedListType) String() string

type ParameterizedMapType added in v1.0.0

type ParameterizedMapType struct {
	Nullability      Nullability
	TypeVariationRef uint32
	Key              FuncDefArgType
	Value            FuncDefArgType
}

ParameterizedMapType is a struct having at least one of key or value of type ParameterizedAbstractType If All arguments are concrete they are represented by MapType

func (*ParameterizedMapType) GetParameterizedParams added in v1.0.0

func (m *ParameterizedMapType) GetParameterizedParams() []interface{}

func (*ParameterizedMapType) HasParameterizedParam added in v1.0.0

func (m *ParameterizedMapType) HasParameterizedParam() bool

func (*ParameterizedMapType) MatchWithNullability added in v1.0.0

func (m *ParameterizedMapType) MatchWithNullability(ot Type) bool

func (*ParameterizedMapType) MatchWithoutNullability added in v1.0.0

func (m *ParameterizedMapType) MatchWithoutNullability(ot Type) bool

func (*ParameterizedMapType) SetNullability added in v1.0.0

func (m *ParameterizedMapType) SetNullability(n Nullability) FuncDefArgType

func (*ParameterizedMapType) String added in v1.0.0

func (m *ParameterizedMapType) String() string

type ParameterizedPrecisionTimestampType added in v1.0.0

type ParameterizedPrecisionTimestampType = parameterizedTypeSingleIntegerParam[*PrecisionTimestampType]

create type aliases to the generic structs

type ParameterizedPrecisionTimestampTzType added in v1.0.0

type ParameterizedPrecisionTimestampTzType = parameterizedTypeSingleIntegerParam[*PrecisionTimestampTzType]

create type aliases to the generic structs

type ParameterizedStructType added in v1.0.0

type ParameterizedStructType struct {
	Nullability      Nullability
	TypeVariationRef uint32
	Types            []FuncDefArgType
}

ParameterizedStructType is a parameter type struct example: Struct<Decimal(P,S), INT8> or Struct<INT8>.

func (*ParameterizedStructType) GetParameterizedParams added in v1.0.0

func (m *ParameterizedStructType) GetParameterizedParams() []interface{}

func (*ParameterizedStructType) HasParameterizedParam added in v1.0.0

func (m *ParameterizedStructType) HasParameterizedParam() bool

func (*ParameterizedStructType) MatchWithNullability added in v1.0.0

func (m *ParameterizedStructType) MatchWithNullability(ot Type) bool

func (*ParameterizedStructType) MatchWithoutNullability added in v1.0.0

func (m *ParameterizedStructType) MatchWithoutNullability(ot Type) bool

func (*ParameterizedStructType) SetNullability added in v1.0.0

func (m *ParameterizedStructType) SetNullability(n Nullability) FuncDefArgType

func (*ParameterizedStructType) String added in v1.0.0

func (m *ParameterizedStructType) String() string

type ParameterizedVarCharType added in v1.0.0

type ParameterizedVarCharType = parameterizedTypeSingleIntegerParam[*VarCharType]

create type aliases to the generic structs

type PrecisionTimestamp added in v0.7.0

type PrecisionTimestamp = proto.Expression_Literal_PrecisionTimestamp_

type PrecisionTimestampType added in v0.7.0

type PrecisionTimestampType struct {
	Precision        TimePrecision
	TypeVariationRef uint32
	Nullability      Nullability
}

PrecisionTimestampType this is used to represent a type of Precision timestamp

func NewPrecisionTimestampType added in v0.6.0

func NewPrecisionTimestampType(precision TimePrecision) *PrecisionTimestampType

NewPrecisionTimestampType creates a type of new Precision timestamp. Created type has Nullability as Nullable

func (*PrecisionTimestampType) BaseString added in v1.0.0

func (m *PrecisionTimestampType) BaseString() string

func (*PrecisionTimestampType) Equals added in v0.7.0

func (m *PrecisionTimestampType) Equals(rhs Type) bool

func (*PrecisionTimestampType) GetNullability added in v0.7.0

func (m *PrecisionTimestampType) GetNullability() Nullability

func (*PrecisionTimestampType) GetPrecision added in v1.0.0

func (m *PrecisionTimestampType) GetPrecision() TimePrecision

func (*PrecisionTimestampType) GetPrecisionProtoVal added in v0.7.0

func (m *PrecisionTimestampType) GetPrecisionProtoVal() int32

func (*PrecisionTimestampType) GetType added in v0.7.0

func (m *PrecisionTimestampType) GetType() Type

func (*PrecisionTimestampType) GetTypeVariationReference added in v0.7.0

func (m *PrecisionTimestampType) GetTypeVariationReference() uint32

func (*PrecisionTimestampType) ParameterString added in v1.0.0

func (m *PrecisionTimestampType) ParameterString() string

func (*PrecisionTimestampType) ShortString added in v0.7.0

func (*PrecisionTimestampType) ShortString() string

func (*PrecisionTimestampType) String added in v0.7.0

func (m *PrecisionTimestampType) String() string

func (*PrecisionTimestampType) ToProto added in v0.7.0

func (m *PrecisionTimestampType) ToProto() *proto.Type

func (*PrecisionTimestampType) ToProtoFuncArg added in v0.7.0

func (m *PrecisionTimestampType) ToProtoFuncArg() *proto.FunctionArgument

func (*PrecisionTimestampType) WithNullability added in v0.7.0

func (m *PrecisionTimestampType) WithNullability(n Nullability) Type

type PrecisionTimestampTz added in v0.7.0

type PrecisionTimestampTz = proto.Expression_Literal_PrecisionTimestampTz

type PrecisionTimestampTzType added in v0.7.0

type PrecisionTimestampTzType struct {
	PrecisionTimestampType
}

PrecisionTimestampTzType this is used to represent a type of Precision timestamp with TimeZone

func NewPrecisionTimestampTzType added in v0.6.0

func NewPrecisionTimestampTzType(precision TimePrecision) *PrecisionTimestampTzType

NewPrecisionTimestampTzType creates a type of new Precision timestamp with TimeZone. Created type has Nullability as Nullable

func (*PrecisionTimestampTzType) BaseString added in v1.0.0

func (m *PrecisionTimestampTzType) BaseString() string

func (*PrecisionTimestampTzType) Equals added in v0.7.0

func (m *PrecisionTimestampTzType) Equals(rhs Type) bool

func (*PrecisionTimestampTzType) ShortString added in v0.7.0

func (*PrecisionTimestampTzType) ShortString() string

func (*PrecisionTimestampTzType) String added in v0.7.0

func (m *PrecisionTimestampTzType) String() string

func (*PrecisionTimestampTzType) ToProto added in v0.7.0

func (m *PrecisionTimestampTzType) ToProto() *proto.Type

func (*PrecisionTimestampTzType) ToProtoFuncArg added in v0.7.0

func (m *PrecisionTimestampTzType) ToProtoFuncArg() *proto.FunctionArgument

func (*PrecisionTimestampTzType) WithNullability added in v0.7.0

func (m *PrecisionTimestampTzType) WithNullability(n Nullability) Type

type PrimitiveType

type PrimitiveType[T primitiveTypeIFace] struct {
	Nullability      Nullability
	TypeVariationRef uint32
}

PrimitiveType is a generic implementation of simple primitive types which only need to track if they are nullable and if they are a type variation.

func (*PrimitiveType[T]) Equals

func (s *PrimitiveType[T]) Equals(rhs Type) bool

func (*PrimitiveType[T]) GetNullability

func (s *PrimitiveType[T]) GetNullability() Nullability

func (*PrimitiveType[T]) GetParameterizedParams added in v1.0.0

func (s *PrimitiveType[T]) GetParameterizedParams() []interface{}

func (*PrimitiveType[T]) GetType

func (s *PrimitiveType[T]) GetType() Type

func (*PrimitiveType[T]) GetTypeVariationReference

func (s *PrimitiveType[T]) GetTypeVariationReference() uint32

func (*PrimitiveType[T]) HasParameterizedParam added in v1.0.0

func (s *PrimitiveType[T]) HasParameterizedParam() bool

func (*PrimitiveType[T]) MatchWithNullability added in v1.0.0

func (s *PrimitiveType[T]) MatchWithNullability(ot Type) bool

func (*PrimitiveType[T]) MatchWithoutNullability added in v1.0.0

func (s *PrimitiveType[T]) MatchWithoutNullability(ot Type) bool

func (*PrimitiveType[T]) SetNullability added in v1.0.0

func (s *PrimitiveType[T]) SetNullability(n Nullability) FuncDefArgType

func (*PrimitiveType[T]) ShortString

func (*PrimitiveType[T]) ShortString() string

func (*PrimitiveType[T]) String

func (s *PrimitiveType[T]) String() string

func (*PrimitiveType[T]) ToProtoFuncArg

func (s *PrimitiveType[T]) ToProtoFuncArg() *proto.FunctionArgument

func (*PrimitiveType[T]) WithNullability

func (s *PrimitiveType[T]) WithNullability(n Nullability) Type

type SortDirection

type SortDirection proto.SortField_SortDirection

func (SortDirection) String

func (s SortDirection) String() string

type SortKind

type SortKind interface {
	fmt.Stringer
	// contains filtered or unexported methods
}

type StringParameter

type StringParameter string

StringParameter is a type parameter which is a string value

func (StringParameter) Equals

func (b StringParameter) Equals(p TypeParam) bool

func (StringParameter) ToProto

func (p StringParameter) ToProto() *proto.Type_Parameter

type StringType

type StringType = PrimitiveType[string]

create type aliases to the generic structs

type StructType

type StructType struct {
	Nullability      Nullability
	TypeVariationRef uint32
	Types            []Type
}

func (*StructType) BaseString added in v1.0.0

func (*StructType) BaseString() string

func (*StructType) Equals

func (t *StructType) Equals(rhs Type) bool

func (*StructType) GetNullability

func (s *StructType) GetNullability() Nullability

func (*StructType) GetType

func (s *StructType) GetType() Type

func (*StructType) GetTypeVariationReference

func (s *StructType) GetTypeVariationReference() uint32

func (*StructType) ParameterString added in v1.0.0

func (t *StructType) ParameterString() string

func (*StructType) ShortString

func (*StructType) ShortString() string

func (*StructType) String

func (t *StructType) String() string

func (*StructType) ToProto

func (t *StructType) ToProto() *proto.Type

func (*StructType) ToProtoFuncArg

func (t *StructType) ToProtoFuncArg() *proto.FunctionArgument

func (*StructType) WithNullability

func (s *StructType) WithNullability(n Nullability) Type

type Time

type Time int64

type TimePrecision added in v0.6.0

type TimePrecision int32

TimePrecision is used to represent the precision of a timestamp

const (
	PrecisionUnknown TimePrecision = -1
	// below precision values are proto values
	PrecisionSeconds        TimePrecision = 0
	PrecisionDeciSeconds    TimePrecision = 1
	PrecisionCentiSeconds   TimePrecision = 2
	PrecisionMilliSeconds   TimePrecision = 3
	PrecisionEMinus4Seconds TimePrecision = 4 // 10^-4 of seconds
	PrecisionEMinus5Seconds TimePrecision = 5 // 10^-5 of seconds
	PrecisionMicroSeconds   TimePrecision = 6
	PrecisionEMinus7Seconds TimePrecision = 7 // 10^-7 of seconds
	PrecisionEMinus8Seconds TimePrecision = 8 // 10^-8 of seconds
	PrecisionNanoSeconds    TimePrecision = 9
)

func ProtoToTimePrecision added in v0.6.0

func ProtoToTimePrecision(val int32) (TimePrecision, error)

func (TimePrecision) ToProtoVal added in v0.6.0

func (m TimePrecision) ToProtoVal() int32

type TimeType

type TimeType = PrimitiveType[Time]

create type aliases to the generic structs

type Timestamp

type Timestamp int64

type TimestampType

type TimestampType = PrimitiveType[Timestamp]

create type aliases to the generic structs

type TimestampTz

type TimestampTz int64

type TimestampTzType

type TimestampTzType = PrimitiveType[TimestampTz]

create type aliases to the generic structs

type Type

type Type interface {
	FuncArg

	fmt.Stringer
	ShortString() string
	GetType() Type
	GetNullability() Nullability
	GetTypeVariationReference() uint32
	Equals(Type) bool
	// WithNullability returns a copy of this type but with
	// the nullability set to the passed in value
	WithNullability(Nullability) Type
	// contains filtered or unexported methods
}

Type corresponds to the proto.Type message and represents a specific type. These are types which can be present in plan (are serializable)

func SimpleTypeNameToType added in v0.7.0

func SimpleTypeNameToType(name TypeName) (Type, error)

func TypeFromProto

func TypeFromProto(t *proto.Type) Type

TypeFromProto returns the appropriate Type object from a protobuf type message.

type TypeName added in v0.7.0

type TypeName string
const (
	TypeNameI8           TypeName = "i8"
	TypeNameI16          TypeName = "i16"
	TypeNameI32          TypeName = "i32"
	TypeNameI64          TypeName = "i64"
	TypeNameFp32         TypeName = "fp32"
	TypeNameFp64         TypeName = "fp64"
	TypeNameString       TypeName = "string"
	TypeNameBinary       TypeName = "binary"
	TypeNameBoolean      TypeName = "boolean"
	TypeNameDate         TypeName = "date"
	TypeNameTime         TypeName = "time"
	TypeNameTimestamp    TypeName = "timestamp"
	TypeNameTimestampTz  TypeName = "timestamp_tz"
	TypeNameIntervalYear TypeName = "interval_year"
	TypeNameIntervalDay  TypeName = "interval_day"
	TypeNameUUID         TypeName = "uuid"
	TypeNameUDT          TypeName = "u!"

	TypeNameFixedBinary          TypeName = "fixedbinary"
	TypeNameFixedChar            TypeName = "fixedchar"
	TypeNameVarChar              TypeName = "varchar"
	TypeNameDecimal              TypeName = "decimal"
	TypeNamePrecisionTimestamp   TypeName = "precision_timestamp"
	TypeNamePrecisionTimestampTz TypeName = "precision_timestamp_tz"
)

type TypeParam

type TypeParam interface {
	ToProto() *proto.Type_Parameter
	Equals(TypeParam) bool
}

TypeParam represents a type parameter for a user defined type

func TypeParamFromProto

func TypeParamFromProto(p *proto.Type_Parameter) TypeParam

TypeParamFromProto converts a protobuf Type_Parameter message to a TypeParam object for processing.

type UUID

type UUID []byte

type UUIDType

type UUIDType = PrimitiveType[UUID]

create type aliases to the generic structs

type UserDefinedType

type UserDefinedType struct {
	Nullability      Nullability
	TypeVariationRef uint32
	TypeReference    uint32
	TypeParameters   []TypeParam
}

func (*UserDefinedType) Equals

func (t *UserDefinedType) Equals(rhs Type) bool

func (*UserDefinedType) GetNullability

func (s *UserDefinedType) GetNullability() Nullability

func (*UserDefinedType) GetType

func (s *UserDefinedType) GetType() Type

func (*UserDefinedType) GetTypeVariationReference

func (s *UserDefinedType) GetTypeVariationReference() uint32

func (*UserDefinedType) ShortString

func (*UserDefinedType) ShortString() string

exists for meeting the interface, but the correct short name for a user defined type is "u!name" which requires looking up the type first via the type reference to find the name.

func (*UserDefinedType) String

func (t *UserDefinedType) String() string

func (*UserDefinedType) ToProto

func (t *UserDefinedType) ToProto() *proto.Type

func (*UserDefinedType) ToProtoFuncArg

func (t *UserDefinedType) ToProtoFuncArg() *proto.FunctionArgument

func (*UserDefinedType) WithNullability

func (s *UserDefinedType) WithNullability(n Nullability) Type

type VarCharType

type VarCharType = FixedLenType[VarChar]

create type aliases to the generic structs

type Version

type Version = proto.Version

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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