Documentation
¶
Index ¶
- func CoerceIntsToFloats(v any) any
- func DateFromInt64Value(v int64) (time.Time, error)
- func EncodeValue(v Value) (any, error)
- func IsDate(s string) bool
- func IsDatetime(s string) bool
- func IsNullValue(v any) bool
- func IsTime(s string) bool
- func IsTimestamp(s string) bool
- func ModifyTimeZone(t time.Time, loc *time.Location) (time.Time, error)
- func ParseDate(s string) (time.Time, error)
- func ParseDatetime(s string) (time.Time, error)
- func ParseTime(s string) (time.Time, error)
- func ParseTimestamp(s string, loc *time.Location) (time.Time, error)
- func PrintableChar(b byte) bool
- func TimeFromUnixNano(n int64) time.Time
- func TimestampFromFloatValue(f float64) (time.Time, error)
- func TimestampFromInt64Value(v int64) (time.Time, error)
- func ToLocation(timeZone string) (*time.Location, error)
- type ArrayValue
- func (av *ArrayValue) Add(v Value) (Value, error)
- func (av *ArrayValue) Div(v Value) (Value, error)
- func (av *ArrayValue) EQ(v Value) (bool, error)
- func (av *ArrayValue) Format(verb rune) string
- func (av *ArrayValue) GT(v Value) (bool, error)
- func (av *ArrayValue) GTE(v Value) (bool, error)
- func (av *ArrayValue) Has(v Value) (bool, error)
- func (av *ArrayValue) Interface() any
- func (av *ArrayValue) LT(v Value) (bool, error)
- func (av *ArrayValue) LTE(v Value) (bool, error)
- func (av *ArrayValue) Mul(v Value) (Value, error)
- func (av *ArrayValue) Sub(v Value) (Value, error)
- func (av *ArrayValue) ToArray() (*ArrayValue, error)
- func (av *ArrayValue) ToBool() (bool, error)
- func (av *ArrayValue) ToBytes() ([]byte, error)
- func (av *ArrayValue) ToFloat64() (float64, error)
- func (av *ArrayValue) ToInt64() (int64, error)
- func (av *ArrayValue) ToJSON() (string, error)
- func (av *ArrayValue) ToRat() (*big.Rat, error)
- func (av *ArrayValue) ToString() (string, error)
- func (av *ArrayValue) ToStruct() (*StructValue, error)
- func (av *ArrayValue) ToTime() (time.Time, error)
- type BoolValue
- func (bv BoolValue) Add(v Value) (Value, error)
- func (bv BoolValue) Div(v Value) (Value, error)
- func (bv BoolValue) EQ(v Value) (bool, error)
- func (bv BoolValue) Format(verb rune) string
- func (bv BoolValue) GT(v Value) (bool, error)
- func (bv BoolValue) GTE(v Value) (bool, error)
- func (bv BoolValue) Interface() any
- func (bv BoolValue) LT(v Value) (bool, error)
- func (bv BoolValue) LTE(v Value) (bool, error)
- func (bv BoolValue) Mul(v Value) (Value, error)
- func (bv BoolValue) Sub(v Value) (Value, error)
- func (bv BoolValue) ToArray() (*ArrayValue, error)
- func (bv BoolValue) ToBool() (bool, error)
- func (bv BoolValue) ToBytes() ([]byte, error)
- func (bv BoolValue) ToFloat64() (float64, error)
- func (bv BoolValue) ToInt64() (int64, error)
- func (bv BoolValue) ToJSON() (string, error)
- func (bv BoolValue) ToRat() (*big.Rat, error)
- func (bv BoolValue) ToString() (string, error)
- func (bv BoolValue) ToStruct() (*StructValue, error)
- func (bv BoolValue) ToTime() (time.Time, error)
- type BytesValue
- func (bv BytesValue) Add(v Value) (Value, error)
- func (bv BytesValue) Div(v Value) (Value, error)
- func (bv BytesValue) EQ(v Value) (bool, error)
- func (bv BytesValue) Format(verb rune) string
- func (bv BytesValue) GT(v Value) (bool, error)
- func (bv BytesValue) GTE(v Value) (bool, error)
- func (bv BytesValue) Interface() any
- func (bv BytesValue) LT(v Value) (bool, error)
- func (bv BytesValue) LTE(v Value) (bool, error)
- func (bv BytesValue) Mul(v Value) (Value, error)
- func (bv BytesValue) Sub(v Value) (Value, error)
- func (bv BytesValue) ToArray() (*ArrayValue, error)
- func (bv BytesValue) ToBool() (bool, error)
- func (bv BytesValue) ToBytes() ([]byte, error)
- func (bv BytesValue) ToFloat64() (float64, error)
- func (bv BytesValue) ToInt64() (int64, error)
- func (bv BytesValue) ToJSON() (string, error)
- func (bv BytesValue) ToRat() (*big.Rat, error)
- func (bv BytesValue) ToString() (string, error)
- func (bv BytesValue) ToStruct() (*StructValue, error)
- func (bv BytesValue) ToTime() (time.Time, error)
- type DateValue
- func (d DateValue) Add(v Value) (Value, error)
- func (d DateValue) AddDateWithInterval(v int, interval string) (Value, error)
- func (d DateValue) Div(v Value) (Value, error)
- func (d DateValue) EQ(v Value) (bool, error)
- func (d DateValue) Format(verb rune) string
- func (d DateValue) GT(v Value) (bool, error)
- func (d DateValue) GTE(v Value) (bool, error)
- func (d DateValue) Interface() any
- func (d DateValue) LT(v Value) (bool, error)
- func (d DateValue) LTE(v Value) (bool, error)
- func (d DateValue) Mul(v Value) (Value, error)
- func (d DateValue) Sub(v Value) (Value, error)
- func (d DateValue) ToArray() (*ArrayValue, error)
- func (d DateValue) ToBool() (bool, error)
- func (d DateValue) ToBytes() ([]byte, error)
- func (d DateValue) ToFloat64() (float64, error)
- func (d DateValue) ToInt64() (int64, error)
- func (d DateValue) ToJSON() (string, error)
- func (d DateValue) ToRat() (*big.Rat, error)
- func (d DateValue) ToString() (string, error)
- func (d DateValue) ToStruct() (*StructValue, error)
- func (d DateValue) ToTime() (time.Time, error)
- type DatetimeValue
- func (d DatetimeValue) Add(v Value) (Value, error)
- func (d DatetimeValue) Div(v Value) (Value, error)
- func (d DatetimeValue) EQ(v Value) (bool, error)
- func (d DatetimeValue) Format(verb rune) string
- func (d DatetimeValue) GT(v Value) (bool, error)
- func (d DatetimeValue) GTE(v Value) (bool, error)
- func (d DatetimeValue) Interface() any
- func (d DatetimeValue) LT(v Value) (bool, error)
- func (d DatetimeValue) LTE(v Value) (bool, error)
- func (d DatetimeValue) Mul(v Value) (Value, error)
- func (d DatetimeValue) Sub(v Value) (Value, error)
- func (d DatetimeValue) ToArray() (*ArrayValue, error)
- func (d DatetimeValue) ToBool() (bool, error)
- func (d DatetimeValue) ToBytes() ([]byte, error)
- func (d DatetimeValue) ToFloat64() (float64, error)
- func (d DatetimeValue) ToInt64() (int64, error)
- func (d DatetimeValue) ToJSON() (string, error)
- func (d DatetimeValue) ToRat() (*big.Rat, error)
- func (d DatetimeValue) ToString() (string, error)
- func (d DatetimeValue) ToStruct() (*StructValue, error)
- func (d DatetimeValue) ToTime() (time.Time, error)
- type FloatValue
- func (fv FloatValue) Add(v Value) (Value, error)
- func (fv FloatValue) Div(v Value) (Value, error)
- func (fv FloatValue) EQ(v Value) (bool, error)
- func (fv FloatValue) Format(verb rune) string
- func (fv FloatValue) GT(v Value) (bool, error)
- func (fv FloatValue) GTE(v Value) (bool, error)
- func (fv FloatValue) Interface() any
- func (fv FloatValue) LT(v Value) (bool, error)
- func (fv FloatValue) LTE(v Value) (bool, error)
- func (fv FloatValue) Mul(v Value) (Value, error)
- func (fv FloatValue) Sub(v Value) (Value, error)
- func (fv FloatValue) ToArray() (*ArrayValue, error)
- func (fv FloatValue) ToBool() (bool, error)
- func (fv FloatValue) ToBytes() ([]byte, error)
- func (fv FloatValue) ToFloat64() (float64, error)
- func (fv FloatValue) ToInt64() (int64, error)
- func (fv FloatValue) ToJSON() (string, error)
- func (fv FloatValue) ToRat() (*big.Rat, error)
- func (fv FloatValue) ToString() (string, error)
- func (fv FloatValue) ToStruct() (*StructValue, error)
- func (fv FloatValue) ToTime() (time.Time, error)
- type GeographyValue
- func GeographyFromWKT(wkt string) (*GeographyValue, error)
- func NewGeographyCollection(parts []*GeographyValue) *GeographyValue
- func NewGeographyLineString(points [][2]float64) *GeographyValue
- func NewGeographyMultiLineString(lines [][][2]float64) *GeographyValue
- func NewGeographyMultiPoint(points [][2]float64) *GeographyValue
- func NewGeographyMultiPolygon(polys [][][][2]float64) *GeographyValue
- func NewGeographyPoint(longitude, latitude float64) *GeographyValue
- func NewGeographyPolygon(rings [][][2]float64) *GeographyValue
- func (g *GeographyValue) Add(_ Value) (Value, error)
- func (g *GeographyValue) CollectionParts() ([]*GeographyValue, bool)
- func (g *GeographyValue) DistanceTo(other *GeographyValue) (float64, error)
- func (g *GeographyValue) Div(_ Value) (Value, error)
- func (g *GeographyValue) EQ(other Value) (bool, error)
- func (g *GeographyValue) EqualPoint(other *GeographyValue) bool
- func (g *GeographyValue) Format(verb rune) string
- func (g *GeographyValue) GT(_ Value) (bool, error)
- func (g *GeographyValue) GTE(_ Value) (bool, error)
- func (g *GeographyValue) Interface() any
- func (g *GeographyValue) Inverted() bool
- func (g *GeographyValue) IsEmpty() bool
- func (g *GeographyValue) Kind() string
- func (g *GeographyValue) LT(_ Value) (bool, error)
- func (g *GeographyValue) LTE(_ Value) (bool, error)
- func (g *GeographyValue) LineStringPoints() ([][2]float64, bool)
- func (g *GeographyValue) MarkInverted()
- func (g *GeographyValue) Mul(_ Value) (Value, error)
- func (g *GeographyValue) MultiLineStringLines() ([][][2]float64, bool)
- func (g *GeographyValue) MultiPointPoints() ([][2]float64, bool)
- func (g *GeographyValue) MultiPolygonPolys() ([][][][2]float64, bool)
- func (g *GeographyValue) PointCoordinates() (float64, float64, bool)
- func (g *GeographyValue) PolygonRings() ([][][2]float64, bool)
- func (g *GeographyValue) String() (string, error)
- func (g *GeographyValue) Sub(_ Value) (Value, error)
- func (g *GeographyValue) ToArray() (*ArrayValue, error)
- func (g *GeographyValue) ToBool() (bool, error)
- func (g *GeographyValue) ToBytes() ([]byte, error)
- func (g *GeographyValue) ToFloat64() (float64, error)
- func (g *GeographyValue) ToInt64() (int64, error)
- func (g *GeographyValue) ToJSON() (string, error)
- func (g *GeographyValue) ToRat() (*big.Rat, error)
- func (g *GeographyValue) ToString() (string, error)
- func (g *GeographyValue) ToStruct() (*StructValue, error)
- func (g *GeographyValue) ToTime() (time.Time, error)
- func (g *GeographyValue) ToWKT() (string, error)
- type IntValue
- func (iv IntValue) Add(v Value) (Value, error)
- func (iv IntValue) Div(v Value) (Value, error)
- func (iv IntValue) EQ(v Value) (bool, error)
- func (iv IntValue) Format(verb rune) string
- func (iv IntValue) GT(v Value) (bool, error)
- func (iv IntValue) GTE(v Value) (bool, error)
- func (iv IntValue) Interface() any
- func (iv IntValue) LT(v Value) (bool, error)
- func (iv IntValue) LTE(v Value) (bool, error)
- func (iv IntValue) Mul(v Value) (Value, error)
- func (iv IntValue) Sub(v Value) (Value, error)
- func (iv IntValue) ToArray() (*ArrayValue, error)
- func (iv IntValue) ToBool() (bool, error)
- func (iv IntValue) ToBytes() ([]byte, error)
- func (iv IntValue) ToFloat64() (float64, error)
- func (iv IntValue) ToInt64() (int64, error)
- func (iv IntValue) ToJSON() (string, error)
- func (iv IntValue) ToRat() (*big.Rat, error)
- func (iv IntValue) ToString() (string, error)
- func (iv IntValue) ToStruct() (*StructValue, error)
- func (iv IntValue) ToTime() (time.Time, error)
- type IntervalValue
- func (iv *IntervalValue) Add(v Value) (Value, error)
- func (iv *IntervalValue) Div(v Value) (Value, error)
- func (iv *IntervalValue) EQ(v Value) (bool, error)
- func (iv *IntervalValue) Format(verb rune) string
- func (iv *IntervalValue) GT(v Value) (bool, error)
- func (iv *IntervalValue) GTE(v Value) (bool, error)
- func (iv *IntervalValue) Interface() any
- func (iv *IntervalValue) LT(v Value) (bool, error)
- func (iv *IntervalValue) LTE(v Value) (bool, error)
- func (iv *IntervalValue) Mul(v Value) (Value, error)
- func (iv *IntervalValue) Sub(v Value) (Value, error)
- func (iv *IntervalValue) ToArray() (*ArrayValue, error)
- func (iv *IntervalValue) ToBool() (bool, error)
- func (iv *IntervalValue) ToBytes() ([]byte, error)
- func (iv *IntervalValue) ToFloat64() (float64, error)
- func (iv *IntervalValue) ToInt64() (int64, error)
- func (iv *IntervalValue) ToJSON() (string, error)
- func (iv *IntervalValue) ToRat() (*big.Rat, error)
- func (iv *IntervalValue) ToString() (string, error)
- func (iv *IntervalValue) ToStruct() (*StructValue, error)
- func (iv *IntervalValue) ToTime() (time.Time, error)
- type JsonValue
- func (jv JsonValue) Add(v Value) (Value, error)
- func (jv JsonValue) Div(v Value) (Value, error)
- func (jv JsonValue) EQ(v Value) (bool, error)
- func (jv JsonValue) Format(verb rune) string
- func (jv JsonValue) GT(v Value) (bool, error)
- func (jv JsonValue) GTE(v Value) (bool, error)
- func (jv JsonValue) Interface() any
- func (jv JsonValue) LT(v Value) (bool, error)
- func (jv JsonValue) LTE(v Value) (bool, error)
- func (jv JsonValue) Mul(v Value) (Value, error)
- func (jv JsonValue) Sub(v Value) (Value, error)
- func (jv JsonValue) ToArray() (*ArrayValue, error)
- func (jv JsonValue) ToBool() (bool, error)
- func (jv JsonValue) ToBytes() ([]byte, error)
- func (jv JsonValue) ToFloat64() (float64, error)
- func (jv JsonValue) ToInt64() (int64, error)
- func (jv JsonValue) ToJSON() (string, error)
- func (jv JsonValue) ToRat() (*big.Rat, error)
- func (jv JsonValue) ToString() (string, error)
- func (jv JsonValue) ToStruct() (*StructValue, error)
- func (jv JsonValue) ToTime() (time.Time, error)
- func (jv JsonValue) Type() string
- type NumericValue
- func (nv *NumericValue) Add(v Value) (Value, error)
- func (nv *NumericValue) Div(v Value) (ret Value, e error)
- func (nv *NumericValue) EQ(v Value) (bool, error)
- func (nv *NumericValue) Format(verb rune) string
- func (nv *NumericValue) GT(v Value) (bool, error)
- func (nv *NumericValue) GTE(v Value) (bool, error)
- func (nv *NumericValue) Interface() any
- func (nv *NumericValue) LT(v Value) (bool, error)
- func (nv *NumericValue) LTE(v Value) (bool, error)
- func (nv *NumericValue) Mul(v Value) (Value, error)
- func (nv *NumericValue) Sub(v Value) (Value, error)
- func (nv *NumericValue) ToArray() (*ArrayValue, error)
- func (nv *NumericValue) ToBool() (bool, error)
- func (nv *NumericValue) ToBytes() ([]byte, error)
- func (nv *NumericValue) ToFloat64() (float64, error)
- func (nv *NumericValue) ToInt64() (int64, error)
- func (nv *NumericValue) ToJSON() (string, error)
- func (nv *NumericValue) ToRat() (*big.Rat, error)
- func (nv *NumericValue) ToString() (string, error)
- func (nv *NumericValue) ToStruct() (*StructValue, error)
- func (nv *NumericValue) ToTime() (time.Time, error)
- type RangeValue
- func (r *RangeValue) Add(Value) (Value, error)
- func (r *RangeValue) Div(Value) (Value, error)
- func (r *RangeValue) EQ(other Value) (bool, error)
- func (r *RangeValue) Format(verb rune) string
- func (r *RangeValue) GT(Value) (bool, error)
- func (r *RangeValue) GTE(Value) (bool, error)
- func (r *RangeValue) Interface() any
- func (r *RangeValue) LT(Value) (bool, error)
- func (r *RangeValue) LTE(Value) (bool, error)
- func (r *RangeValue) Mul(Value) (Value, error)
- func (r *RangeValue) Sub(Value) (Value, error)
- func (r *RangeValue) ToArray() (*ArrayValue, error)
- func (r *RangeValue) ToBool() (bool, error)
- func (r *RangeValue) ToBytes() ([]byte, error)
- func (r *RangeValue) ToFloat64() (float64, error)
- func (r *RangeValue) ToInt64() (int64, error)
- func (r *RangeValue) ToJSON() (string, error)
- func (r *RangeValue) ToRat() (*big.Rat, error)
- func (r *RangeValue) ToString() (string, error)
- func (r *RangeValue) ToStruct() (*StructValue, error)
- func (r *RangeValue) ToTime() (time.Time, error)
- type SafeValue
- func (v *SafeValue) Add(arg Value) (Value, error)
- func (v *SafeValue) Div(arg Value) (Value, error)
- func (v *SafeValue) EQ(arg Value) (bool, error)
- func (v *SafeValue) Format(verb rune) string
- func (v *SafeValue) GT(arg Value) (bool, error)
- func (v *SafeValue) GTE(arg Value) (bool, error)
- func (v *SafeValue) Interface() any
- func (v *SafeValue) LT(arg Value) (bool, error)
- func (v *SafeValue) LTE(arg Value) (bool, error)
- func (v *SafeValue) Mul(arg Value) (Value, error)
- func (v *SafeValue) Sub(arg Value) (Value, error)
- func (v *SafeValue) ToArray() (*ArrayValue, error)
- func (v *SafeValue) ToBool() (bool, error)
- func (v *SafeValue) ToBytes() ([]byte, error)
- func (v *SafeValue) ToFloat64() (float64, error)
- func (v *SafeValue) ToInt64() (int64, error)
- func (v *SafeValue) ToJSON() (string, error)
- func (v *SafeValue) ToRat() (*big.Rat, error)
- func (v *SafeValue) ToString() (string, error)
- func (v *SafeValue) ToStruct() (*StructValue, error)
- func (v *SafeValue) ToTime() (time.Time, error)
- type StringValue
- func (sv StringValue) Add(v Value) (Value, error)
- func (sv StringValue) Div(v Value) (Value, error)
- func (sv StringValue) EQ(v Value) (bool, error)
- func (sv StringValue) Format(verb rune) string
- func (sv StringValue) GT(v Value) (bool, error)
- func (sv StringValue) GTE(v Value) (bool, error)
- func (sv StringValue) Interface() any
- func (sv StringValue) LT(v Value) (bool, error)
- func (sv StringValue) LTE(v Value) (bool, error)
- func (sv StringValue) Mul(v Value) (Value, error)
- func (sv StringValue) Sub(v Value) (Value, error)
- func (sv StringValue) ToArray() (*ArrayValue, error)
- func (sv StringValue) ToBool() (bool, error)
- func (sv StringValue) ToBytes() ([]byte, error)
- func (sv StringValue) ToFloat64() (float64, error)
- func (sv StringValue) ToInt64() (int64, error)
- func (sv StringValue) ToJSON() (string, error)
- func (sv StringValue) ToRat() (*big.Rat, error)
- func (sv StringValue) ToString() (string, error)
- func (sv StringValue) ToStruct() (*StructValue, error)
- func (sv StringValue) ToTime() (time.Time, error)
- type StructValue
- func (sv *StructValue) Add(v Value) (Value, error)
- func (sv *StructValue) Div(v Value) (Value, error)
- func (sv *StructValue) EQ(v Value) (bool, error)
- func (sv *StructValue) Format(verb rune) string
- func (sv *StructValue) GT(v Value) (bool, error)
- func (sv *StructValue) GTE(v Value) (bool, error)
- func (sv *StructValue) Interface() any
- func (sv *StructValue) LT(v Value) (bool, error)
- func (sv *StructValue) LTE(v Value) (bool, error)
- func (sv *StructValue) Mul(v Value) (Value, error)
- func (sv *StructValue) Sub(v Value) (Value, error)
- func (sv *StructValue) ToArray() (*ArrayValue, error)
- func (sv *StructValue) ToBool() (bool, error)
- func (sv *StructValue) ToBytes() ([]byte, error)
- func (sv *StructValue) ToFloat64() (float64, error)
- func (sv *StructValue) ToInt64() (int64, error)
- func (sv *StructValue) ToJSON() (string, error)
- func (sv *StructValue) ToRat() (*big.Rat, error)
- func (sv *StructValue) ToString() (string, error)
- func (sv *StructValue) ToStruct() (*StructValue, error)
- func (sv *StructValue) ToTime() (time.Time, error)
- type StructValueLayout
- type TimeValue
- func (t TimeValue) Add(v Value) (Value, error)
- func (t TimeValue) Div(v Value) (Value, error)
- func (t TimeValue) EQ(v Value) (bool, error)
- func (t TimeValue) Format(verb rune) string
- func (t TimeValue) GT(v Value) (bool, error)
- func (t TimeValue) GTE(v Value) (bool, error)
- func (t TimeValue) Interface() any
- func (t TimeValue) LT(v Value) (bool, error)
- func (t TimeValue) LTE(v Value) (bool, error)
- func (t TimeValue) Mul(v Value) (Value, error)
- func (t TimeValue) Sub(v Value) (Value, error)
- func (t TimeValue) ToArray() (*ArrayValue, error)
- func (t TimeValue) ToBool() (bool, error)
- func (t TimeValue) ToBytes() ([]byte, error)
- func (t TimeValue) ToFloat64() (float64, error)
- func (t TimeValue) ToInt64() (int64, error)
- func (t TimeValue) ToJSON() (string, error)
- func (t TimeValue) ToRat() (*big.Rat, error)
- func (t TimeValue) ToString() (string, error)
- func (t TimeValue) ToStruct() (*StructValue, error)
- func (t TimeValue) ToTime() (time.Time, error)
- type TimestampValue
- func (t TimestampValue) Add(v Value) (Value, error)
- func (t TimestampValue) AddValueWithPart(v int64, part string) (Value, error)
- func (t TimestampValue) Div(v Value) (Value, error)
- func (t TimestampValue) EQ(v Value) (bool, error)
- func (t TimestampValue) Format(verb rune) string
- func (t TimestampValue) GT(v Value) (bool, error)
- func (t TimestampValue) GTE(v Value) (bool, error)
- func (t TimestampValue) Interface() any
- func (t TimestampValue) LT(v Value) (bool, error)
- func (t TimestampValue) LTE(v Value) (bool, error)
- func (t TimestampValue) Mul(v Value) (Value, error)
- func (t TimestampValue) Sub(v Value) (Value, error)
- func (t TimestampValue) ToArray() (*ArrayValue, error)
- func (t TimestampValue) ToBool() (bool, error)
- func (t TimestampValue) ToBytes() ([]byte, error)
- func (t TimestampValue) ToFloat64() (float64, error)
- func (t TimestampValue) ToInt64() (int64, error)
- func (t TimestampValue) ToJSON() (string, error)
- func (t TimestampValue) ToRat() (*big.Rat, error)
- func (t TimestampValue) ToString() (string, error)
- func (t TimestampValue) ToStruct() (*StructValue, error)
- func (t TimestampValue) ToTime() (time.Time, error)
- type Value
- type ValueLayout
- type ValueType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CoerceIntsToFloats ¶
Helpers used by encoder/decoder when constructing literals.
func EncodeValue ¶
EncodeValue serializes a Value into the over-the-wire form the SQLite layer accepts. INT64 / FLOAT64 / BOOL pass through to their Go primitives; richer types (BYTES, NUMERIC, ARRAY, STRUCT, ...) are JSON-encoded under a small (header, body) envelope and then base64-encoded so SQLite stores them as a flat string.
func IsDatetime ¶
func IsNullValue ¶
func IsTimestamp ¶
func PrintableChar ¶
func TimeFromUnixNano ¶
Types ¶
type ArrayValue ¶
type ArrayValue struct {
Values []Value
}
func (*ArrayValue) Format ¶
func (av *ArrayValue) Format(verb rune) string
func (*ArrayValue) Interface ¶
func (av *ArrayValue) Interface() any
func (*ArrayValue) ToArray ¶
func (av *ArrayValue) ToArray() (*ArrayValue, error)
func (*ArrayValue) ToBool ¶
func (av *ArrayValue) ToBool() (bool, error)
func (*ArrayValue) ToBytes ¶
func (av *ArrayValue) ToBytes() ([]byte, error)
func (*ArrayValue) ToFloat64 ¶
func (av *ArrayValue) ToFloat64() (float64, error)
func (*ArrayValue) ToInt64 ¶
func (av *ArrayValue) ToInt64() (int64, error)
func (*ArrayValue) ToJSON ¶
func (av *ArrayValue) ToJSON() (string, error)
func (*ArrayValue) ToString ¶
func (av *ArrayValue) ToString() (string, error)
func (*ArrayValue) ToStruct ¶
func (av *ArrayValue) ToStruct() (*StructValue, error)
type BoolValue ¶
type BoolValue bool
func (BoolValue) ToArray ¶
func (bv BoolValue) ToArray() (*ArrayValue, error)
func (BoolValue) ToStruct ¶
func (bv BoolValue) ToStruct() (*StructValue, error)
type BytesValue ¶
type BytesValue []byte
func (BytesValue) Format ¶
func (bv BytesValue) Format(verb rune) string
func (BytesValue) Interface ¶
func (bv BytesValue) Interface() any
func (BytesValue) ToArray ¶
func (bv BytesValue) ToArray() (*ArrayValue, error)
func (BytesValue) ToBool ¶
func (bv BytesValue) ToBool() (bool, error)
func (BytesValue) ToBytes ¶
func (bv BytesValue) ToBytes() ([]byte, error)
func (BytesValue) ToFloat64 ¶
func (bv BytesValue) ToFloat64() (float64, error)
func (BytesValue) ToInt64 ¶
func (bv BytesValue) ToInt64() (int64, error)
func (BytesValue) ToJSON ¶
func (bv BytesValue) ToJSON() (string, error)
func (BytesValue) ToString ¶
func (bv BytesValue) ToString() (string, error)
func (BytesValue) ToStruct ¶
func (bv BytesValue) ToStruct() (*StructValue, error)
type DateValue ¶
func (DateValue) AddDateWithInterval ¶
func (DateValue) ToArray ¶
func (d DateValue) ToArray() (*ArrayValue, error)
func (DateValue) ToStruct ¶
func (d DateValue) ToStruct() (*StructValue, error)
type DatetimeValue ¶
func (DatetimeValue) Format ¶
func (d DatetimeValue) Format(verb rune) string
func (DatetimeValue) Interface ¶
func (d DatetimeValue) Interface() any
func (DatetimeValue) ToArray ¶
func (d DatetimeValue) ToArray() (*ArrayValue, error)
func (DatetimeValue) ToBool ¶
func (d DatetimeValue) ToBool() (bool, error)
func (DatetimeValue) ToBytes ¶
func (d DatetimeValue) ToBytes() ([]byte, error)
func (DatetimeValue) ToFloat64 ¶
func (d DatetimeValue) ToFloat64() (float64, error)
func (DatetimeValue) ToInt64 ¶
func (d DatetimeValue) ToInt64() (int64, error)
func (DatetimeValue) ToJSON ¶
func (d DatetimeValue) ToJSON() (string, error)
func (DatetimeValue) ToString ¶
func (d DatetimeValue) ToString() (string, error)
func (DatetimeValue) ToStruct ¶
func (d DatetimeValue) ToStruct() (*StructValue, error)
type FloatValue ¶
type FloatValue float64
func (FloatValue) Format ¶
func (fv FloatValue) Format(verb rune) string
func (FloatValue) Interface ¶
func (fv FloatValue) Interface() any
func (FloatValue) ToArray ¶
func (fv FloatValue) ToArray() (*ArrayValue, error)
func (FloatValue) ToBool ¶
func (fv FloatValue) ToBool() (bool, error)
func (FloatValue) ToBytes ¶
func (fv FloatValue) ToBytes() ([]byte, error)
func (FloatValue) ToFloat64 ¶
func (fv FloatValue) ToFloat64() (float64, error)
func (FloatValue) ToInt64 ¶
func (fv FloatValue) ToInt64() (int64, error)
func (FloatValue) ToJSON ¶
func (fv FloatValue) ToJSON() (string, error)
func (FloatValue) ToString ¶
func (fv FloatValue) ToString() (string, error)
func (FloatValue) ToStruct ¶
func (fv FloatValue) ToStruct() (*StructValue, error)
type GeographyValue ¶
type GeographyValue struct {
// contains filtered or unexported fields
}
GeographyValue follows the OGC Simple Features specification (SFS). Internally we carry the geometry as a tagged Go struct. The supported tags are POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION.
Pure-Go geometry implementations (without S2 / GEOS) cover round-trip storage, structural equality, and distance / intersection for Point–Point pairs. Full spherical computations on non-Point geometries return a clear "unsupported" error rather than wrong numbers.
func GeographyFromWKT ¶
func GeographyFromWKT(wkt string) (*GeographyValue, error)
GeographyFromWKT parses a WKT string into a GeographyValue. Supports POINT / LINESTRING / POLYGON / MULTIPOINT / MULTILINESTRING / MULTIPOLYGON / GEOMETRYCOLLECTION.
func NewGeographyCollection ¶
func NewGeographyCollection(parts []*GeographyValue) *GeographyValue
func NewGeographyLineString ¶
func NewGeographyLineString(points [][2]float64) *GeographyValue
func NewGeographyMultiLineString ¶
func NewGeographyMultiLineString(lines [][][2]float64) *GeographyValue
func NewGeographyMultiPoint ¶
func NewGeographyMultiPoint(points [][2]float64) *GeographyValue
func NewGeographyMultiPolygon ¶
func NewGeographyMultiPolygon(polys [][][][2]float64) *GeographyValue
func NewGeographyPoint ¶
func NewGeographyPoint(longitude, latitude float64) *GeographyValue
func NewGeographyPolygon ¶
func NewGeographyPolygon(rings [][][2]float64) *GeographyValue
func (*GeographyValue) CollectionParts ¶
func (g *GeographyValue) CollectionParts() ([]*GeographyValue, bool)
CollectionParts returns the constituent geographies of a GEOMETRYCOLLECTION. Returns ok=false otherwise.
func (*GeographyValue) DistanceTo ¶
func (g *GeographyValue) DistanceTo(other *GeographyValue) (float64, error)
DistanceTo returns the great-circle (haversine) distance in meters between two GeographyValue points. Non-Point geometries return an error — full polygon / line distance needs spherical geometry (S2) which is out of scope for the pure-Go build.
func (*GeographyValue) EQ ¶
func (g *GeographyValue) EQ(other Value) (bool, error)
EQ implements structural equality for geography. Two geographies compare equal when they have the same kind and identical coordinates in declaration order. SFS spatial-equality (same point set, possibly different orderings) is more permissive but requires S2 / GEOS to compute robustly; structural equality is what every emulator-side workload here expects.
func (*GeographyValue) EqualPoint ¶
func (g *GeographyValue) EqualPoint(other *GeographyValue) bool
EqualPoint returns true when both geographies are points and have equal coordinates.
func (*GeographyValue) Format ¶
func (g *GeographyValue) Format(verb rune) string
func (*GeographyValue) Interface ¶
func (g *GeographyValue) Interface() any
func (*GeographyValue) Inverted ¶
func (g *GeographyValue) Inverted() bool
Inverted reports whether the polygon was parsed in oriented mode with a clockwise outer ring (interior is the globe minus the ring's enclosed region).
func (*GeographyValue) IsEmpty ¶
func (g *GeographyValue) IsEmpty() bool
IsEmpty reports whether the geography is one of the WKT EMPTY sentinels (POINT EMPTY, LINESTRING EMPTY, ...): no vertices to participate in distance / area / bounding-box computation. `fullglobe` is NOT empty; it has zero rings but represents the entire surface of Earth.
func (*GeographyValue) Kind ¶
func (g *GeographyValue) Kind() string
Kind returns the WKT-style geometry tag (POINT / LINESTRING / ...). Returns "" for a nil GeographyValue.
func (*GeographyValue) LineStringPoints ¶
func (g *GeographyValue) LineStringPoints() ([][2]float64, bool)
LineStringPoints returns the ordered points of a LINESTRING. Returns ok=false for any other geometry kind.
func (*GeographyValue) MarkInverted ¶
func (g *GeographyValue) MarkInverted()
MarkInverted is called by the WKT parser (or any caller that knows the oriented=TRUE convention) to flag the polygon as representing the complement of its enclosed region.
func (*GeographyValue) MultiLineStringLines ¶
func (g *GeographyValue) MultiLineStringLines() ([][][2]float64, bool)
MultiLineStringLines returns the individual line strings of a MULTILINESTRING. Returns ok=false otherwise.
func (*GeographyValue) MultiPointPoints ¶
func (g *GeographyValue) MultiPointPoints() ([][2]float64, bool)
MultiPointPoints returns the points of a MULTIPOINT geography. Returns ok=false otherwise.
func (*GeographyValue) MultiPolygonPolys ¶
func (g *GeographyValue) MultiPolygonPolys() ([][][][2]float64, bool)
MultiPolygonPolys returns the polygons of a MULTIPOLYGON, each represented as its ring list (outer then inner).
func (*GeographyValue) PointCoordinates ¶
func (g *GeographyValue) PointCoordinates() (float64, float64, bool)
PointCoordinates returns (longitude, latitude) when the geography is a Point. Returns ok=false otherwise (including POINT EMPTY, which carries no coordinates). Used by ST_X / ST_Y.
func (*GeographyValue) PolygonRings ¶
func (g *GeographyValue) PolygonRings() ([][][2]float64, bool)
PolygonRings returns the rings of a POLYGON (outer ring first, inner rings second). Returns ok=false for any other geometry kind.
func (*GeographyValue) String ¶
func (g *GeographyValue) String() (string, error)
func (*GeographyValue) ToArray ¶
func (g *GeographyValue) ToArray() (*ArrayValue, error)
func (*GeographyValue) ToBool ¶
func (g *GeographyValue) ToBool() (bool, error)
func (*GeographyValue) ToBytes ¶
func (g *GeographyValue) ToBytes() ([]byte, error)
func (*GeographyValue) ToFloat64 ¶
func (g *GeographyValue) ToFloat64() (float64, error)
func (*GeographyValue) ToInt64 ¶
func (g *GeographyValue) ToInt64() (int64, error)
func (*GeographyValue) ToJSON ¶
func (g *GeographyValue) ToJSON() (string, error)
func (*GeographyValue) ToString ¶
func (g *GeographyValue) ToString() (string, error)
func (*GeographyValue) ToStruct ¶
func (g *GeographyValue) ToStruct() (*StructValue, error)
func (*GeographyValue) ToWKT ¶
func (g *GeographyValue) ToWKT() (string, error)
type IntValue ¶
type IntValue int64
func (IntValue) ToArray ¶
func (iv IntValue) ToArray() (*ArrayValue, error)
func (IntValue) ToStruct ¶
func (iv IntValue) ToStruct() (*StructValue, error)
type IntervalValue ¶
type IntervalValue struct {
*intervalvalue.IntervalValue
}
func ParseInterval ¶
func ParseInterval(s string) (*IntervalValue, error)
func (*IntervalValue) Format ¶
func (iv *IntervalValue) Format(verb rune) string
func (*IntervalValue) Interface ¶
func (iv *IntervalValue) Interface() any
func (*IntervalValue) ToArray ¶
func (iv *IntervalValue) ToArray() (*ArrayValue, error)
func (*IntervalValue) ToBool ¶
func (iv *IntervalValue) ToBool() (bool, error)
func (*IntervalValue) ToBytes ¶
func (iv *IntervalValue) ToBytes() ([]byte, error)
func (*IntervalValue) ToFloat64 ¶
func (iv *IntervalValue) ToFloat64() (float64, error)
func (*IntervalValue) ToInt64 ¶
func (iv *IntervalValue) ToInt64() (int64, error)
func (*IntervalValue) ToJSON ¶
func (iv *IntervalValue) ToJSON() (string, error)
func (*IntervalValue) ToString ¶
func (iv *IntervalValue) ToString() (string, error)
func (*IntervalValue) ToStruct ¶
func (iv *IntervalValue) ToStruct() (*StructValue, error)
type JsonValue ¶
type JsonValue string
func (JsonValue) ToArray ¶
func (jv JsonValue) ToArray() (*ArrayValue, error)
func (JsonValue) ToStruct ¶
func (jv JsonValue) ToStruct() (*StructValue, error)
type NumericValue ¶
func (*NumericValue) Format ¶
func (nv *NumericValue) Format(verb rune) string
func (*NumericValue) Interface ¶
func (nv *NumericValue) Interface() any
func (*NumericValue) ToArray ¶
func (nv *NumericValue) ToArray() (*ArrayValue, error)
func (*NumericValue) ToBool ¶
func (nv *NumericValue) ToBool() (bool, error)
func (*NumericValue) ToBytes ¶
func (nv *NumericValue) ToBytes() ([]byte, error)
func (*NumericValue) ToFloat64 ¶
func (nv *NumericValue) ToFloat64() (float64, error)
func (*NumericValue) ToInt64 ¶
func (nv *NumericValue) ToInt64() (int64, error)
func (*NumericValue) ToJSON ¶
func (nv *NumericValue) ToJSON() (string, error)
func (*NumericValue) ToString ¶
func (nv *NumericValue) ToString() (string, error)
func (*NumericValue) ToStruct ¶
func (nv *NumericValue) ToStruct() (*StructValue, error)
type RangeValue ¶
type RangeValue struct {
Start Value // nil = unbounded
End Value // nil = unbounded
// ElemHeader records the element ValueType so the decoder can
// reconstruct typed bounds without redundant type inference.
ElemHeader ValueType
}
RangeValue is a half-open interval [Start, End) over a comparable element type. Per BigQuery, RANGE supports DATE, DATETIME, and TIMESTAMP element types. Either bound can be NULL — interpreted as "unbounded".
func (*RangeValue) Format ¶
func (r *RangeValue) Format(verb rune) string
func (*RangeValue) Interface ¶
func (r *RangeValue) Interface() any
func (*RangeValue) ToArray ¶
func (r *RangeValue) ToArray() (*ArrayValue, error)
func (*RangeValue) ToBool ¶
func (r *RangeValue) ToBool() (bool, error)
func (*RangeValue) ToBytes ¶
func (r *RangeValue) ToBytes() ([]byte, error)
func (*RangeValue) ToFloat64 ¶
func (r *RangeValue) ToFloat64() (float64, error)
func (*RangeValue) ToInt64 ¶
func (r *RangeValue) ToInt64() (int64, error)
func (*RangeValue) ToJSON ¶
func (r *RangeValue) ToJSON() (string, error)
func (*RangeValue) ToString ¶
func (r *RangeValue) ToString() (string, error)
func (*RangeValue) ToStruct ¶
func (r *RangeValue) ToStruct() (*StructValue, error)
type SafeValue ¶
type SafeValue struct {
Value Value
}
func (*SafeValue) ToArray ¶
func (v *SafeValue) ToArray() (*ArrayValue, error)
func (*SafeValue) ToStruct ¶
func (v *SafeValue) ToStruct() (*StructValue, error)
type StringValue ¶
type StringValue string
func (StringValue) Format ¶
func (sv StringValue) Format(verb rune) string
func (StringValue) Interface ¶
func (sv StringValue) Interface() any
func (StringValue) ToArray ¶
func (sv StringValue) ToArray() (*ArrayValue, error)
func (StringValue) ToBool ¶
func (sv StringValue) ToBool() (bool, error)
func (StringValue) ToBytes ¶
func (sv StringValue) ToBytes() ([]byte, error)
func (StringValue) ToFloat64 ¶
func (sv StringValue) ToFloat64() (float64, error)
func (StringValue) ToInt64 ¶
func (sv StringValue) ToInt64() (int64, error)
func (StringValue) ToJSON ¶
func (sv StringValue) ToJSON() (string, error)
func (StringValue) ToString ¶
func (sv StringValue) ToString() (string, error)
func (StringValue) ToStruct ¶
func (sv StringValue) ToStruct() (*StructValue, error)
type StructValue ¶
func (*StructValue) Format ¶
func (sv *StructValue) Format(verb rune) string
func (*StructValue) Interface ¶
func (sv *StructValue) Interface() any
func (*StructValue) ToArray ¶
func (sv *StructValue) ToArray() (*ArrayValue, error)
func (*StructValue) ToBool ¶
func (sv *StructValue) ToBool() (bool, error)
func (*StructValue) ToBytes ¶
func (sv *StructValue) ToBytes() ([]byte, error)
func (*StructValue) ToFloat64 ¶
func (sv *StructValue) ToFloat64() (float64, error)
func (*StructValue) ToInt64 ¶
func (sv *StructValue) ToInt64() (int64, error)
func (*StructValue) ToJSON ¶
func (sv *StructValue) ToJSON() (string, error)
func (*StructValue) ToString ¶
func (sv *StructValue) ToString() (string, error)
func (*StructValue) ToStruct ¶
func (sv *StructValue) ToStruct() (*StructValue, error)
type StructValueLayout ¶
type TimeValue ¶
func (TimeValue) ToArray ¶
func (t TimeValue) ToArray() (*ArrayValue, error)
func (TimeValue) ToStruct ¶
func (t TimeValue) ToStruct() (*StructValue, error)
type TimestampValue ¶
func (TimestampValue) AddValueWithPart ¶
func (t TimestampValue) AddValueWithPart(v int64, part string) (Value, error)
func (TimestampValue) Format ¶
func (t TimestampValue) Format(verb rune) string
func (TimestampValue) Interface ¶
func (t TimestampValue) Interface() any
func (TimestampValue) ToArray ¶
func (t TimestampValue) ToArray() (*ArrayValue, error)
func (TimestampValue) ToBool ¶
func (t TimestampValue) ToBool() (bool, error)
func (TimestampValue) ToBytes ¶
func (t TimestampValue) ToBytes() ([]byte, error)
func (TimestampValue) ToFloat64 ¶
func (t TimestampValue) ToFloat64() (float64, error)
func (TimestampValue) ToInt64 ¶
func (t TimestampValue) ToInt64() (int64, error)
func (TimestampValue) ToJSON ¶
func (t TimestampValue) ToJSON() (string, error)
func (TimestampValue) ToString ¶
func (t TimestampValue) ToString() (string, error)
func (TimestampValue) ToStruct ¶
func (t TimestampValue) ToStruct() (*StructValue, error)
type Value ¶
type Value interface {
Add(Value) (Value, error)
Sub(Value) (Value, error)
Mul(Value) (Value, error)
Div(Value) (Value, error)
EQ(Value) (bool, error)
GT(Value) (bool, error)
GTE(Value) (bool, error)
LT(Value) (bool, error)
LTE(Value) (bool, error)
ToInt64() (int64, error)
ToString() (string, error)
ToBytes() ([]byte, error)
ToFloat64() (float64, error)
ToBool() (bool, error)
ToArray() (*ArrayValue, error)
ToStruct() (*StructValue, error)
ToJSON() (string, error)
ToTime() (time.Time, error)
ToRat() (*big.Rat, error)
Format(verb rune) string
Interface() any
}
func ConvertArgs ¶
ConvertArgs decodes a sequence of SQLite-side Go values (the form the ncruces driver hands us in Step / scalar callbacks) into a slice of googlesqlite Values. It is a thin loop around DecodeValue.
func DecodeValue ¶
DecodeValue is the inverse of EncodeValue: given the over-the-wire form (Go primitive or base64-encoded ValueLayout JSON) produce the matching googlesqlite Value.
func ValueFromGoValue ¶
ValueFromGoValue converts a plain Go value (the kind a SQL driver hands us across the FFI boundary) into a googlesqlite Value.
type ValueLayout ¶
func ValueLayoutFromValue ¶
func ValueLayoutFromValue(v Value) (*ValueLayout, error)
ValueLayoutFromValue is the public entry point for the layout builder used by the over-the-wire encoder and by literal rendering.
type ValueType ¶
type ValueType string
const ( IntValueType ValueType = "int64" StringValueType ValueType = "string" BytesValueType ValueType = "bytes" FloatValueType ValueType = "float" NumericValueType ValueType = "numeric" BigNumericValueType ValueType = "bignumeric" BoolValueType ValueType = "bool" JsonValueType ValueType = "json" ArrayValueType ValueType = "array" StructValueType ValueType = "struct" DateValueType ValueType = "date" DatetimeValueType ValueType = "datetime" TimeValueType ValueType = "time" TimestampValueType ValueType = "timestamp" IntervalValueType ValueType = "interval" GeographyValueType ValueType = "geography" RangeValueType ValueType = "range" )
Source Files
¶
- codec.go
- decoder.go
- encoder.go
- exports.go
- geography_helpers.go
- location.go
- value.go
- value_array.go
- value_bool.go
- value_bytes.go
- value_date.go
- value_datetime.go
- value_float.go
- value_geography.go
- value_int.go
- value_interval.go
- value_json.go
- value_numeric.go
- value_range.go
- value_safe.go
- value_string.go
- value_struct.go
- value_time.go
- value_timestamp.go