Documentation
¶
Index ¶
- Constants
- Variables
- func CastTo(v Value, dst interface{}) error
- func DictFields(v Value) (map[Value]Value, error)deprecated
- func DictValues(v Value) (map[Value]Value, error)
- func Equal(lhs, rhs Type) bool
- func StructFields(v Value) (map[string]Value, error)
- func WriteTypeStringTo(buf *bytes.Buffer, t Type)deprecated
- type Decimal
- type DictValueOption
- type RawValue
- type Scanner
- type StructOption
- type StructValueOption
- type Type
- func DecimalType(precision, scale uint32) Type
- func DecimalTypeFromDecimal(d *Decimal) Type
- func Dict(k, v Type) Type
- func IsOptional(t Type) (isOptional bool, innerType Type)
- func List(t Type) Type
- func Optional(t Type) Type
- func Struct(opts ...StructOption) Type
- func Tuple(elems ...Type) Type
- func VariantStruct(opts ...StructOption) Type
- func VariantTuple(elems ...Type) Type
- func Void() Type
- type UUIDBytesWithIssue1501Type
- type Value
- func BoolValue(v bool) Value
- func BytesValue(v []byte) Value
- func BytesValueFromString(v string) Value
- func DateValue(v uint32) Value
- func DateValueFromTime(t time.Time) Value
- func DatetimeValue(v uint32) Value
- func DatetimeValueFromTime(t time.Time) Value
- func DecimalValue(v *Decimal) Value
- func DecimalValueFromBigInt(v *big.Int, precision, scale uint32) Value
- func DecimalValueFromString(str string, precision, scale uint32) (Value, error)
- func DictValue(opts ...DictValueOption) Value
- func DoubleValue(v float64) Value
- func DyNumberValue(v string) Value
- func FloatValue(v float32) Value
- func Int16Value(v int16) Value
- func Int32Value(v int32) Value
- func Int64Value(v int64) Value
- func Int8Value(v int8) Value
- func IntervalValue(v int64) Valuedeprecated
- func IntervalValueFromDuration(v time.Duration) Value
- func IntervalValueFromMicroseconds(v int64) Value
- func JSONDocumentValue(v string) Value
- func JSONDocumentValueFromBytes(v []byte) Value
- func JSONValue(v string) Value
- func JSONValueFromBytes(v []byte) Value
- func ListItems(v Value) ([]Value, error)
- func ListValue(vs ...Value) Value
- func NullValue(t Type) Value
- func Nullable(t Type, v interface{}) Value
- func NullableBoolValue(v *bool) Value
- func NullableBytesValue(v *[]byte) Value
- func NullableBytesValueFromString(v *string) Value
- func NullableDateValue(v *uint32) Value
- func NullableDateValueFromTime(v *time.Time) Value
- func NullableDatetimeValue(v *uint32) Value
- func NullableDatetimeValueFromTime(v *time.Time) Value
- func NullableDecimalValue(v *[16]byte, precision, scale uint32) Value
- func NullableDecimalValueFromBigInt(v *big.Int, precision, scale uint32) Value
- func NullableDoubleValue(v *float64) Value
- func NullableDyNumberValue(v *string) Value
- func NullableFloatValue(v *float32) Value
- func NullableInt16Value(v *int16) Value
- func NullableInt32Value(v *int32) Value
- func NullableInt64Value(v *int64) Value
- func NullableInt8Value(v *int8) Value
- func NullableIntervalValue(v *int64) Valuedeprecated
- func NullableIntervalValueFromDuration(v *time.Duration) Value
- func NullableIntervalValueFromMicroseconds(v *int64) Value
- func NullableJSONDocumentValue(v *string) Value
- func NullableJSONDocumentValueFromBytes(v *[]byte) Value
- func NullableJSONValue(v *string) Value
- func NullableJSONValueFromBytes(v *[]byte) Value
- func NullableStringValue(v *[]byte) Valuedeprecated
- func NullableStringValueFromString(v *string) Value
- func NullableTextValue(v *string) Value
- func NullableTimestampValue(v *uint64) Value
- func NullableTimestampValueFromTime(v *time.Time) Value
- func NullableTzDateValue(v *string) Value
- func NullableTzDateValueFromTime(v *time.Time) Value
- func NullableTzDatetimeValue(v *string) Value
- func NullableTzDatetimeValueFromTime(v *time.Time) Value
- func NullableTzTimestampValue(v *string) Value
- func NullableTzTimestampValueFromTime(v *time.Time) Value
- func NullableUTF8Value(v *string) Value
- func NullableUUIDTypedValue(v *uuid.UUID) Value
- func NullableUUIDValue(v *[16]byte) Value
- func NullableUUIDValueWithIssue1501(v *[16]byte) Value
- func NullableUint16Value(v *uint16) Value
- func NullableUint32Value(v *uint32) Value
- func NullableUint64Value(v *uint64) Value
- func NullableUint8Value(v *uint8) Value
- func NullableYSONValue(v *string) Value
- func NullableYSONValueFromBytes(v *[]byte) Value
- func OptionalValue(v Value) Value
- func SetValue(vs ...Value) Value
- func StringValue(v []byte) Valuedeprecated
- func StringValueFromString(v string) Value
- func StructValue(opts ...StructValueOption) Value
- func TextValue(v string) Value
- func TimestampValue(v uint64) Value
- func TimestampValueFromTime(t time.Time) Value
- func TupleItems(v Value) ([]Value, error)
- func TupleValue(vs ...Value) Value
- func TzDateValue(v string) Value
- func TzDateValueFromTime(t time.Time) Value
- func TzDatetimeValue(v string) Value
- func TzDatetimeValueFromTime(t time.Time) Value
- func TzTimestampValue(v string) Value
- func TzTimestampValueFromTime(t time.Time) Value
- func UTF8Value(v string) Value
- func UUIDValue(v [16]byte) Valuedeprecated
- func UUIDWithIssue1501Value(v [16]byte) Value
- func Uint16Value(v uint16) Value
- func Uint32Value(v uint32) Value
- func Uint64Value(v uint64) Value
- func Uint8Value(v uint8) Value
- func UuidValue(v uuid.UUID) Value
- func VariantValue(v Value) (name string, idx uint32, _ Value, _ error)
- func VariantValueStruct(v Value, name string, variantT Type) Value
- func VariantValueTuple(v Value, i uint32, variantT Type) Value
- func VoidValue() Value
- func YSONValue(v string) Value
- func YSONValueFromBytes(v []byte) Value
- func ZeroValue(t Type) Value
Constants ¶
const ( TypeUnknown = types.Unknown TypeBool = types.Bool TypeInt8 = types.Int8 TypeUint8 = types.Uint8 TypeInt16 = types.Int16 TypeUint16 = types.Uint16 TypeInt32 = types.Int32 TypeUint32 = types.Uint32 TypeInt64 = types.Int64 TypeUint64 = types.Uint64 TypeFloat = types.Float TypeDouble = types.Double TypeDate = types.Date TypeDatetime = types.Datetime TypeTimestamp = types.Timestamp TypeInterval = types.Interval TypeTzDate = types.TzDate TypeTzDatetime = types.TzDatetime TypeTzTimestamp = types.TzTimestamp TypeString = types.Bytes TypeBytes = types.Bytes TypeUTF8 = types.Text TypeText = types.Text TypeYSON = types.YSON TypeJSON = types.JSON TypeUUID = types.UUID TypeJSONDocument = types.JSONDocument TypeDyNumber = types.DyNumber )
Primitive types known by YDB.
Variables ¶
var DefaultDecimal = DecimalType(decimalPrecision, decimalScale)
Functions ¶
func DictFields
deprecated
added in
v3.39.0
DictFields returns dict values from abstract Value
Deprecated: use DictValues instead. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func DictValues ¶ added in v3.48.0
DictValues returns dict values from abstract Value
func StructFields ¶ added in v3.39.0
StructFields returns struct fields from abstract Value
func WriteTypeStringTo
deprecated
WriteTypeStringTo writes ydb type string representation into buffer
Deprecated: use types.Type.Yql() instead. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
Types ¶
type DictValueOption ¶ added in v3.29.0
type DictValueOption func(*dictValueFields)
func DictFieldValue ¶ added in v3.29.0
func DictFieldValue(k, v Value) DictValueOption
type StructOption ¶
type StructOption func(*tStructType)
func StructField ¶
func StructField(name string, t Type) StructOption
type StructValueOption ¶
type StructValueOption func(*structValueFields)
func StructFieldValue ¶
func StructFieldValue(name string, v Value) StructValueOption
type Type ¶
Type describes YDB data types.
func DecimalType ¶
func DecimalTypeFromDecimal ¶
func IsOptional ¶ added in v3.48.3
IsOptional checks if type is optional and returns innerType if it is.
func Struct ¶
func Struct(opts ...StructOption) Type
func VariantStruct ¶ added in v3.39.0
func VariantStruct(opts ...StructOption) Type
func VariantTuple ¶ added in v3.39.0
type UUIDBytesWithIssue1501Type ¶ added in v3.86.0
type UUIDBytesWithIssue1501Type = value.UUIDIssue1501FixedBytesWrapper
UUIDBytesWithIssue1501Type is type wrapper for scan expected values for values stored with bug https://github.com/ydb-platform/ydb-go-sdk/issues/1501
func NewUUIDBytesWithIssue1501 ¶ added in v3.86.0
func NewUUIDBytesWithIssue1501(val [16]byte) UUIDBytesWithIssue1501Type
type Value ¶
func BytesValue ¶ added in v3.36.0
func BytesValueFromString ¶ added in v3.36.0
func DateValueFromTime ¶
DateValueFromTime makes Date value from time.Time
Warning: all *From* helpers will be removed at next major release (functional will be implements with go1.18 type lists)
func DatetimeValue ¶
DatetimeValue makes ydb datetime value from seconds since Epoch
func DatetimeValueFromTime ¶
DatetimeValueFromTime makes Datetime value from time.Time
Warning: all *From* helpers will be removed at next major release (functional will be implements with go1.18 type lists)
func DecimalValue ¶
DecimalValue creates decimal value of given types t and value v. Note that Decimal.Bytes interpreted as big-endian int128.
func DecimalValueFromBigInt ¶
func DecimalValueFromString ¶ added in v3.78.0
func DictValue ¶
func DictValue(opts ...DictValueOption) Value
func DoubleValue ¶
func DyNumberValue ¶
func FloatValue ¶
func Int16Value ¶
func Int32Value ¶
func Int64Value ¶
func IntervalValue
deprecated
IntervalValue makes Value from given microseconds value
Deprecated: use IntervalValueFromMicroseconds instead. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func IntervalValueFromDuration ¶
IntervalValueFromDuration makes Interval value from time.Duration
Warning: all *From* helpers will be removed at next major release (functional will be implements with go1.18 type lists)
func IntervalValueFromMicroseconds ¶ added in v3.26.9
IntervalValueFromMicroseconds makes Value from given microseconds value
func JSONDocumentValue ¶
func JSONDocumentValueFromBytes ¶
JSONDocumentValueFromBytes makes JSONDocument value from bytes
Warning: all *From* helpers will be removed at next major release (functional will be implements with go1.18 type lists)
func JSONValueFromBytes ¶
JSONValueFromBytes makes JSON value from bytes
Warning: all *From* helpers will be removed at next major release (functional will be implements with go1.18 type lists)
func NullableBoolValue ¶ added in v3.15.0
func NullableBytesValue ¶ added in v3.36.2
func NullableBytesValueFromString ¶ added in v3.36.2
func NullableDateValue ¶ added in v3.15.0
func NullableDateValueFromTime ¶ added in v3.15.0
func NullableDatetimeValue ¶ added in v3.15.0
func NullableDatetimeValueFromTime ¶ added in v3.15.0
func NullableDecimalValue ¶ added in v3.80.9
func NullableDecimalValueFromBigInt ¶ added in v3.80.9
func NullableDoubleValue ¶ added in v3.15.0
func NullableDyNumberValue ¶ added in v3.15.0
func NullableFloatValue ¶ added in v3.15.0
func NullableInt16Value ¶ added in v3.15.0
func NullableInt32Value ¶ added in v3.15.0
func NullableInt64Value ¶ added in v3.15.0
func NullableInt8Value ¶ added in v3.15.0
func NullableIntervalValue
deprecated
added in
v3.15.0
NullableIntervalValue makes Value which maybe nil or valued
Deprecated: use NullableIntervalValueFromMicroseconds instead. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func NullableIntervalValueFromDuration ¶ added in v3.15.0
func NullableIntervalValueFromMicroseconds ¶ added in v3.26.9
func NullableJSONDocumentValue ¶ added in v3.15.0
func NullableJSONDocumentValueFromBytes ¶ added in v3.15.0
func NullableJSONValue ¶ added in v3.15.0
func NullableJSONValueFromBytes ¶ added in v3.15.0
func NullableStringValue
deprecated
added in
v3.15.0
NullableStringValue
Deprecated: use NullableBytesValue instead. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func NullableStringValueFromString ¶ added in v3.15.0
func NullableTextValue ¶ added in v3.36.2
func NullableTimestampValue ¶ added in v3.15.0
func NullableTimestampValueFromTime ¶ added in v3.15.0
func NullableTzDateValue ¶ added in v3.15.0
func NullableTzDateValueFromTime ¶ added in v3.15.0
func NullableTzDatetimeValue ¶ added in v3.15.0
func NullableTzDatetimeValueFromTime ¶ added in v3.15.0
func NullableTzTimestampValue ¶ added in v3.15.0
func NullableTzTimestampValueFromTime ¶ added in v3.15.0
func NullableUTF8Value ¶ added in v3.15.0
func NullableUUIDTypedValue ¶ added in v3.86.0
func NullableUUIDValue ¶ added in v3.15.0
func NullableUUIDValueWithIssue1501 ¶ added in v3.86.0
func NullableUint16Value ¶ added in v3.15.0
func NullableUint32Value ¶ added in v3.15.0
func NullableUint64Value ¶ added in v3.15.0
func NullableUint8Value ¶ added in v3.15.0
func NullableYSONValue ¶ added in v3.15.0
func NullableYSONValueFromBytes ¶ added in v3.15.0
func OptionalValue ¶
func StringValue
deprecated
StringValue returns bytes value
Deprecated: use BytesValue instead. Will be removed after Oct 2024. Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func StringValueFromString ¶
StringValueFromString makes String value from string
Warning: all *From* helpers will be removed at next major release (functional will be implements with go1.18 type lists)
func StructValue ¶
func StructValue(opts ...StructValueOption) Value
func TimestampValue ¶
TimestampValue makes ydb timestamp value from microseconds since Epoch
func TimestampValueFromTime ¶
TimestampValueFromTime makes Timestamp value from time.Time
Warning: all *From* helpers will be removed at next major release (functional will be implements with go1.18 type lists)
func TupleItems ¶ added in v3.39.0
TupleItems returns tuple items from abstract Value
func TupleValue ¶
func TzDateValueFromTime ¶
TzDateValueFromTime makes TzDate value from time.Time
Warning: all *From* helpers will be removed at next major release (functional will be implements with go1.18 type lists)
func TzDatetimeValue ¶
TzDatetimeValue makes TzDatetime value from string
func TzDatetimeValueFromTime ¶
TzDatetimeValueFromTime makes TzDatetime value from time.Time
Warning: all *From* helpers will be removed at next major release (functional will be implements with go1.18 type lists)
func TzTimestampValue ¶
TzTimestampValue makes TzTimestamp value from string
func TzTimestampValueFromTime ¶
TzTimestampValueFromTime makes TzTimestamp value from time.Time
Warning: all *From* helpers will be removed at next major release (functional will be implements with go1.18 type lists)
func UUIDValue
deprecated
UUIDValue has data corruption bug and will be removed in next version.
Deprecated: Use UuidValue (prefer) or UUIDWithIssue1501Value (for save old behavior) instead. https://github.com/ydb-platform/ydb-go-sdk/issues/1501
func UUIDWithIssue1501Value ¶ added in v3.86.0
UUIDWithIssue1501Value is function for save uuid with old corrupted data format for save old behavior https://github.com/ydb-platform/ydb-go-sdk/issues/1501
Use UuidValue for all new code
func Uint16Value ¶
func Uint32Value ¶
func Uint64Value ¶
func Uint8Value ¶
func VariantValue ¶
VariantValue returns variant value from abstract Value
func VariantValueStruct ¶ added in v3.39.0
func VariantValueTuple ¶ added in v3.39.0
func YSONValueFromBytes ¶
YSONValueFromBytes makes YSON value from bytes
Warning: all *From* helpers will be removed at next major release (functional will be implements with go1.18 type lists)