types

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 14

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 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 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 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
}

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) ShortString

func (*DecimalType) ShortString() string

func (*DecimalType) String

func (t *DecimalType) String() string

func (*DecimalType) ToProto

func (t *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] 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]) Equals

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

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]) 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]) WithNullability

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

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 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 IntervalDayType

type IntervalDayType = PrimitiveType[IntervalDayToSecond]

create type aliases to the generic structs

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) 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) 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) 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) 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 PrecisionTimeStampType added in v0.6.0

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

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) Equals added in v0.6.0

func (m PrecisionTimeStampType) Equals(rhs Type) bool

func (PrecisionTimeStampType) GetNullability added in v0.6.0

func (m PrecisionTimeStampType) GetNullability() Nullability

func (PrecisionTimeStampType) GetPrecisionProtoVal added in v0.6.0

func (m PrecisionTimeStampType) GetPrecisionProtoVal() int32

func (PrecisionTimeStampType) GetType added in v0.6.0

func (m PrecisionTimeStampType) GetType() Type

func (PrecisionTimeStampType) GetTypeVariationReference added in v0.6.0

func (m PrecisionTimeStampType) GetTypeVariationReference() uint32

func (PrecisionTimeStampType) ShortString added in v0.6.0

func (PrecisionTimeStampType) ShortString() string

func (PrecisionTimeStampType) String added in v0.6.0

func (m PrecisionTimeStampType) String() string

func (PrecisionTimeStampType) ToProto added in v0.6.0

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

func (PrecisionTimeStampType) ToProtoFuncArg added in v0.6.0

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

func (PrecisionTimeStampType) WithNullability added in v0.6.0

func (m PrecisionTimeStampType) WithNullability(n Nullability) Type

type PrecisionTimeStampTzType added in v0.6.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) Equals added in v0.6.0

func (m PrecisionTimeStampTzType) Equals(rhs Type) bool

func (PrecisionTimeStampTzType) ShortString added in v0.6.0

func (PrecisionTimeStampTzType) ShortString() string

func (PrecisionTimeStampTzType) String added in v0.6.0

func (m PrecisionTimeStampTzType) String() string

func (PrecisionTimeStampTzType) ToProto added in v0.6.0

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

func (PrecisionTimeStampTzType) ToProtoFuncArg added in v0.6.0

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

func (PrecisionTimeStampTzType) WithNullability added in v0.6.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]) GetType

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

func (*PrimitiveType[T]) GetTypeVariationReference

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

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) 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) 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 (
	PrecisionSeconds TimePrecision = iota
	PrecisionDeciSeconds
	PrecisionCentiSeconds
	PrecisionMilliSeconds
	PrecisionEMinus4Seconds // 10^-4 of seconds
	PrecisionEMinus5Seconds // 10^-5 of seconds
	PrecisionMicroSeconds
	PrecisionEMinus7Seconds // 10^-7 of seconds
	PrecisionEMinus8Seconds // 10^-8 of seconds
	PrecisionNanoSeconds
)

precision values are proto values

const PrecisionUnknown TimePrecision = -1

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.

func TypeFromProto

func TypeFromProto(t *proto.Type) Type

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

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