package value
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/value"
Index ¶
- Constants
- Variables
- func BigEndianUint128(hi, lo uint64) (v [16]byte)
- func BoolValue(v bool) boolValue
- func BytesValue(v []byte) bytesValue
- func CastTo(v Value, dst interface{}) error
- func DateToTime(n uint32) time.Time
- func DateValue(v uint32) dateValue
- func DateValueFromTime(t time.Time) dateValue
- func DatetimeToTime(n uint32) time.Time
- func DatetimeValue(v uint32) datetimeValue
- func DatetimeValueFromTime(t time.Time) datetimeValue
- func DecimalValue(v [16]byte, precision, scale uint32) *decimalValue
- func DecimalValueFromBigInt(v *big.Int, precision, scale uint32) *decimalValue
- func DictValue(values ...DictValueField) *dictValue
- func DoubleValue(v float64) *doubleValue
- func DyNumberValue(v string) dyNumberValue
- func FloatValue(v float32) *floatValue
- func FromProtobuf(pb *Ydb.TypedValue) protobufValue
- func Int16Value(v int16) int16Value
- func Int32Value(v int32) int32Value
- func Int64Value(v int64) int64Value
- func Int8Value(v int8) int8Value
- func IntervalToDuration(n int64) time.Duration
- func IntervalValue(v int64) intervalValue
- func IntervalValueFromDuration(v time.Duration) intervalValue
- func JSONDocumentValue(v string) jsonDocumentValue
- func JSONValue(v string) jsonValue
- func ListValue(items ...Value) *listValue
- func NullValue(t types.Type) *optionalValue
- func OptionalValue(v Value) *optionalValue
- func PgValue(oid uint32, val string) pgValue
- func SetValue(items ...Value) *setValue
- func StructValue(fields ...StructValueField) *structValue
- func TextValue(v string) textValue
- func TimestampToTime(n uint64) time.Time
- func TimestampValue(v uint64) timestampValue
- func TimestampValueFromTime(t time.Time) timestampValue
- func ToYDB(v Value, a *allocator.Allocator) *Ydb.TypedValue
- func TupleValue(values ...Value) *tupleValue
- func TzDateToTime(s string) (t time.Time, err error)
- func TzDateValue(v string) tzDateValue
- func TzDateValueFromTime(t time.Time) tzDateValue
- func TzDatetimeToTime(s string) (t time.Time, err error)
- func TzDatetimeValue(v string) tzDatetimeValue
- func TzDatetimeValueFromTime(t time.Time) tzDatetimeValue
- func TzTimestampToTime(s string) (t time.Time, err error)
- func TzTimestampValue(v string) tzTimestampValue
- func TzTimestampValueFromTime(t time.Time) tzTimestampValue
- func UUIDFromYDBPair(high uint64, low uint64) *uuidValue
- func UUIDToHiLoPair(id uuid.UUID) (low, high uint64)
- func UUIDWithIssue1501Value(v [16]byte) *uuidValue
- func Uint16Value(v uint16) uint16Value
- func Uint32Value(v uint32) uint32Value
- func Uint64Value(v uint64) uint64Value
- func Uint8Value(v uint8) uint8Value
- func Uuid(val uuid.UUID) *uuidValue
- func VariantValueStruct(v Value, name string, t types.Type) *variantValue
- func VariantValueTuple(v Value, idx uint32, t types.Type) *variantValue
- func VoidValue() voidValue
- func YSONValue(v []byte) ysonValue
- type DecimalValuer
- type DictValueField
- type StructValueField
- type UUIDIssue1501FixedBytesWrapper
- func NewUUIDIssue1501FixedBytesWrapper(val [16]byte) UUIDIssue1501FixedBytesWrapper
- func (w UUIDIssue1501FixedBytesWrapper) AsBrokenString() string
- func (w UUIDIssue1501FixedBytesWrapper) AsBytesArray() [16]byte
- func (w UUIDIssue1501FixedBytesWrapper) AsBytesSlice() []byte
- func (w UUIDIssue1501FixedBytesWrapper) PublicRevertReorderForIssue1501() uuid.UUID
- type Value
- func DecimalValueFromString(str string, precision, scale uint32) (Value, error)
- func FromYDB(t *Ydb.Type, v *Ydb.Value) Value
- func Nullable(t types.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 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 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 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 NullableUuidValue(v *uuid.UUID) Value
- func NullableYSONValue(v *string) Value
- func NullableYSONValueFromBytes(v *[]byte) Value
- func ZeroValue(t types.Type) Value
Constants ¶
const ( LayoutDate = "2006-01-02" LayoutDatetime = "2006-01-02T15:04:05Z" LayoutTimestamp = "2006-01-02T15:04:05.000000Z" LayoutTzDate = "2006-01-02" LayoutTzDatetime = "2006-01-02T15:04:05" LayoutTzTimestamp = "2006-01-02T15:04:05.000000" )
Date format layouts described in time.Format and time.ANSIC docs.
Variables ¶
var ( ErrCannotCast = errors.New("cast failed") ErrIssue1501BadUUID = errors.New("" /* 178 byte string literal not displayed */) )
Functions ¶
func BigEndianUint128 ¶
BigEndianUint128 builds a big-endian uint128 value.
func BoolValue ¶
func BoolValue(v bool) boolValue
func BytesValue ¶
func BytesValue(v []byte) bytesValue
func CastTo ¶
func DateToTime ¶
DateToTime up to 11761191-01-20 00:00:00 +0000 UTC.
func DateValue ¶
func DateValue(v uint32) dateValue
DateValue returns ydb date value by given days since Epoch
func DateValueFromTime ¶
func DatetimeToTime ¶
DatetimeToTime converts seconds to time.Time Up to 2106-02-07 06:28:15 +0000 UTC.
func DatetimeValue ¶
func DatetimeValue(v uint32) datetimeValue
DatetimeValue makes ydb datetime value from seconds since Epoch
func DatetimeValueFromTime ¶
func DecimalValue ¶
func DecimalValueFromBigInt ¶
func DictValue ¶
func DictValue(values ...DictValueField) *dictValue
func DoubleValue ¶
func DoubleValue(v float64) *doubleValue
func DyNumberValue ¶
func DyNumberValue(v string) dyNumberValue
func FloatValue ¶
func FloatValue(v float32) *floatValue
func FromProtobuf ¶
func FromProtobuf(pb *Ydb.TypedValue) protobufValue
func Int16Value ¶
func Int16Value(v int16) int16Value
func Int32Value ¶
func Int32Value(v int32) int32Value
func Int64Value ¶
func Int64Value(v int64) int64Value
func Int8Value ¶
func Int8Value(v int8) int8Value
func IntervalToDuration ¶
IntervalToDuration returns time.Duration from given microseconds
func IntervalValue ¶
func IntervalValue(v int64) intervalValue
IntervalValue makes Value from given microseconds value
func IntervalValueFromDuration ¶
func JSONDocumentValue ¶
func JSONDocumentValue(v string) jsonDocumentValue
func JSONValue ¶
func JSONValue(v string) jsonValue
func ListValue ¶
func ListValue(items ...Value) *listValue
func NullValue ¶
func OptionalValue ¶
func OptionalValue(v Value) *optionalValue
func PgValue ¶
func SetValue ¶
func SetValue(items ...Value) *setValue
func StructValue ¶
func StructValue(fields ...StructValueField) *structValue
func TextValue ¶
func TextValue(v string) textValue
func TimestampToTime ¶
TimestampToTime converts given microseconds to time.Time Up to 586524-01-19 08:01:49.000551615 +0000 UTC.
func TimestampValue ¶
func TimestampValue(v uint64) timestampValue
TimestampValue makes ydb timestamp value by given microseconds since Epoch
func TimestampValueFromTime ¶
func ToYDB ¶
func ToYDB(v Value, a *allocator.Allocator) *Ydb.TypedValue
func TupleValue ¶
func TupleValue(values ...Value) *tupleValue
func TzDateToTime ¶
func TzDateValue ¶
func TzDateValue(v string) tzDateValue
func TzDateValueFromTime ¶
func TzDatetimeToTime ¶
func TzDatetimeValue ¶
func TzDatetimeValue(v string) tzDatetimeValue
func TzDatetimeValueFromTime ¶
func TzTimestampToTime ¶
func TzTimestampValue ¶
func TzTimestampValue(v string) tzTimestampValue
func TzTimestampValueFromTime ¶
func UUIDFromYDBPair ¶
func UUIDToHiLoPair ¶
func UUIDWithIssue1501Value ¶
func UUIDWithIssue1501Value(v [16]byte) *uuidValue
func Uint16Value ¶
func Uint16Value(v uint16) uint16Value
func Uint32Value ¶
func Uint32Value(v uint32) uint32Value
func Uint64Value ¶
func Uint64Value(v uint64) uint64Value
func Uint8Value ¶
func Uint8Value(v uint8) uint8Value
func Uuid ¶
func VariantValueStruct ¶
func VariantValueTuple ¶
func VoidValue ¶
func VoidValue() voidValue
func YSONValue ¶
func YSONValue(v []byte) ysonValue
Types ¶
type DecimalValuer ¶
type DictValueField ¶
type StructValueField ¶
type UUIDIssue1501FixedBytesWrapper ¶
type UUIDIssue1501FixedBytesWrapper struct {
// contains filtered or unexported fields
}
func NewUUIDIssue1501FixedBytesWrapper ¶
func NewUUIDIssue1501FixedBytesWrapper(val [16]byte) UUIDIssue1501FixedBytesWrapper
func (UUIDIssue1501FixedBytesWrapper) AsBrokenString ¶
func (w UUIDIssue1501FixedBytesWrapper) AsBrokenString() string
func (UUIDIssue1501FixedBytesWrapper) AsBytesArray ¶
func (w UUIDIssue1501FixedBytesWrapper) AsBytesArray() [16]byte
func (UUIDIssue1501FixedBytesWrapper) AsBytesSlice ¶
func (w UUIDIssue1501FixedBytesWrapper) AsBytesSlice() []byte
func (UUIDIssue1501FixedBytesWrapper) PublicRevertReorderForIssue1501 ¶
func (w UUIDIssue1501FixedBytesWrapper) PublicRevertReorderForIssue1501() uuid.UUID
PublicRevertReorderForIssue1501 needs for fix uuid when it was good stored in DB, but read as reordered. It may happen within migration period.
type Value ¶
func DecimalValueFromString ¶
func FromYDB ¶
func Nullable ¶
Nullable makes optional value from nullable type Warning: type interface will be replaced in the future with typed parameters pattern from go1.18
func NullableBoolValue ¶
func NullableBytesValue ¶
func NullableBytesValueFromString ¶
func NullableDateValue ¶
func NullableDateValueFromTime ¶
func NullableDatetimeValue ¶
func NullableDatetimeValueFromTime ¶
func NullableDecimalValue ¶
func NullableDecimalValueFromBigInt ¶
func NullableDoubleValue ¶
func NullableDyNumberValue ¶
func NullableFloatValue ¶
func NullableInt16Value ¶
func NullableInt32Value ¶
func NullableInt64Value ¶
func NullableInt8Value ¶
func NullableIntervalValueFromDuration ¶
func NullableIntervalValueFromMicroseconds ¶
func NullableJSONDocumentValue ¶
func NullableJSONDocumentValueFromBytes ¶
func NullableJSONValue ¶
func NullableJSONValueFromBytes ¶
func NullableTextValue ¶
func NullableTimestampValue ¶
func NullableTimestampValueFromTime ¶
func NullableTzDateValue ¶
func NullableTzDateValueFromTime ¶
func NullableTzDatetimeValue ¶
func NullableTzDatetimeValueFromTime ¶
func NullableTzTimestampValue ¶
func NullableTzTimestampValueFromTime ¶
func NullableUUIDValue ¶
func NullableUUIDValueWithIssue1501 ¶
func NullableUint16Value ¶
func NullableUint32Value ¶
func NullableUint64Value ¶
func NullableUint8Value ¶
func NullableUuidValue ¶
func NullableYSONValue ¶
func NullableYSONValueFromBytes ¶
func ZeroValue ¶
Source Files ¶
cast.go errors.go nullable.go time.go value.go
- Version
- v3.99.3
- Published
- Feb 3, 2025
- Platform
- js/wasm
- Imports
- 18 packages
- Last checked
- 9 minutes ago –
Tools for package owners.