Documentation ¶
Index ¶
- Constants
- func TypeToProto(t Type) *proto.Type
- type AggregationInvocation
- type AggregationPhase
- type BinaryType
- type BooleanParameter
- type BooleanType
- type CastFailBehavior
- type DataTypeParameter
- type Date
- type DateType
- type Decimal
- type DecimalType
- func (s *DecimalType) Equals(rhs Type) bool
- func (s *DecimalType) GetNullability() Nullability
- func (s *DecimalType) GetType() Type
- func (s *DecimalType) GetTypeVariationReference() uint32
- func (*DecimalType) ShortString() string
- func (t *DecimalType) String() string
- func (t *DecimalType) ToProto() *proto.Type
- func (s *DecimalType) ToProtoFuncArg() *proto.FunctionArgument
- func (s *DecimalType) WithNullability(n Nullability) Type
- type Enum
- type EnumParameter
- type FixedBinary
- type FixedBinaryType
- type FixedChar
- type FixedCharType
- type FixedLenType
- func (s *FixedLenType[T]) Equals(rhs Type) bool
- func (s *FixedLenType[T]) GetNullability() Nullability
- func (s *FixedLenType[T]) GetType() Type
- func (s *FixedLenType[T]) GetTypeVariationReference() uint32
- func (*FixedLenType[T]) ShortString() string
- func (s *FixedLenType[T]) String() string
- func (s *FixedLenType[T]) ToProtoFuncArg() *proto.FunctionArgument
- func (s *FixedLenType[T]) WithNullability(n Nullability) Type
- type Float32Type
- type Float64Type
- type FuncArg
- type FunctionOption
- type FunctionRef
- type Int16Type
- type Int32Type
- type Int64Type
- type Int8Type
- type IntegerParameter
- type IntervalDayToSecond
- type IntervalDayType
- type IntervalYearToMonth
- type IntervalYearType
- type ListType
- func (t *ListType) Equals(rhs Type) bool
- func (s *ListType) GetNullability() Nullability
- func (s *ListType) GetType() Type
- func (s *ListType) GetTypeVariationReference() uint32
- func (*ListType) ShortString() string
- func (t *ListType) String() string
- func (t *ListType) ToProto() *proto.Type
- func (t *ListType) ToProtoFuncArg() *proto.FunctionArgument
- func (s *ListType) WithNullability(n Nullability) Type
- type MapType
- func (t *MapType) Equals(rhs Type) bool
- func (s *MapType) GetNullability() Nullability
- func (s *MapType) GetType() Type
- func (s *MapType) GetTypeVariationReference() uint32
- func (t *MapType) ShortString() string
- func (t *MapType) String() string
- func (t *MapType) ToProto() *proto.Type
- func (t *MapType) ToProtoFuncArg() *proto.FunctionArgument
- func (s *MapType) WithNullability(n Nullability) Type
- type NamedStruct
- type NullParameter
- type Nullability
- type PrimitiveType
- func (s *PrimitiveType[T]) Equals(rhs Type) bool
- func (s *PrimitiveType[T]) GetNullability() Nullability
- func (s *PrimitiveType[T]) GetType() Type
- func (s *PrimitiveType[T]) GetTypeVariationReference() uint32
- func (*PrimitiveType[T]) ShortString() string
- func (s *PrimitiveType[T]) String() string
- func (s *PrimitiveType[T]) ToProtoFuncArg() *proto.FunctionArgument
- func (s *PrimitiveType[T]) WithNullability(n Nullability) Type
- type SortDirection
- type SortKind
- type StringParameter
- type StringType
- type StructType
- func (t *StructType) Equals(rhs Type) bool
- func (s *StructType) GetNullability() Nullability
- func (s *StructType) GetType() Type
- func (s *StructType) GetTypeVariationReference() uint32
- func (*StructType) ShortString() string
- func (t *StructType) String() string
- func (t *StructType) ToProto() *proto.Type
- func (t *StructType) ToProtoFuncArg() *proto.FunctionArgument
- func (s *StructType) WithNullability(n Nullability) Type
- type Time
- type TimeType
- type Timestamp
- type TimestampType
- type TimestampTz
- type TimestampTzType
- type Type
- type TypeParam
- type UUID
- type UUIDType
- type UserDefinedLiteral
- type UserDefinedType
- func (t *UserDefinedType) Equals(rhs Type) bool
- func (s *UserDefinedType) GetNullability() Nullability
- func (s *UserDefinedType) GetType() Type
- func (s *UserDefinedType) GetTypeVariationReference() uint32
- func (*UserDefinedType) ShortString() string
- func (t *UserDefinedType) String() string
- func (t *UserDefinedType) ToProto() *proto.Type
- func (t *UserDefinedType) ToProtoFuncArg() *proto.FunctionArgument
- func (s *UserDefinedType) WithNullability(n Nullability) Type
- type VarChar
- type VarCharType
- type Version
Constants ¶
const ( NullabilityUnspecified = proto.Type_NULLABILITY_UNSPECIFIED NullabilityNullable = proto.Type_NULLABILITY_NULLABLE NullabilityRequired = proto.Type_NULLABILITY_REQUIRED )
const ( AggPhaseUnspecified = proto.AggregationPhase_AGGREGATION_PHASE_UNSPECIFIED AggPhaseInitialToIntermediate = proto.AggregationPhase_AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE AggPhaseIntermediateToIntermediate = proto.AggregationPhase_AGGREGATION_PHASE_INTERMEDIATE_TO_INTERMEDIATE AggPhaseInitialToResult = proto.AggregationPhase_AGGREGATION_PHASE_INITIAL_TO_RESULT AggPhaseIntermediateToResult = proto.AggregationPhase_AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT )
const ( AggInvocationUnspecified = proto.AggregateFunction_AGGREGATION_INVOCATION_UNSPECIFIED AggInvocationAll = proto.AggregateFunction_AGGREGATION_INVOCATION_ALL AggInvocationDistinct = proto.AggregateFunction_AGGREGATION_INVOCATION_DISTINCT )
const ( SortUnspecified = SortDirection(proto.SortField_SORT_DIRECTION_UNSPECIFIED) SortAscNullsFirst = SortDirection(proto.SortField_SORT_DIRECTION_ASC_NULLS_FIRST) SortAscNullsLast = SortDirection(proto.SortField_SORT_DIRECTION_ASC_NULLS_LAST) SortDescNullsFirst = SortDirection(proto.SortField_SORT_DIRECTION_DESC_NULLS_FIRST) SortDescNullsLast = SortDirection(proto.SortField_SORT_DIRECTION_ASC_NULLS_LAST) SortClustered = SortDirection(proto.SortField_SORT_DIRECTION_CLUSTERED) )
const ( BehaviorUnspecified = proto.Expression_Cast_FAILURE_BEHAVIOR_UNSPECIFIED BehaviorReturnNil = proto.Expression_Cast_FAILURE_BEHAVIOR_RETURN_NULL BehaviorThrowException = proto.Expression_Cast_FAILURE_BEHAVIOR_THROW_EXCEPTION )
Variables ¶
This section is empty.
Functions ¶
func TypeToProto ¶
TypeToProto properly constructs the appropriate protobuf message for the given type.
Types ¶
type AggregationInvocation ¶
type AggregationInvocation = proto.AggregateFunction_AggregationInvocation
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 CastFailBehavior ¶
type CastFailBehavior = proto.Expression_Cast_FailureBehavior
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 Decimal ¶
type Decimal = proto.Expression_Literal_Decimal
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) 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 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 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 IntervalDayToSecond ¶
type IntervalDayToSecond = proto.Expression_Literal_IntervalDayToSecond
type IntervalDayType ¶
type IntervalDayType = PrimitiveType[IntervalDayToSecond]
create type aliases to the generic structs
type IntervalYearToMonth ¶
type IntervalYearToMonth = proto.Expression_Literal_IntervalYearToMonth
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) GetNullability ¶
func (s *ListType) GetNullability() Nullability
func (*ListType) GetTypeVariationReference ¶
func (*ListType) ShortString ¶
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) GetNullability ¶
func (s *MapType) GetNullability() Nullability
func (*MapType) GetTypeVariationReference ¶
func (*MapType) ShortString ¶
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 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 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 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 ¶
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 UserDefinedLiteral ¶
type UserDefinedLiteral = proto.Expression_Literal_UserDefined
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 VarChar ¶
type VarChar = proto.Expression_Literal_VarChar
type VarCharType ¶
type VarCharType = FixedLenType[VarChar]
create type aliases to the generic structs