types

package
v0.22.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func (*Binary) Scan

func (b *Binary) Scan(src any) error

Scan implements the sql.Scanner interface. It converts a []byte value to a string containing a hex representation of the value.

type ClockTime

type ClockTime string

func (*ClockTime) Scan

func (c *ClockTime) Scan(src any) error

type ClockTimeTZ

type ClockTimeTZ string

func (*ClockTimeTZ) Scan

func (c *ClockTimeTZ) Scan(src any) error

type Date

type Date string

func (*Date) Scan

func (d *Date) Scan(src any) error

type DateTime

type DateTime string

func (*DateTime) Scan

func (d *DateTime) 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

func (j JSON) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. It marshals the underlying []byte as a json.RawMessage (i.e. as a literal JSON value, without quotes).

func (*JSON) Scan

func (j *JSON) Scan(src any) error

Scan implements the sql.Scanner interface. It interprets either a []byte or string value as raw JSON.

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

func (n Numeric) MarshalJSON() ([]byte, error)

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.

type Timestamp

type Timestamp string

func (*Timestamp) Scan

func (t *Timestamp) Scan(src any) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL