Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( RawBytesType = reflect.TypeFor[sql.RawBytes]() AnyType = reflect.TypeFor[any]() BoolType = reflect.TypeFor[bool]() ByteType = reflect.TypeFor[byte]() Float32Type = reflect.TypeFor[float32]() Float64Type = reflect.TypeFor[float64]() IntType = reflect.TypeFor[int]() Int8Type = reflect.TypeFor[int8]() Int16Type = reflect.TypeFor[int16]() Int32Type = reflect.TypeFor[int32]() Int64Type = reflect.TypeFor[int64]() UintType = reflect.TypeFor[uint]() Uint8Type = reflect.TypeFor[uint8]() Uint16Type = reflect.TypeFor[uint16]() Uint32Type = reflect.TypeFor[uint32]() Uint64Type = reflect.TypeFor[uint64]() StringType = reflect.TypeFor[string]() BytesType = reflect.TypeFor[[]byte]() TimeType = reflect.TypeFor[time.Time]() DateType = reflect.TypeFor[Date]() ClockTimeType = reflect.TypeFor[ClockTime]() ClockTimeTZType = reflect.TypeFor[ClockTimeTZ]() DateTimeType = reflect.TypeFor[DateTime]() TimestampType = reflect.TypeFor[Timestamp]() NumericType = reflect.TypeFor[Numeric]() JSONType = reflect.TypeFor[JSON]() BinaryType = reflect.TypeFor[Binary]() AnyPtrType = reflect.PointerTo(AnyType) BoolPtrType = reflect.PointerTo(BoolType) BytePtrType = reflect.PointerTo(ByteType) Float32PtrType = reflect.PointerTo(Float32Type) Float64PtrType = reflect.PointerTo(Float64Type) IntPtrType = reflect.PointerTo(IntType) Int8PtrType = reflect.PointerTo(Int8Type) Int16PtrType = reflect.PointerTo(Int16Type) Int32PtrType = reflect.PointerTo(Int32Type) Int64PtrType = reflect.PointerTo(Int64Type) UintPtrType = reflect.PointerTo(UintType) Uint8PtrType = reflect.PointerTo(Uint8Type) Uint16PtrType = reflect.PointerTo(Uint16Type) Uint32PtrType = reflect.PointerTo(Uint32Type) Uint64PtrType = reflect.PointerTo(Uint64Type) StringPtrType = reflect.PointerTo(StringType) BytesPtrType = reflect.PointerTo(BytesType) TimePtrType = reflect.PointerTo(TimeType) DatePtrType = reflect.PointerTo(DateType) ClockTimePtrType = reflect.PointerTo(ClockTimeType) ClockTimeTZPtrType = reflect.PointerTo(ClockTimeTZType) DateTimePtrType = reflect.PointerTo(DateTimeType) TimestampPtrType = reflect.PointerTo(TimestampType) NumericPtrType = reflect.PointerTo(NumericType) JSONPtrType = reflect.PointerTo(JSONType) BinaryPtrType = reflect.PointerTo(BinaryType) NullBoolType = reflect.TypeFor[sql.NullBool]() NullByteType = reflect.TypeFor[sql.NullByte]() NullFloat64Type = reflect.TypeFor[sql.NullFloat64]() NullInt16Type = reflect.TypeFor[sql.NullInt16]() NullInt32Type = reflect.TypeFor[sql.NullInt32]() NullInt64Type = reflect.TypeFor[sql.NullInt64]() NullStringType = reflect.TypeFor[sql.NullString]() NullTimeType = reflect.TypeFor[sql.NullTime]() NullBoolPtrType = reflect.PointerTo(NullBoolType) NullBytePtrType = reflect.PointerTo(NullByteType) NullFloat64PtrType = reflect.PointerTo(NullFloat64Type) NullInt16PtrType = reflect.PointerTo(NullInt16Type) NullInt32PtrType = reflect.PointerTo(NullInt32Type) NullInt64PtrType = reflect.PointerTo(NullInt64Type) NullStringPtrType = reflect.PointerTo(NullStringType) NullTimePtrType = reflect.PointerTo(NullTimeType) )
Functions ¶
This section is empty.
Types ¶
type Binary ¶
type Binary string
Binary is a type that represents binary data in standard Postgres hex format. See https://www.postgresql.org/docs/current/datatype-binary.html#DATATYPE-BINARY-BYTEA-HEX-FORMAT
type ClockTimeTZ ¶
type ClockTimeTZ string
func (*ClockTimeTZ) Scan ¶
func (c *ClockTimeTZ) Scan(src any) error
type JSON ¶
type JSON string
JSON is a type capable of representing arbitrary JSON values without having to marshal/unmarshal them into corresponding Go types.
func (JSON) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. It marshals the underlying []byte as a json.RawMessage (i.e. as a literal JSON value, without quotes).
type Numeric ¶
type Numeric string
Numeric is a type capable of representing arbitrary precision decimal types, as well as special values like Infinity, -Infinity, and NaN.
func (Numeric) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. It attempts to marshal the underlying string to JSON via json.Number (i.e. as a number, without quotes), but falls back to marshalling it as a string (which differs from the json.Number behavior). This accounts for edge cases like Postgres's Infinity, -Infinity, and NaN values.