pgtype: github.com/jackc/pgtype Index | Examples | Files | Directories

package pgtype

import "github.com/jackc/pgtype"

Code:

conn, err := pgx.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
if err != nil {
    fmt.Println(err)
    return
}

defer conn.Close(context.Background())
_, err = conn.Exec(context.Background(), `drop type if exists mytype;`)
if err != nil {
    fmt.Println(err)
    return
}

_, err = conn.Exec(context.Background(), `create type mytype as (
  a int4,
  b text
);`)
if err != nil {
    fmt.Println(err)
    return
}
defer conn.Exec(context.Background(), "drop type mytype")

var oid uint32
err = conn.QueryRow(context.Background(), `select 'mytype'::regtype::oid`).Scan(&oid)
if err != nil {
    fmt.Println(err)
    return
}

ct, err := pgtype.NewCompositeType("mytype", []pgtype.CompositeTypeField{
    {"a", pgtype.Int4OID},
    {"b", pgtype.TextOID},
}, conn.ConnInfo())
if err != nil {
    fmt.Println(err)
    return
}
conn.ConnInfo().RegisterDataType(pgtype.DataType{Value: ct, Name: ct.TypeName(), OID: oid})

var a int
var b *string

err = conn.QueryRow(context.Background(), "select $1::mytype", []interface{}{2, "bar"}).Scan([]interface{}{&a, &b})
if err != nil {
    fmt.Println(err)
    return
}

fmt.Printf("First: a=%d b=%s\n", a, *b)

err = conn.QueryRow(context.Background(), "select (1, NULL)::mytype").Scan([]interface{}{&a, &b})
if err != nil {
    fmt.Println(err)
    return
}

fmt.Printf("Second: a=%d b=%v\n", a, b)

scanTarget := []interface{}{&a, &b}
err = conn.QueryRow(context.Background(), "select NULL::mytype").Scan(&scanTarget)
E(err)

fmt.Printf("Third: isNull=%v\n", scanTarget == nil)

Output:

First: a=2 b=bar
Second: a=1 b=<nil>
Third: isNull=true

ExampleCustomCompositeTypes demonstrates how support for custom types mappable to SQL composites can be added.

Code:

package main

import (
    "context"
    "fmt"
    "os"

    "github.com/jackc/pgtype"
    pgx "github.com/jackc/pgx/v4"
    errors "golang.org/x/xerrors"
)

type MyType struct {
    a   int32   // NULL will cause decoding error
    b   *string // there can be NULL in this position in SQL
}

func (dst *MyType) DecodeBinary(ci *pgtype.ConnInfo, src []byte) error {
    if src == nil {
        return errors.New("NULL values can't be decoded. Scan into a &*MyType to handle NULLs")
    }

    if err := (pgtype.CompositeFields{&dst.a, &dst.b}).DecodeBinary(ci, src); err != nil {
        return err
    }

    return nil
}

func (src MyType) EncodeBinary(ci *pgtype.ConnInfo, buf []byte) (newBuf []byte, err error) {
    a := pgtype.Int4{src.a, pgtype.Present}
    var b pgtype.Text
    if src.b != nil {
        b = pgtype.Text{*src.b, pgtype.Present}
    } else {
        b = pgtype.Text{Status: pgtype.Null}
    }

    return (pgtype.CompositeFields{&a, &b}).EncodeBinary(ci, buf)
}

func ptrS(s string) *string {
    return &s
}

func E(err error) {
    if err != nil {
        panic(err)
    }
}

// ExampleCustomCompositeTypes demonstrates how support for custom types mappable to SQL
// composites can be added.
func main() {
    conn, err := pgx.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
    E(err)

    defer conn.Close(context.Background())
    _, err = conn.Exec(context.Background(), `drop type if exists mytype;

create type mytype as (
  a int4,
  b text
);`)
    E(err)
    defer conn.Exec(context.Background(), "drop type mytype")

    var result *MyType

    // Demonstrates both passing and reading back composite values
    err = conn.QueryRow(context.Background(), "select $1::mytype",
        pgx.QueryResultFormats{pgx.BinaryFormatCode}, MyType{1, ptrS("foo")}).
        Scan(&result)
    E(err)

    fmt.Printf("First row: a=%d b=%s\n", result.a, *result.b)

    // Because we scan into &*MyType, NULLs are handled generically by assigning nil to result
    err = conn.QueryRow(context.Background(), "select NULL::mytype", pgx.QueryResultFormats{pgx.BinaryFormatCode}).Scan(&result)
    E(err)

    fmt.Printf("Second row: %v\n", result)

}

Index

Examples

Package Files

aclitem.go aclitem_array.go array.go array_type.go bit.go bool.go bool_array.go box.go bpchar.go bpchar_array.go bytea.go bytea_array.go cid.go cidr.go cidr_array.go circle.go composite_fields.go composite_type.go convert.go database_sql.go date.go date_array.go daterange.go enum_array.go enum_type.go float4.go float4_array.go float8.go float8_array.go generic_binary.go generic_text.go hstore.go hstore_array.go inet.go inet_array.go int2.go int2_array.go int4.go int4_array.go int4range.go int8.go int8_array.go int8range.go interval.go json.go jsonb.go jsonb_array.go line.go lseg.go macaddr.go macaddr_array.go name.go numeric.go numeric_array.go numrange.go oid.go oid_value.go path.go pgtype.go pguint32.go point.go polygon.go qchar.go range.go record.go text.go text_array.go tid.go time.go timestamp.go timestamp_array.go timestamptz.go timestamptz_array.go tsrange.go tstzrange.go tstzrange_array.go unknown.go uuid.go uuid_array.go varbit.go varchar.go varchar_array.go xid.go

Constants

const (
    BoolOID             = 16
    ByteaOID            = 17
    QCharOID            = 18
    NameOID             = 19
    Int8OID             = 20
    Int2OID             = 21
    Int4OID             = 23
    TextOID             = 25
    OIDOID              = 26
    TIDOID              = 27
    XIDOID              = 28
    CIDOID              = 29
    JSONOID             = 114
    PointOID            = 600
    LsegOID             = 601
    PathOID             = 602
    BoxOID              = 603
    PolygonOID          = 604
    LineOID             = 628
    CIDROID             = 650
    CIDRArrayOID        = 651
    Float4OID           = 700
    Float8OID           = 701
    CircleOID           = 718
    UnknownOID          = 705
    MacaddrOID          = 829
    InetOID             = 869
    BoolArrayOID        = 1000
    Int2ArrayOID        = 1005
    Int4ArrayOID        = 1007
    TextArrayOID        = 1009
    ByteaArrayOID       = 1001
    BPCharArrayOID      = 1014
    VarcharArrayOID     = 1015
    Int8ArrayOID        = 1016
    Float4ArrayOID      = 1021
    Float8ArrayOID      = 1022
    ACLItemOID          = 1033
    ACLItemArrayOID     = 1034
    InetArrayOID        = 1041
    BPCharOID           = 1042
    VarcharOID          = 1043
    DateOID             = 1082
    TimeOID             = 1083
    TimestampOID        = 1114
    TimestampArrayOID   = 1115
    DateArrayOID        = 1182
    TimestamptzOID      = 1184
    TimestamptzArrayOID = 1185
    IntervalOID         = 1186
    NumericArrayOID     = 1231
    BitOID              = 1560
    VarbitOID           = 1562
    NumericOID          = 1700
    RecordOID           = 2249
    UUIDOID             = 2950
    UUIDArrayOID        = 2951
    JSONBOID            = 3802
    JSONBArrayOID       = 3807
    DaterangeOID        = 3912
    Int4rangeOID        = 3904
    NumrangeOID         = 3906
    TsrangeOID          = 3908
    TstzrangeOID        = 3910
    Int8rangeOID        = 3926
)

PostgreSQL oids for common types

const (
    TextFormatCode   = 0
    BinaryFormatCode = 1
)

PostgreSQL format codes

const (
    Inclusive = BoundType('i')
    Exclusive = BoundType('e')
    Unbounded = BoundType('U')
    Empty     = BoundType('E')
)

func DatabaseSQLValue Uses

func DatabaseSQLValue(ci *ConnInfo, src Value) (interface{}, error)

func EncodeTextArrayDimensions Uses

func EncodeTextArrayDimensions(buf []byte, dimensions []ArrayDimension) []byte

func EncodeValueText Uses

func EncodeValueText(src TextEncoder) (interface{}, error)

func GetAssignToDstType Uses

func GetAssignToDstType(dst interface{}) (interface{}, bool)

GetAssignToDstType attempts to convert dst to something AssignTo can assign to. If dst is a pointer to pointer it allocates a value and returns the dereferences pointer. If dst is a named type such as *Foo where Foo is type Foo int16, it converts dst to *int16.

GetAssignToDstType returns the converted dst and a bool representing if any change was made.

func NullAssignTo Uses

func NullAssignTo(dst interface{}) error

func QuoteArrayElementIfNeeded Uses

func QuoteArrayElementIfNeeded(src string) string

type ACLItem Uses

type ACLItem struct {
    String string
    Status Status
}

ACLItem is used for PostgreSQL's aclitem data type. A sample aclitem might look like this:

postgres=arwdDxt/postgres

Note, however, that because the user/role name part of an aclitem is an identifier, it follows all the usual formatting rules for SQL identifiers: if it contains spaces and other special characters, it should appear in double-quotes:

postgres=arwdDxt/"role with spaces"

func (*ACLItem) AssignTo Uses

func (src *ACLItem) AssignTo(dst interface{}) error

func (*ACLItem) DecodeText Uses

func (dst *ACLItem) DecodeText(ci *ConnInfo, src []byte) error

func (ACLItem) EncodeText Uses

func (src ACLItem) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (ACLItem) Get Uses

func (dst ACLItem) Get() interface{}

func (*ACLItem) Scan Uses

func (dst *ACLItem) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*ACLItem) Set Uses

func (dst *ACLItem) Set(src interface{}) error

func (ACLItem) Value Uses

func (src ACLItem) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type ACLItemArray Uses

type ACLItemArray struct {
    Elements   []ACLItem
    Dimensions []ArrayDimension
    Status     Status
}

func (*ACLItemArray) AssignTo Uses

func (src *ACLItemArray) AssignTo(dst interface{}) error

func (*ACLItemArray) DecodeText Uses

func (dst *ACLItemArray) DecodeText(ci *ConnInfo, src []byte) error

func (ACLItemArray) EncodeText Uses

func (src ACLItemArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (ACLItemArray) Get Uses

func (dst ACLItemArray) Get() interface{}

func (*ACLItemArray) Scan Uses

func (dst *ACLItemArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*ACLItemArray) Set Uses

func (dst *ACLItemArray) Set(src interface{}) error

func (ACLItemArray) Value Uses

func (src ACLItemArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type ArrayDimension Uses

type ArrayDimension struct {
    Length     int32
    LowerBound int32
}

type ArrayHeader Uses

type ArrayHeader struct {
    ContainsNull bool
    ElementOID   int32
    Dimensions   []ArrayDimension
}

func (*ArrayHeader) DecodeBinary Uses

func (dst *ArrayHeader) DecodeBinary(ci *ConnInfo, src []byte) (int, error)

func (ArrayHeader) EncodeBinary Uses

func (src ArrayHeader) EncodeBinary(ci *ConnInfo, buf []byte) []byte

type ArrayType Uses

type ArrayType struct {
    // contains filtered or unexported fields
}

ArrayType represents an array type. While it implements Value, this is only in service of its type conversion duties when registered as a data type in a ConnType. It should not be used directly as a Value. ArrayType is a convenience type for types that do not have an concrete array type.

func NewArrayType Uses

func NewArrayType(typeName string, elementOID uint32, newElement func() ValueTranscoder) *ArrayType

func (*ArrayType) AssignTo Uses

func (src *ArrayType) AssignTo(dst interface{}) error

func (*ArrayType) DecodeBinary Uses

func (dst *ArrayType) DecodeBinary(ci *ConnInfo, src []byte) error

func (*ArrayType) DecodeText Uses

func (dst *ArrayType) DecodeText(ci *ConnInfo, src []byte) error

func (ArrayType) EncodeBinary Uses

func (src ArrayType) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (ArrayType) EncodeText Uses

func (src ArrayType) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (ArrayType) Get Uses

func (dst ArrayType) Get() interface{}

func (*ArrayType) NewTypeValue Uses

func (at *ArrayType) NewTypeValue() Value

func (*ArrayType) Scan Uses

func (dst *ArrayType) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*ArrayType) Set Uses

func (dst *ArrayType) Set(src interface{}) error

func (*ArrayType) TypeName Uses

func (at *ArrayType) TypeName() string

func (ArrayType) Value Uses

func (src ArrayType) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type BPChar Uses

type BPChar Text

BPChar is fixed-length, blank padded char type character(n), char(n)

func (*BPChar) AssignTo Uses

func (src *BPChar) AssignTo(dst interface{}) error

AssignTo assigns from src to dst.

func (*BPChar) DecodeBinary Uses

func (dst *BPChar) DecodeBinary(ci *ConnInfo, src []byte) error

func (*BPChar) DecodeText Uses

func (dst *BPChar) DecodeText(ci *ConnInfo, src []byte) error

func (BPChar) EncodeBinary Uses

func (src BPChar) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (BPChar) EncodeText Uses

func (src BPChar) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (BPChar) Get Uses

func (dst BPChar) Get() interface{}

Get returns underlying value

func (BPChar) MarshalJSON Uses

func (src BPChar) MarshalJSON() ([]byte, error)

func (BPChar) PreferredParamFormat Uses

func (BPChar) PreferredParamFormat() int16

func (BPChar) PreferredResultFormat Uses

func (BPChar) PreferredResultFormat() int16

func (*BPChar) Scan Uses

func (dst *BPChar) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*BPChar) Set Uses

func (dst *BPChar) Set(src interface{}) error

Set converts from src to dst.

func (*BPChar) UnmarshalJSON Uses

func (dst *BPChar) UnmarshalJSON(b []byte) error

func (BPChar) Value Uses

func (src BPChar) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type BPCharArray Uses

type BPCharArray struct {
    Elements   []BPChar
    Dimensions []ArrayDimension
    Status     Status
}

func (*BPCharArray) AssignTo Uses

func (src *BPCharArray) AssignTo(dst interface{}) error

func (*BPCharArray) DecodeBinary Uses

func (dst *BPCharArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*BPCharArray) DecodeText Uses

func (dst *BPCharArray) DecodeText(ci *ConnInfo, src []byte) error

func (BPCharArray) EncodeBinary Uses

func (src BPCharArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (BPCharArray) EncodeText Uses

func (src BPCharArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (BPCharArray) Get Uses

func (dst BPCharArray) Get() interface{}

func (*BPCharArray) Scan Uses

func (dst *BPCharArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*BPCharArray) Set Uses

func (dst *BPCharArray) Set(src interface{}) error

func (BPCharArray) Value Uses

func (src BPCharArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type BinaryDecoder Uses

type BinaryDecoder interface {
    // DecodeBinary decodes src into BinaryDecoder. If src is nil then the
    // original SQL value is NULL. BinaryDecoder takes ownership of src. The
    // caller MUST not use it again.
    DecodeBinary(ci *ConnInfo, src []byte) error
}

type BinaryEncoder Uses

type BinaryEncoder interface {
    // EncodeBinary should append the binary format of self to buf. If self is the
    // SQL value NULL then append nothing and return (nil, nil). The caller of
    // EncodeBinary is responsible for writing the correct NULL value or the
    // length of the data written.
    EncodeBinary(ci *ConnInfo, buf []byte) (newBuf []byte, err error)
}

BinaryEncoder is implemented by types that can encode themselves into the PostgreSQL binary wire format.

type Bit Uses

type Bit Varbit

func (*Bit) AssignTo Uses

func (src *Bit) AssignTo(dst interface{}) error

func (*Bit) DecodeBinary Uses

func (dst *Bit) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Bit) DecodeText Uses

func (dst *Bit) DecodeText(ci *ConnInfo, src []byte) error

func (Bit) EncodeBinary Uses

func (src Bit) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Bit) EncodeText Uses

func (src Bit) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Bit) Get Uses

func (dst Bit) Get() interface{}

func (*Bit) Scan Uses

func (dst *Bit) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Bit) Set Uses

func (dst *Bit) Set(src interface{}) error

func (Bit) Value Uses

func (src Bit) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Bool Uses

type Bool struct {
    Bool   bool
    Status Status
}

func (*Bool) AssignTo Uses

func (src *Bool) AssignTo(dst interface{}) error

func (*Bool) DecodeBinary Uses

func (dst *Bool) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Bool) DecodeText Uses

func (dst *Bool) DecodeText(ci *ConnInfo, src []byte) error

func (Bool) EncodeBinary Uses

func (src Bool) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Bool) EncodeText Uses

func (src Bool) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Bool) Get Uses

func (dst Bool) Get() interface{}

func (Bool) MarshalJSON Uses

func (src Bool) MarshalJSON() ([]byte, error)

func (*Bool) Scan Uses

func (dst *Bool) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Bool) Set Uses

func (dst *Bool) Set(src interface{}) error

func (*Bool) UnmarshalJSON Uses

func (dst *Bool) UnmarshalJSON(b []byte) error

func (Bool) Value Uses

func (src Bool) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type BoolArray Uses

type BoolArray struct {
    Elements   []Bool
    Dimensions []ArrayDimension
    Status     Status
}

func (*BoolArray) AssignTo Uses

func (src *BoolArray) AssignTo(dst interface{}) error

func (*BoolArray) DecodeBinary Uses

func (dst *BoolArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*BoolArray) DecodeText Uses

func (dst *BoolArray) DecodeText(ci *ConnInfo, src []byte) error

func (BoolArray) EncodeBinary Uses

func (src BoolArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (BoolArray) EncodeText Uses

func (src BoolArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (BoolArray) Get Uses

func (dst BoolArray) Get() interface{}

func (*BoolArray) Scan Uses

func (dst *BoolArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*BoolArray) Set Uses

func (dst *BoolArray) Set(src interface{}) error

func (BoolArray) Value Uses

func (src BoolArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type BoundType Uses

type BoundType byte

func (BoundType) String Uses

func (bt BoundType) String() string

type Box Uses

type Box struct {
    P      [2]Vec2
    Status Status
}

func (*Box) AssignTo Uses

func (src *Box) AssignTo(dst interface{}) error

func (*Box) DecodeBinary Uses

func (dst *Box) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Box) DecodeText Uses

func (dst *Box) DecodeText(ci *ConnInfo, src []byte) error

func (Box) EncodeBinary Uses

func (src Box) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Box) EncodeText Uses

func (src Box) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Box) Get Uses

func (dst Box) Get() interface{}

func (*Box) Scan Uses

func (dst *Box) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Box) Set Uses

func (dst *Box) Set(src interface{}) error

func (Box) Value Uses

func (src Box) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Bytea Uses

type Bytea struct {
    Bytes  []byte
    Status Status
}

func (*Bytea) AssignTo Uses

func (src *Bytea) AssignTo(dst interface{}) error

func (*Bytea) DecodeBinary Uses

func (dst *Bytea) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Bytea) DecodeText Uses

func (dst *Bytea) DecodeText(ci *ConnInfo, src []byte) error

DecodeText only supports the hex format. This has been the default since PostgreSQL 9.0.

func (Bytea) EncodeBinary Uses

func (src Bytea) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Bytea) EncodeText Uses

func (src Bytea) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Bytea) Get Uses

func (dst Bytea) Get() interface{}

func (*Bytea) Scan Uses

func (dst *Bytea) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Bytea) Set Uses

func (dst *Bytea) Set(src interface{}) error

func (Bytea) Value Uses

func (src Bytea) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type ByteaArray Uses

type ByteaArray struct {
    Elements   []Bytea
    Dimensions []ArrayDimension
    Status     Status
}

func (*ByteaArray) AssignTo Uses

func (src *ByteaArray) AssignTo(dst interface{}) error

func (*ByteaArray) DecodeBinary Uses

func (dst *ByteaArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*ByteaArray) DecodeText Uses

func (dst *ByteaArray) DecodeText(ci *ConnInfo, src []byte) error

func (ByteaArray) EncodeBinary Uses

func (src ByteaArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (ByteaArray) EncodeText Uses

func (src ByteaArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (ByteaArray) Get Uses

func (dst ByteaArray) Get() interface{}

func (*ByteaArray) Scan Uses

func (dst *ByteaArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*ByteaArray) Set Uses

func (dst *ByteaArray) Set(src interface{}) error

func (ByteaArray) Value Uses

func (src ByteaArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type CID Uses

type CID pguint32

CID is PostgreSQL's Command Identifier type.

When one does

select cmin, cmax, * from some_table;

it is the data type of the cmin and cmax hidden system columns.

It is currently implemented as an unsigned four byte integer. Its definition can be found in src/include/c.h as CommandId in the PostgreSQL sources.

func (*CID) AssignTo Uses

func (src *CID) AssignTo(dst interface{}) error

AssignTo assigns from src to dst. Note that as CID is not a general number type AssignTo does not do automatic type conversion as other number types do.

func (*CID) DecodeBinary Uses

func (dst *CID) DecodeBinary(ci *ConnInfo, src []byte) error

func (*CID) DecodeText Uses

func (dst *CID) DecodeText(ci *ConnInfo, src []byte) error

func (CID) EncodeBinary Uses

func (src CID) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (CID) EncodeText Uses

func (src CID) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (CID) Get Uses

func (dst CID) Get() interface{}

func (*CID) Scan Uses

func (dst *CID) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*CID) Set Uses

func (dst *CID) Set(src interface{}) error

Set converts from src to dst. Note that as CID is not a general number type Set does not do automatic type conversion as other number types do.

func (CID) Value Uses

func (src CID) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type CIDR Uses

type CIDR Inet

func (*CIDR) AssignTo Uses

func (src *CIDR) AssignTo(dst interface{}) error

func (*CIDR) DecodeBinary Uses

func (dst *CIDR) DecodeBinary(ci *ConnInfo, src []byte) error

func (*CIDR) DecodeText Uses

func (dst *CIDR) DecodeText(ci *ConnInfo, src []byte) error

func (CIDR) EncodeBinary Uses

func (src CIDR) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (CIDR) EncodeText Uses

func (src CIDR) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (CIDR) Get Uses

func (dst CIDR) Get() interface{}

func (*CIDR) Set Uses

func (dst *CIDR) Set(src interface{}) error

type CIDRArray Uses

type CIDRArray struct {
    Elements   []CIDR
    Dimensions []ArrayDimension
    Status     Status
}

func (*CIDRArray) AssignTo Uses

func (src *CIDRArray) AssignTo(dst interface{}) error

func (*CIDRArray) DecodeBinary Uses

func (dst *CIDRArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*CIDRArray) DecodeText Uses

func (dst *CIDRArray) DecodeText(ci *ConnInfo, src []byte) error

func (CIDRArray) EncodeBinary Uses

func (src CIDRArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (CIDRArray) EncodeText Uses

func (src CIDRArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (CIDRArray) Get Uses

func (dst CIDRArray) Get() interface{}

func (*CIDRArray) Scan Uses

func (dst *CIDRArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*CIDRArray) Set Uses

func (dst *CIDRArray) Set(src interface{}) error

func (CIDRArray) Value Uses

func (src CIDRArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Circle Uses

type Circle struct {
    P      Vec2
    R      float64
    Status Status
}

func (*Circle) AssignTo Uses

func (src *Circle) AssignTo(dst interface{}) error

func (*Circle) DecodeBinary Uses

func (dst *Circle) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Circle) DecodeText Uses

func (dst *Circle) DecodeText(ci *ConnInfo, src []byte) error

func (Circle) EncodeBinary Uses

func (src Circle) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Circle) EncodeText Uses

func (src Circle) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Circle) Get Uses

func (dst Circle) Get() interface{}

func (*Circle) Scan Uses

func (dst *Circle) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Circle) Set Uses

func (dst *Circle) Set(src interface{}) error

func (Circle) Value Uses

func (src Circle) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type CompositeBinaryBuilder Uses

type CompositeBinaryBuilder struct {
    // contains filtered or unexported fields
}

func NewCompositeBinaryBuilder Uses

func NewCompositeBinaryBuilder(ci *ConnInfo, buf []byte) *CompositeBinaryBuilder

func (*CompositeBinaryBuilder) AppendEncoder Uses

func (b *CompositeBinaryBuilder) AppendEncoder(oid uint32, field BinaryEncoder)

func (*CompositeBinaryBuilder) AppendValue Uses

func (b *CompositeBinaryBuilder) AppendValue(oid uint32, field interface{})

func (*CompositeBinaryBuilder) Finish Uses

func (b *CompositeBinaryBuilder) Finish() ([]byte, error)

type CompositeBinaryScanner Uses

type CompositeBinaryScanner struct {
    // contains filtered or unexported fields
}

func NewCompositeBinaryScanner Uses

func NewCompositeBinaryScanner(ci *ConnInfo, src []byte) *CompositeBinaryScanner

NewCompositeBinaryScanner a scanner over a binary encoded composite balue.

func (*CompositeBinaryScanner) Bytes Uses

func (cfs *CompositeBinaryScanner) Bytes() []byte

Bytes returns the bytes of the field most recently read by Scan().

func (*CompositeBinaryScanner) Err Uses

func (cfs *CompositeBinaryScanner) Err() error

Err returns any error encountered by the scanner.

func (*CompositeBinaryScanner) FieldCount Uses

func (cfs *CompositeBinaryScanner) FieldCount() int

func (*CompositeBinaryScanner) Next Uses

func (cfs *CompositeBinaryScanner) Next() bool

Next advances the scanner to the next field. It returns false after the last field is read or an error occurs. After Next returns false, the Err method can be called to check if any errors occurred.

func (*CompositeBinaryScanner) OID Uses

func (cfs *CompositeBinaryScanner) OID() uint32

OID returns the OID of the field most recently read by Scan().

func (*CompositeBinaryScanner) ScanDecoder Uses

func (cfs *CompositeBinaryScanner) ScanDecoder(d BinaryDecoder)

ScanDecoder calls Next and decodes the result with d.

func (*CompositeBinaryScanner) ScanValue Uses

func (cfs *CompositeBinaryScanner) ScanValue(d interface{})

ScanDecoder calls Next and scans the result into d.

type CompositeFields Uses

type CompositeFields []interface{}

CompositeFields scans the fields of a composite type into the elements of the CompositeFields value. To scan a nullable value use a *CompositeFields. It will be set to nil in case of null.

CompositeFields implements EncodeBinary and EncodeText. However, functionality is limited due to CompositeFields not knowing the PostgreSQL schema of the composite type. Prefer using a registered CompositeType.

func (CompositeFields) DecodeBinary Uses

func (cf CompositeFields) DecodeBinary(ci *ConnInfo, src []byte) error

func (CompositeFields) DecodeText Uses

func (cf CompositeFields) DecodeText(ci *ConnInfo, src []byte) error

func (CompositeFields) EncodeBinary Uses

func (cf CompositeFields) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

EncodeBinary encodes composite fields into the binary format. Unlike CompositeType the schema of the destination is unknown. Prefer registering a CompositeType to using CompositeFields to encode directly. Because the binary composite format requires the OID of each field to be specified the only types that will work are those known to ConnInfo.

In particular:

* Nil cannot be used because there is no way to determine what type it. * Integer types must be exact matches. e.g. A Go int32 into a PostgreSQL bigint will fail. * No dereferencing will be done. e.g. *Text must be used instead of Text.

func (CompositeFields) EncodeText Uses

func (cf CompositeFields) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

EncodeText encodes composite fields into the text format. Prefer registering a CompositeType to using CompositeFields to encode directly.

type CompositeTextBuilder Uses

type CompositeTextBuilder struct {
    // contains filtered or unexported fields
}

func NewCompositeTextBuilder Uses

func NewCompositeTextBuilder(ci *ConnInfo, buf []byte) *CompositeTextBuilder

func (*CompositeTextBuilder) AppendEncoder Uses

func (b *CompositeTextBuilder) AppendEncoder(field TextEncoder)

func (*CompositeTextBuilder) AppendValue Uses

func (b *CompositeTextBuilder) AppendValue(field interface{})

func (*CompositeTextBuilder) Finish Uses

func (b *CompositeTextBuilder) Finish() ([]byte, error)

type CompositeTextScanner Uses

type CompositeTextScanner struct {
    // contains filtered or unexported fields
}

func NewCompositeTextScanner Uses

func NewCompositeTextScanner(ci *ConnInfo, src []byte) *CompositeTextScanner

NewCompositeTextScanner a scanner over a text encoded composite value.

func (*CompositeTextScanner) Bytes Uses

func (cfs *CompositeTextScanner) Bytes() []byte

Bytes returns the bytes of the field most recently read by Scan().

func (*CompositeTextScanner) Err Uses

func (cfs *CompositeTextScanner) Err() error

Err returns any error encountered by the scanner.

func (*CompositeTextScanner) Next Uses

func (cfs *CompositeTextScanner) Next() bool

Next advances the scanner to the next field. It returns false after the last field is read or an error occurs. After Next returns false, the Err method can be called to check if any errors occurred.

func (*CompositeTextScanner) ScanDecoder Uses

func (cfs *CompositeTextScanner) ScanDecoder(d TextDecoder)

ScanDecoder calls Next and decodes the result with d.

func (*CompositeTextScanner) ScanValue Uses

func (cfs *CompositeTextScanner) ScanValue(d interface{})

ScanDecoder calls Next and scans the result into d.

type CompositeType Uses

type CompositeType struct {
    // contains filtered or unexported fields
}

func NewCompositeType Uses

func NewCompositeType(typeName string, fields []CompositeTypeField, ci *ConnInfo) (*CompositeType, error)

NewCompositeType creates a CompositeType from fields and ci. ci is used to find the ValueTranscoders used for fields. All field OIDs must be previously registered in ci.

func NewCompositeTypeValues Uses

func NewCompositeTypeValues(typeName string, fields []CompositeTypeField, values []ValueTranscoder) (*CompositeType, error)

NewCompositeTypeValues creates a CompositeType from fields and values. fields and values must have the same length. Prefer NewCompositeType unless overriding the transcoding of fields is required.

func (CompositeType) AssignTo Uses

func (src CompositeType) AssignTo(dst interface{}) error

AssignTo should never be called on composite value directly

func (*CompositeType) DecodeBinary Uses

func (dst *CompositeType) DecodeBinary(ci *ConnInfo, buf []byte) error

DecodeBinary implements BinaryDecoder interface. Opposite to Record, fields in a composite act as a "schema" and decoding fails if SQL value can't be assigned due to type mismatch

func (*CompositeType) DecodeText Uses

func (dst *CompositeType) DecodeText(ci *ConnInfo, buf []byte) error

func (CompositeType) EncodeBinary Uses

func (src CompositeType) EncodeBinary(ci *ConnInfo, buf []byte) (newBuf []byte, err error)

func (CompositeType) EncodeText Uses

func (src CompositeType) EncodeText(ci *ConnInfo, buf []byte) (newBuf []byte, err error)

func (*CompositeType) Fields Uses

func (ct *CompositeType) Fields() []CompositeTypeField

func (CompositeType) Get Uses

func (src CompositeType) Get() interface{}

func (*CompositeType) NewTypeValue Uses

func (ct *CompositeType) NewTypeValue() Value

func (*CompositeType) Set Uses

func (dst *CompositeType) Set(src interface{}) error

func (*CompositeType) TypeName Uses

func (ct *CompositeType) TypeName() string

type CompositeTypeField Uses

type CompositeTypeField struct {
    Name string
    OID  uint32
}

type ConnInfo Uses

type ConnInfo struct {
    // contains filtered or unexported fields
}

func NewConnInfo Uses

func NewConnInfo() *ConnInfo

func (*ConnInfo) DataTypeForName Uses

func (ci *ConnInfo) DataTypeForName(name string) (*DataType, bool)

func (*ConnInfo) DataTypeForOID Uses

func (ci *ConnInfo) DataTypeForOID(oid uint32) (*DataType, bool)

func (*ConnInfo) DataTypeForValue Uses

func (ci *ConnInfo) DataTypeForValue(v interface{}) (*DataType, bool)

DataTypeForValue finds a data type suitable for v. Use RegisterDataType to register types that can encode and decode themselves. Use RegisterDefaultPgType to register that can be handled by a registered data type.

func (*ConnInfo) DeepCopy Uses

func (ci *ConnInfo) DeepCopy() *ConnInfo

DeepCopy makes a deep copy of the ConnInfo.

func (*ConnInfo) InitializeDataTypes Uses

func (ci *ConnInfo) InitializeDataTypes(nameOIDs map[string]uint32)

func (*ConnInfo) ParamFormatCodeForOID Uses

func (ci *ConnInfo) ParamFormatCodeForOID(oid uint32) int16

func (*ConnInfo) PlanScan Uses

func (ci *ConnInfo) PlanScan(oid uint32, formatCode int16, dst interface{}) ScanPlan

PlanScan prepares a plan to scan a value into dst.

func (*ConnInfo) RegisterDataType Uses

func (ci *ConnInfo) RegisterDataType(t DataType)

func (*ConnInfo) RegisterDefaultPgType Uses

func (ci *ConnInfo) RegisterDefaultPgType(value interface{}, name string)

RegisterDefaultPgType registers a mapping of a Go type to a PostgreSQL type name. Typically the data type to be encoded or decoded is determined by the PostgreSQL OID. But if the OID of a value to be encoded or decoded is unknown, this additional mapping will be used by DataTypeForValue to determine a suitable data type.

func (*ConnInfo) ResultFormatCodeForOID Uses

func (ci *ConnInfo) ResultFormatCodeForOID(oid uint32) int16

func (*ConnInfo) Scan Uses

func (ci *ConnInfo) Scan(oid uint32, formatCode int16, src []byte, dst interface{}) error

type DataType Uses

type DataType struct {
    Value Value

    Name string
    OID  uint32
    // contains filtered or unexported fields
}

type Date Uses

type Date struct {
    Time             time.Time
    Status           Status
    InfinityModifier InfinityModifier
}

func (*Date) AssignTo Uses

func (src *Date) AssignTo(dst interface{}) error

func (*Date) DecodeBinary Uses

func (dst *Date) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Date) DecodeText Uses

func (dst *Date) DecodeText(ci *ConnInfo, src []byte) error

func (Date) EncodeBinary Uses

func (src Date) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Date) EncodeText Uses

func (src Date) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Date) Get Uses

func (dst Date) Get() interface{}

func (Date) MarshalJSON Uses

func (src Date) MarshalJSON() ([]byte, error)

func (*Date) Scan Uses

func (dst *Date) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Date) Set Uses

func (dst *Date) Set(src interface{}) error

func (*Date) UnmarshalJSON Uses

func (dst *Date) UnmarshalJSON(b []byte) error

func (Date) Value Uses

func (src Date) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type DateArray Uses

type DateArray struct {
    Elements   []Date
    Dimensions []ArrayDimension
    Status     Status
}

func (*DateArray) AssignTo Uses

func (src *DateArray) AssignTo(dst interface{}) error

func (*DateArray) DecodeBinary Uses

func (dst *DateArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*DateArray) DecodeText Uses

func (dst *DateArray) DecodeText(ci *ConnInfo, src []byte) error

func (DateArray) EncodeBinary Uses

func (src DateArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (DateArray) EncodeText Uses

func (src DateArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (DateArray) Get Uses

func (dst DateArray) Get() interface{}

func (*DateArray) Scan Uses

func (dst *DateArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*DateArray) Set Uses

func (dst *DateArray) Set(src interface{}) error

func (DateArray) Value Uses

func (src DateArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Daterange Uses

type Daterange struct {
    Lower     Date
    Upper     Date
    LowerType BoundType
    UpperType BoundType
    Status    Status
}

func (*Daterange) AssignTo Uses

func (src *Daterange) AssignTo(dst interface{}) error

func (*Daterange) DecodeBinary Uses

func (dst *Daterange) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Daterange) DecodeText Uses

func (dst *Daterange) DecodeText(ci *ConnInfo, src []byte) error

func (Daterange) EncodeBinary Uses

func (src Daterange) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Daterange) EncodeText Uses

func (src Daterange) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Daterange) Get Uses

func (dst Daterange) Get() interface{}

func (*Daterange) Scan Uses

func (dst *Daterange) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Daterange) Set Uses

func (dst *Daterange) Set(src interface{}) error

func (Daterange) Value Uses

func (src Daterange) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type EnumArray Uses

type EnumArray struct {
    Elements   []GenericText
    Dimensions []ArrayDimension
    Status     Status
}

func (*EnumArray) AssignTo Uses

func (src *EnumArray) AssignTo(dst interface{}) error

func (*EnumArray) DecodeText Uses

func (dst *EnumArray) DecodeText(ci *ConnInfo, src []byte) error

func (EnumArray) EncodeText Uses

func (src EnumArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (EnumArray) Get Uses

func (dst EnumArray) Get() interface{}

func (*EnumArray) Scan Uses

func (dst *EnumArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*EnumArray) Set Uses

func (dst *EnumArray) Set(src interface{}) error

func (EnumArray) Value Uses

func (src EnumArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type EnumType Uses

type EnumType struct {
    // contains filtered or unexported fields
}

EnumType represents a enum type. While it implements Value, this is only in service of its type conversion duties when registered as a data type in a ConnType. It should not be used directly as a Value.

func NewEnumType Uses

func NewEnumType(typeName string, members []string) *EnumType

NewEnumType initializes a new EnumType. It retains a read-only reference to members. members must not be changed.

func (*EnumType) AssignTo Uses

func (src *EnumType) AssignTo(dst interface{}) error

func (*EnumType) DecodeBinary Uses

func (dst *EnumType) DecodeBinary(ci *ConnInfo, src []byte) error

func (*EnumType) DecodeText Uses

func (dst *EnumType) DecodeText(ci *ConnInfo, src []byte) error

func (EnumType) EncodeBinary Uses

func (src EnumType) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (EnumType) EncodeText Uses

func (src EnumType) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (EnumType) Get Uses

func (dst EnumType) Get() interface{}

func (*EnumType) Members Uses

func (et *EnumType) Members() []string

func (*EnumType) NewTypeValue Uses

func (et *EnumType) NewTypeValue() Value

func (EnumType) PreferredParamFormat Uses

func (EnumType) PreferredParamFormat() int16

func (EnumType) PreferredResultFormat Uses

func (EnumType) PreferredResultFormat() int16

func (*EnumType) Set Uses

func (dst *EnumType) Set(src interface{}) error

Set assigns src to dst. Set purposely does not check that src is a member. This allows continued error free operation in the event the PostgreSQL enum type is modified during a connection.

func (*EnumType) TypeName Uses

func (et *EnumType) TypeName() string

type Float4 Uses

type Float4 struct {
    Float  float32
    Status Status
}

func (*Float4) AssignTo Uses

func (src *Float4) AssignTo(dst interface{}) error

func (*Float4) DecodeBinary Uses

func (dst *Float4) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Float4) DecodeText Uses

func (dst *Float4) DecodeText(ci *ConnInfo, src []byte) error

func (Float4) EncodeBinary Uses

func (src Float4) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Float4) EncodeText Uses

func (src Float4) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Float4) Get Uses

func (dst Float4) Get() interface{}

func (*Float4) Scan Uses

func (dst *Float4) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Float4) Set Uses

func (dst *Float4) Set(src interface{}) error

func (Float4) Value Uses

func (src Float4) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Float4Array Uses

type Float4Array struct {
    Elements   []Float4
    Dimensions []ArrayDimension
    Status     Status
}

func (*Float4Array) AssignTo Uses

func (src *Float4Array) AssignTo(dst interface{}) error

func (*Float4Array) DecodeBinary Uses

func (dst *Float4Array) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Float4Array) DecodeText Uses

func (dst *Float4Array) DecodeText(ci *ConnInfo, src []byte) error

func (Float4Array) EncodeBinary Uses

func (src Float4Array) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Float4Array) EncodeText Uses

func (src Float4Array) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Float4Array) Get Uses

func (dst Float4Array) Get() interface{}

func (*Float4Array) Scan Uses

func (dst *Float4Array) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Float4Array) Set Uses

func (dst *Float4Array) Set(src interface{}) error

func (Float4Array) Value Uses

func (src Float4Array) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Float8 Uses

type Float8 struct {
    Float  float64
    Status Status
}

func (*Float8) AssignTo Uses

func (src *Float8) AssignTo(dst interface{}) error

func (*Float8) DecodeBinary Uses

func (dst *Float8) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Float8) DecodeText Uses

func (dst *Float8) DecodeText(ci *ConnInfo, src []byte) error

func (Float8) EncodeBinary Uses

func (src Float8) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Float8) EncodeText Uses

func (src Float8) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Float8) Get Uses

func (dst Float8) Get() interface{}

func (*Float8) Scan Uses

func (dst *Float8) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Float8) Set Uses

func (dst *Float8) Set(src interface{}) error

func (Float8) Value Uses

func (src Float8) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Float8Array Uses

type Float8Array struct {
    Elements   []Float8
    Dimensions []ArrayDimension
    Status     Status
}

func (*Float8Array) AssignTo Uses

func (src *Float8Array) AssignTo(dst interface{}) error

func (*Float8Array) DecodeBinary Uses

func (dst *Float8Array) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Float8Array) DecodeText Uses

func (dst *Float8Array) DecodeText(ci *ConnInfo, src []byte) error

func (Float8Array) EncodeBinary Uses

func (src Float8Array) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Float8Array) EncodeText Uses

func (src Float8Array) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Float8Array) Get Uses

func (dst Float8Array) Get() interface{}

func (*Float8Array) Scan Uses

func (dst *Float8Array) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Float8Array) Set Uses

func (dst *Float8Array) Set(src interface{}) error

func (Float8Array) Value Uses

func (src Float8Array) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type GenericBinary Uses

type GenericBinary Bytea

GenericBinary is a placeholder for binary format values that no other type exists to handle.

func (*GenericBinary) AssignTo Uses

func (src *GenericBinary) AssignTo(dst interface{}) error

func (*GenericBinary) DecodeBinary Uses

func (dst *GenericBinary) DecodeBinary(ci *ConnInfo, src []byte) error

func (GenericBinary) EncodeBinary Uses

func (src GenericBinary) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (GenericBinary) Get Uses

func (dst GenericBinary) Get() interface{}

func (*GenericBinary) Scan Uses

func (dst *GenericBinary) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*GenericBinary) Set Uses

func (dst *GenericBinary) Set(src interface{}) error

func (GenericBinary) Value Uses

func (src GenericBinary) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type GenericText Uses

type GenericText Text

GenericText is a placeholder for text format values that no other type exists to handle.

func (*GenericText) AssignTo Uses

func (src *GenericText) AssignTo(dst interface{}) error

func (*GenericText) DecodeText Uses

func (dst *GenericText) DecodeText(ci *ConnInfo, src []byte) error

func (GenericText) EncodeText Uses

func (src GenericText) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (GenericText) Get Uses

func (dst GenericText) Get() interface{}

func (*GenericText) Scan Uses

func (dst *GenericText) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*GenericText) Set Uses

func (dst *GenericText) Set(src interface{}) error

func (GenericText) Value Uses

func (src GenericText) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Hstore Uses

type Hstore struct {
    Map    map[string]Text
    Status Status
}

Hstore represents an hstore column that can be null or have null values associated with its keys.

func (*Hstore) AssignTo Uses

func (src *Hstore) AssignTo(dst interface{}) error

func (*Hstore) DecodeBinary Uses

func (dst *Hstore) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Hstore) DecodeText Uses

func (dst *Hstore) DecodeText(ci *ConnInfo, src []byte) error

func (Hstore) EncodeBinary Uses

func (src Hstore) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Hstore) EncodeText Uses

func (src Hstore) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Hstore) Get Uses

func (dst Hstore) Get() interface{}

func (*Hstore) Scan Uses

func (dst *Hstore) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Hstore) Set Uses

func (dst *Hstore) Set(src interface{}) error

func (Hstore) Value Uses

func (src Hstore) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type HstoreArray Uses

type HstoreArray struct {
    Elements   []Hstore
    Dimensions []ArrayDimension
    Status     Status
}

func (*HstoreArray) AssignTo Uses

func (src *HstoreArray) AssignTo(dst interface{}) error

func (*HstoreArray) DecodeBinary Uses

func (dst *HstoreArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*HstoreArray) DecodeText Uses

func (dst *HstoreArray) DecodeText(ci *ConnInfo, src []byte) error

func (HstoreArray) EncodeBinary Uses

func (src HstoreArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (HstoreArray) EncodeText Uses

func (src HstoreArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (HstoreArray) Get Uses

func (dst HstoreArray) Get() interface{}

func (*HstoreArray) Scan Uses

func (dst *HstoreArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*HstoreArray) Set Uses

func (dst *HstoreArray) Set(src interface{}) error

func (HstoreArray) Value Uses

func (src HstoreArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Inet Uses

type Inet struct {
    IPNet  *net.IPNet
    Status Status
}

Inet represents both inet and cidr PostgreSQL types.

func (*Inet) AssignTo Uses

func (src *Inet) AssignTo(dst interface{}) error

func (*Inet) DecodeBinary Uses

func (dst *Inet) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Inet) DecodeText Uses

func (dst *Inet) DecodeText(ci *ConnInfo, src []byte) error

func (Inet) EncodeBinary Uses

func (src Inet) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

EncodeBinary encodes src into w.

func (Inet) EncodeText Uses

func (src Inet) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Inet) Get Uses

func (dst Inet) Get() interface{}

func (*Inet) Scan Uses

func (dst *Inet) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Inet) Set Uses

func (dst *Inet) Set(src interface{}) error

func (Inet) Value Uses

func (src Inet) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type InetArray Uses

type InetArray struct {
    Elements   []Inet
    Dimensions []ArrayDimension
    Status     Status
}

func (*InetArray) AssignTo Uses

func (src *InetArray) AssignTo(dst interface{}) error

func (*InetArray) DecodeBinary Uses

func (dst *InetArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*InetArray) DecodeText Uses

func (dst *InetArray) DecodeText(ci *ConnInfo, src []byte) error

func (InetArray) EncodeBinary Uses

func (src InetArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (InetArray) EncodeText Uses

func (src InetArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (InetArray) Get Uses

func (dst InetArray) Get() interface{}

func (*InetArray) Scan Uses

func (dst *InetArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*InetArray) Set Uses

func (dst *InetArray) Set(src interface{}) error

func (InetArray) Value Uses

func (src InetArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type InfinityModifier Uses

type InfinityModifier int8
const (
    Infinity         InfinityModifier = 1
    None             InfinityModifier = 0
    NegativeInfinity InfinityModifier = -Infinity
)

func (InfinityModifier) String Uses

func (im InfinityModifier) String() string

type Int2 Uses

type Int2 struct {
    Int    int16
    Status Status
}

func (*Int2) AssignTo Uses

func (src *Int2) AssignTo(dst interface{}) error

func (*Int2) DecodeBinary Uses

func (dst *Int2) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Int2) DecodeText Uses

func (dst *Int2) DecodeText(ci *ConnInfo, src []byte) error

func (Int2) EncodeBinary Uses

func (src Int2) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int2) EncodeText Uses

func (src Int2) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int2) Get Uses

func (dst Int2) Get() interface{}

func (Int2) MarshalJSON Uses

func (src Int2) MarshalJSON() ([]byte, error)

func (*Int2) Scan Uses

func (dst *Int2) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Int2) Set Uses

func (dst *Int2) Set(src interface{}) error

func (Int2) Value Uses

func (src Int2) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Int2Array Uses

type Int2Array struct {
    Elements   []Int2
    Dimensions []ArrayDimension
    Status     Status
}

func (*Int2Array) AssignTo Uses

func (src *Int2Array) AssignTo(dst interface{}) error

func (*Int2Array) DecodeBinary Uses

func (dst *Int2Array) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Int2Array) DecodeText Uses

func (dst *Int2Array) DecodeText(ci *ConnInfo, src []byte) error

func (Int2Array) EncodeBinary Uses

func (src Int2Array) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int2Array) EncodeText Uses

func (src Int2Array) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int2Array) Get Uses

func (dst Int2Array) Get() interface{}

func (*Int2Array) Scan Uses

func (dst *Int2Array) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Int2Array) Set Uses

func (dst *Int2Array) Set(src interface{}) error

func (Int2Array) Value Uses

func (src Int2Array) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Int4 Uses

type Int4 struct {
    Int    int32
    Status Status
}

func (*Int4) AssignTo Uses

func (src *Int4) AssignTo(dst interface{}) error

func (*Int4) DecodeBinary Uses

func (dst *Int4) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Int4) DecodeText Uses

func (dst *Int4) DecodeText(ci *ConnInfo, src []byte) error

func (Int4) EncodeBinary Uses

func (src Int4) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int4) EncodeText Uses

func (src Int4) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int4) Get Uses

func (dst Int4) Get() interface{}

func (Int4) MarshalJSON Uses

func (src Int4) MarshalJSON() ([]byte, error)

func (*Int4) Scan Uses

func (dst *Int4) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Int4) Set Uses

func (dst *Int4) Set(src interface{}) error

func (*Int4) UnmarshalJSON Uses

func (dst *Int4) UnmarshalJSON(b []byte) error

func (Int4) Value Uses

func (src Int4) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Int4Array Uses

type Int4Array struct {
    Elements   []Int4
    Dimensions []ArrayDimension
    Status     Status
}

func (*Int4Array) AssignTo Uses

func (src *Int4Array) AssignTo(dst interface{}) error

func (*Int4Array) DecodeBinary Uses

func (dst *Int4Array) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Int4Array) DecodeText Uses

func (dst *Int4Array) DecodeText(ci *ConnInfo, src []byte) error

func (Int4Array) EncodeBinary Uses

func (src Int4Array) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int4Array) EncodeText Uses

func (src Int4Array) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int4Array) Get Uses

func (dst Int4Array) Get() interface{}

func (*Int4Array) Scan Uses

func (dst *Int4Array) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Int4Array) Set Uses

func (dst *Int4Array) Set(src interface{}) error

func (Int4Array) Value Uses

func (src Int4Array) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Int4range Uses

type Int4range struct {
    Lower     Int4
    Upper     Int4
    LowerType BoundType
    UpperType BoundType
    Status    Status
}

func (*Int4range) AssignTo Uses

func (src *Int4range) AssignTo(dst interface{}) error

func (*Int4range) DecodeBinary Uses

func (dst *Int4range) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Int4range) DecodeText Uses

func (dst *Int4range) DecodeText(ci *ConnInfo, src []byte) error

func (Int4range) EncodeBinary Uses

func (src Int4range) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int4range) EncodeText Uses

func (src Int4range) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int4range) Get Uses

func (dst Int4range) Get() interface{}

func (*Int4range) Scan Uses

func (dst *Int4range) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Int4range) Set Uses

func (dst *Int4range) Set(src interface{}) error

func (Int4range) Value Uses

func (src Int4range) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Int8 Uses

type Int8 struct {
    Int    int64
    Status Status
}

func (*Int8) AssignTo Uses

func (src *Int8) AssignTo(dst interface{}) error

func (*Int8) DecodeBinary Uses

func (dst *Int8) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Int8) DecodeText Uses

func (dst *Int8) DecodeText(ci *ConnInfo, src []byte) error

func (Int8) EncodeBinary Uses

func (src Int8) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int8) EncodeText Uses

func (src Int8) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int8) Get Uses

func (dst Int8) Get() interface{}

func (Int8) MarshalJSON Uses

func (src Int8) MarshalJSON() ([]byte, error)

func (*Int8) Scan Uses

func (dst *Int8) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Int8) Set Uses

func (dst *Int8) Set(src interface{}) error

func (*Int8) UnmarshalJSON Uses

func (dst *Int8) UnmarshalJSON(b []byte) error

func (Int8) Value Uses

func (src Int8) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Int8Array Uses

type Int8Array struct {
    Elements   []Int8
    Dimensions []ArrayDimension
    Status     Status
}

func (*Int8Array) AssignTo Uses

func (src *Int8Array) AssignTo(dst interface{}) error

func (*Int8Array) DecodeBinary Uses

func (dst *Int8Array) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Int8Array) DecodeText Uses

func (dst *Int8Array) DecodeText(ci *ConnInfo, src []byte) error

func (Int8Array) EncodeBinary Uses

func (src Int8Array) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int8Array) EncodeText Uses

func (src Int8Array) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int8Array) Get Uses

func (dst Int8Array) Get() interface{}

func (*Int8Array) Scan Uses

func (dst *Int8Array) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Int8Array) Set Uses

func (dst *Int8Array) Set(src interface{}) error

func (Int8Array) Value Uses

func (src Int8Array) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Int8range Uses

type Int8range struct {
    Lower     Int8
    Upper     Int8
    LowerType BoundType
    UpperType BoundType
    Status    Status
}

func (*Int8range) AssignTo Uses

func (src *Int8range) AssignTo(dst interface{}) error

func (*Int8range) DecodeBinary Uses

func (dst *Int8range) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Int8range) DecodeText Uses

func (dst *Int8range) DecodeText(ci *ConnInfo, src []byte) error

func (Int8range) EncodeBinary Uses

func (src Int8range) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int8range) EncodeText Uses

func (src Int8range) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Int8range) Get Uses

func (dst Int8range) Get() interface{}

func (*Int8range) Scan Uses

func (dst *Int8range) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Int8range) Set Uses

func (dst *Int8range) Set(src interface{}) error

func (Int8range) Value Uses

func (src Int8range) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Interval Uses

type Interval struct {
    Microseconds int64
    Days         int32
    Months       int32
    Status       Status
}

func (*Interval) AssignTo Uses

func (src *Interval) AssignTo(dst interface{}) error

func (*Interval) DecodeBinary Uses

func (dst *Interval) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Interval) DecodeText Uses

func (dst *Interval) DecodeText(ci *ConnInfo, src []byte) error

func (Interval) EncodeBinary Uses

func (src Interval) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

EncodeBinary encodes src into w.

func (Interval) EncodeText Uses

func (src Interval) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Interval) Get Uses

func (dst Interval) Get() interface{}

func (*Interval) Scan Uses

func (dst *Interval) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Interval) Set Uses

func (dst *Interval) Set(src interface{}) error

func (Interval) Value Uses

func (src Interval) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type JSON Uses

type JSON struct {
    Bytes  []byte
    Status Status
}

func (*JSON) AssignTo Uses

func (src *JSON) AssignTo(dst interface{}) error

func (*JSON) DecodeBinary Uses

func (dst *JSON) DecodeBinary(ci *ConnInfo, src []byte) error

func (*JSON) DecodeText Uses

func (dst *JSON) DecodeText(ci *ConnInfo, src []byte) error

func (JSON) EncodeBinary Uses

func (src JSON) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (JSON) EncodeText Uses

func (src JSON) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (JSON) Get Uses

func (dst JSON) Get() interface{}

func (JSON) MarshalJSON Uses

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

func (JSON) PreferredParamFormat Uses

func (JSON) PreferredParamFormat() int16

func (JSON) PreferredResultFormat Uses

func (JSON) PreferredResultFormat() int16

func (*JSON) Scan Uses

func (dst *JSON) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*JSON) Set Uses

func (dst *JSON) Set(src interface{}) error

func (*JSON) UnmarshalJSON Uses

func (dst *JSON) UnmarshalJSON(b []byte) error

func (JSON) Value Uses

func (src JSON) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type JSONB Uses

type JSONB JSON

func (*JSONB) AssignTo Uses

func (src *JSONB) AssignTo(dst interface{}) error

func (*JSONB) DecodeBinary Uses

func (dst *JSONB) DecodeBinary(ci *ConnInfo, src []byte) error

func (*JSONB) DecodeText Uses

func (dst *JSONB) DecodeText(ci *ConnInfo, src []byte) error

func (JSONB) EncodeBinary Uses

func (src JSONB) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (JSONB) EncodeText Uses

func (src JSONB) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (JSONB) Get Uses

func (dst JSONB) Get() interface{}

func (JSONB) MarshalJSON Uses

func (src JSONB) MarshalJSON() ([]byte, error)

func (JSONB) PreferredParamFormat Uses

func (JSONB) PreferredParamFormat() int16

func (JSONB) PreferredResultFormat Uses

func (JSONB) PreferredResultFormat() int16

func (*JSONB) Scan Uses

func (dst *JSONB) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*JSONB) Set Uses

func (dst *JSONB) Set(src interface{}) error

func (*JSONB) UnmarshalJSON Uses

func (dst *JSONB) UnmarshalJSON(b []byte) error

func (JSONB) Value Uses

func (src JSONB) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type JSONBArray Uses

type JSONBArray struct {
    Elements   []Text
    Dimensions []ArrayDimension
    Status     Status
}

func (*JSONBArray) AssignTo Uses

func (src *JSONBArray) AssignTo(dst interface{}) error

func (*JSONBArray) DecodeBinary Uses

func (dst *JSONBArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*JSONBArray) DecodeText Uses

func (dst *JSONBArray) DecodeText(ci *ConnInfo, src []byte) error

func (JSONBArray) EncodeBinary Uses

func (src JSONBArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (JSONBArray) EncodeText Uses

func (src JSONBArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (JSONBArray) Get Uses

func (dst JSONBArray) Get() interface{}

func (*JSONBArray) Scan Uses

func (dst *JSONBArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*JSONBArray) Set Uses

func (dst *JSONBArray) Set(src interface{}) error

func (JSONBArray) Value Uses

func (src JSONBArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Line Uses

type Line struct {
    A, B, C float64
    Status  Status
}

func (*Line) AssignTo Uses

func (src *Line) AssignTo(dst interface{}) error

func (*Line) DecodeBinary Uses

func (dst *Line) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Line) DecodeText Uses

func (dst *Line) DecodeText(ci *ConnInfo, src []byte) error

func (Line) EncodeBinary Uses

func (src Line) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Line) EncodeText Uses

func (src Line) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Line) Get Uses

func (dst Line) Get() interface{}

func (*Line) Scan Uses

func (dst *Line) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Line) Set Uses

func (dst *Line) Set(src interface{}) error

func (Line) Value Uses

func (src Line) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Lseg Uses

type Lseg struct {
    P      [2]Vec2
    Status Status
}

func (*Lseg) AssignTo Uses

func (src *Lseg) AssignTo(dst interface{}) error

func (*Lseg) DecodeBinary Uses

func (dst *Lseg) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Lseg) DecodeText Uses

func (dst *Lseg) DecodeText(ci *ConnInfo, src []byte) error

func (Lseg) EncodeBinary Uses

func (src Lseg) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Lseg) EncodeText Uses

func (src Lseg) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Lseg) Get Uses

func (dst Lseg) Get() interface{}

func (*Lseg) Scan Uses

func (dst *Lseg) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Lseg) Set Uses

func (dst *Lseg) Set(src interface{}) error

func (Lseg) Value Uses

func (src Lseg) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Macaddr Uses

type Macaddr struct {
    Addr   net.HardwareAddr
    Status Status
}

func (*Macaddr) AssignTo Uses

func (src *Macaddr) AssignTo(dst interface{}) error

func (*Macaddr) DecodeBinary Uses

func (dst *Macaddr) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Macaddr) DecodeText Uses

func (dst *Macaddr) DecodeText(ci *ConnInfo, src []byte) error

func (Macaddr) EncodeBinary Uses

func (src Macaddr) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

EncodeBinary encodes src into w.

func (Macaddr) EncodeText Uses

func (src Macaddr) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Macaddr) Get Uses

func (dst Macaddr) Get() interface{}

func (*Macaddr) Scan Uses

func (dst *Macaddr) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Macaddr) Set Uses

func (dst *Macaddr) Set(src interface{}) error

func (Macaddr) Value Uses

func (src Macaddr) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type MacaddrArray Uses

type MacaddrArray struct {
    Elements   []Macaddr
    Dimensions []ArrayDimension
    Status     Status
}

func (*MacaddrArray) AssignTo Uses

func (src *MacaddrArray) AssignTo(dst interface{}) error

func (*MacaddrArray) DecodeBinary Uses

func (dst *MacaddrArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*MacaddrArray) DecodeText Uses

func (dst *MacaddrArray) DecodeText(ci *ConnInfo, src []byte) error

func (MacaddrArray) EncodeBinary Uses

func (src MacaddrArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (MacaddrArray) EncodeText Uses

func (src MacaddrArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (MacaddrArray) Get Uses

func (dst MacaddrArray) Get() interface{}

func (*MacaddrArray) Scan Uses

func (dst *MacaddrArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*MacaddrArray) Set Uses

func (dst *MacaddrArray) Set(src interface{}) error

func (MacaddrArray) Value Uses

func (src MacaddrArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Name Uses

type Name Text

Name is a type used for PostgreSQL's special 63-byte name data type, used for identifiers like table names. The pg_class.relname column is a good example of where the name data type is used.

Note that the underlying Go data type of pgx.Name is string, so there is no way to enforce the 63-byte length. Inputting a longer name into PostgreSQL will result in silent truncation to 63 bytes.

Also, if you have custom-compiled PostgreSQL and set NAMEDATALEN to a different value, obviously that number of bytes applies, rather than the default 63.

func (*Name) AssignTo Uses

func (src *Name) AssignTo(dst interface{}) error

func (*Name) DecodeBinary Uses

func (dst *Name) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Name) DecodeText Uses

func (dst *Name) DecodeText(ci *ConnInfo, src []byte) error

func (Name) EncodeBinary Uses

func (src Name) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Name) EncodeText Uses

func (src Name) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Name) Get Uses

func (dst Name) Get() interface{}

func (*Name) Scan Uses

func (dst *Name) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Name) Set Uses

func (dst *Name) Set(src interface{}) error

func (Name) Value Uses

func (src Name) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Numeric Uses

type Numeric struct {
    Int    *big.Int
    Exp    int32
    Status Status
    NaN    bool
}

func (*Numeric) AssignTo Uses

func (src *Numeric) AssignTo(dst interface{}) error

func (*Numeric) DecodeBinary Uses

func (dst *Numeric) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Numeric) DecodeText Uses

func (dst *Numeric) DecodeText(ci *ConnInfo, src []byte) error

func (Numeric) EncodeBinary Uses

func (src Numeric) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Numeric) EncodeText Uses

func (src Numeric) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Numeric) Get Uses

func (dst Numeric) Get() interface{}

func (*Numeric) Scan Uses

func (dst *Numeric) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Numeric) Set Uses

func (dst *Numeric) Set(src interface{}) error

func (Numeric) Value Uses

func (src Numeric) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type NumericArray Uses

type NumericArray struct {
    Elements   []Numeric
    Dimensions []ArrayDimension
    Status     Status
}

func (*NumericArray) AssignTo Uses

func (src *NumericArray) AssignTo(dst interface{}) error

func (*NumericArray) DecodeBinary Uses

func (dst *NumericArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*NumericArray) DecodeText Uses

func (dst *NumericArray) DecodeText(ci *ConnInfo, src []byte) error

func (NumericArray) EncodeBinary Uses

func (src NumericArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (NumericArray) EncodeText Uses

func (src NumericArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (NumericArray) Get Uses

func (dst NumericArray) Get() interface{}

func (*NumericArray) Scan Uses

func (dst *NumericArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*NumericArray) Set Uses

func (dst *NumericArray) Set(src interface{}) error

func (NumericArray) Value Uses

func (src NumericArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Numrange Uses

type Numrange struct {
    Lower     Numeric
    Upper     Numeric
    LowerType BoundType
    UpperType BoundType
    Status    Status
}

func (*Numrange) AssignTo Uses

func (src *Numrange) AssignTo(dst interface{}) error

func (*Numrange) DecodeBinary Uses

func (dst *Numrange) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Numrange) DecodeText Uses

func (dst *Numrange) DecodeText(ci *ConnInfo, src []byte) error

func (Numrange) EncodeBinary Uses

func (src Numrange) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Numrange) EncodeText Uses

func (src Numrange) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Numrange) Get Uses

func (dst Numrange) Get() interface{}

func (*Numrange) Scan Uses

func (dst *Numrange) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Numrange) Set Uses

func (dst *Numrange) Set(src interface{}) error

func (Numrange) Value Uses

func (src Numrange) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type OID Uses

type OID uint32

OID (Object Identifier Type) is, according to https://www.postgresql.org/docs/current/static/datatype-oid.html, used internally by PostgreSQL as a primary key for various system tables. It is currently implemented as an unsigned four-byte integer. Its definition can be found in src/include/postgres_ext.h in the PostgreSQL sources. Because it is so frequently required to be in a NOT NULL condition OID cannot be NULL. To allow for NULL OIDs use OIDValue.

func (*OID) DecodeBinary Uses

func (dst *OID) DecodeBinary(ci *ConnInfo, src []byte) error

func (*OID) DecodeText Uses

func (dst *OID) DecodeText(ci *ConnInfo, src []byte) error

func (OID) EncodeBinary Uses

func (src OID) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (OID) EncodeText Uses

func (src OID) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (*OID) Scan Uses

func (dst *OID) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (OID) Value Uses

func (src OID) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type OIDValue Uses

type OIDValue pguint32

OIDValue (Object Identifier Type) is, according to https://www.postgresql.org/docs/current/static/datatype-OIDValue.html, used internally by PostgreSQL as a primary key for various system tables. It is currently implemented as an unsigned four-byte integer. Its definition can be found in src/include/postgres_ext.h in the PostgreSQL sources.

func (*OIDValue) AssignTo Uses

func (src *OIDValue) AssignTo(dst interface{}) error

AssignTo assigns from src to dst. Note that as OIDValue is not a general number type AssignTo does not do automatic type conversion as other number types do.

func (*OIDValue) DecodeBinary Uses

func (dst *OIDValue) DecodeBinary(ci *ConnInfo, src []byte) error

func (*OIDValue) DecodeText Uses

func (dst *OIDValue) DecodeText(ci *ConnInfo, src []byte) error

func (OIDValue) EncodeBinary Uses

func (src OIDValue) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (OIDValue) EncodeText Uses

func (src OIDValue) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (OIDValue) Get Uses

func (dst OIDValue) Get() interface{}

func (*OIDValue) Scan Uses

func (dst *OIDValue) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*OIDValue) Set Uses

func (dst *OIDValue) Set(src interface{}) error

Set converts from src to dst. Note that as OIDValue is not a general number type Set does not do automatic type conversion as other number types do.

func (OIDValue) Value Uses

func (src OIDValue) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type ParamFormatPreferrer Uses

type ParamFormatPreferrer interface {
    PreferredParamFormat() int16
}

ParamFormatPreferrer allows a type to specify its preferred param format instead of it being inferred from whether it is also a BinaryEncoder.

type Path Uses

type Path struct {
    P      []Vec2
    Closed bool
    Status Status
}

func (*Path) AssignTo Uses

func (src *Path) AssignTo(dst interface{}) error

func (*Path) DecodeBinary Uses

func (dst *Path) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Path) DecodeText Uses

func (dst *Path) DecodeText(ci *ConnInfo, src []byte) error

func (Path) EncodeBinary Uses

func (src Path) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Path) EncodeText Uses

func (src Path) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Path) Get Uses

func (dst Path) Get() interface{}

func (*Path) Scan Uses

func (dst *Path) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Path) Set Uses

func (dst *Path) Set(src interface{}) error

func (Path) Value Uses

func (src Path) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Point Uses

type Point struct {
    P      Vec2
    Status Status
}

func (*Point) AssignTo Uses

func (src *Point) AssignTo(dst interface{}) error

func (*Point) DecodeBinary Uses

func (dst *Point) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Point) DecodeText Uses

func (dst *Point) DecodeText(ci *ConnInfo, src []byte) error

func (Point) EncodeBinary Uses

func (src Point) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Point) EncodeText Uses

func (src Point) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Point) Get Uses

func (dst Point) Get() interface{}

func (*Point) Scan Uses

func (dst *Point) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Point) Set Uses

func (dst *Point) Set(src interface{}) error

func (Point) Value Uses

func (src Point) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Polygon Uses

type Polygon struct {
    P      []Vec2
    Status Status
}

func (*Polygon) AssignTo Uses

func (src *Polygon) AssignTo(dst interface{}) error

func (*Polygon) DecodeBinary Uses

func (dst *Polygon) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Polygon) DecodeText Uses

func (dst *Polygon) DecodeText(ci *ConnInfo, src []byte) error

func (Polygon) EncodeBinary Uses

func (src Polygon) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Polygon) EncodeText Uses

func (src Polygon) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Polygon) Get Uses

func (dst Polygon) Get() interface{}

func (*Polygon) Scan Uses

func (dst *Polygon) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Polygon) Set Uses

func (dst *Polygon) Set(src interface{}) error

func (Polygon) Value Uses

func (src Polygon) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type QChar Uses

type QChar struct {
    Int    int8
    Status Status
}

QChar is for PostgreSQL's special 8-bit-only "char" type more akin to the C language's char type, or Go's byte type. (Note that the name in PostgreSQL itself is "char", in double-quotes, and not char.) It gets used a lot in PostgreSQL's system tables to hold a single ASCII character value (eg pg_class.relkind). It is named Qchar for quoted char to disambiguate from SQL standard type char.

Not all possible values of QChar are representable in the text format. Therefore, QChar does not implement TextEncoder and TextDecoder. In addition, database/sql Scanner and database/sql/driver Value are not implemented.

func (*QChar) AssignTo Uses

func (src *QChar) AssignTo(dst interface{}) error

func (*QChar) DecodeBinary Uses

func (dst *QChar) DecodeBinary(ci *ConnInfo, src []byte) error

func (QChar) EncodeBinary Uses

func (src QChar) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (QChar) Get Uses

func (dst QChar) Get() interface{}

func (*QChar) Set Uses

func (dst *QChar) Set(src interface{}) error

type Record Uses

type Record struct {
    Fields []Value
    Status Status
}

Record is the generic PostgreSQL record type such as is created with the "row" function. Record only implements BinaryEncoder and Value. The text format output format from PostgreSQL does not include type information and is therefore impossible to decode. No encoders are implemented because PostgreSQL does not support input of generic records.

func (*Record) AssignTo Uses

func (src *Record) AssignTo(dst interface{}) error

func (*Record) DecodeBinary Uses

func (dst *Record) DecodeBinary(ci *ConnInfo, src []byte) error

func (Record) Get Uses

func (dst Record) Get() interface{}

func (*Record) Set Uses

func (dst *Record) Set(src interface{}) error

type ResultFormatPreferrer Uses

type ResultFormatPreferrer interface {
    PreferredResultFormat() int16
}

ResultFormatPreferrer allows a type to specify its preferred result format instead of it being inferred from whether it is also a BinaryDecoder.

type ScanPlan Uses

type ScanPlan interface {
    // Scan scans src into dst. If the dst type has changed in an incompatible way a ScanPlan should automatically
    // replan and scan.
    Scan(ci *ConnInfo, oid uint32, formatCode int16, src []byte, dst interface{}) error
}

ScanPlan is a precompiled plan to scan into a type of destination.

type Status Uses

type Status byte
const (
    Undefined Status = iota
    Null
    Present
)

type TID Uses

type TID struct {
    BlockNumber  uint32
    OffsetNumber uint16
    Status       Status
}

TID is PostgreSQL's Tuple Identifier type.

When one does

select ctid, * from some_table;

it is the data type of the ctid hidden system column.

It is currently implemented as a pair unsigned two byte integers. Its conversion functions can be found in src/backend/utils/adt/tid.c in the PostgreSQL sources.

func (*TID) AssignTo Uses

func (src *TID) AssignTo(dst interface{}) error

func (*TID) DecodeBinary Uses

func (dst *TID) DecodeBinary(ci *ConnInfo, src []byte) error

func (*TID) DecodeText Uses

func (dst *TID) DecodeText(ci *ConnInfo, src []byte) error

func (TID) EncodeBinary Uses

func (src TID) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (TID) EncodeText Uses

func (src TID) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (TID) Get Uses

func (dst TID) Get() interface{}

func (*TID) Scan Uses

func (dst *TID) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*TID) Set Uses

func (dst *TID) Set(src interface{}) error

func (TID) Value Uses

func (src TID) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Text Uses

type Text struct {
    String string
    Status Status
}

func (*Text) AssignTo Uses

func (src *Text) AssignTo(dst interface{}) error

func (*Text) DecodeBinary Uses

func (dst *Text) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Text) DecodeText Uses

func (dst *Text) DecodeText(ci *ConnInfo, src []byte) error

func (Text) EncodeBinary Uses

func (src Text) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Text) EncodeText Uses

func (src Text) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Text) Get Uses

func (dst Text) Get() interface{}

func (Text) MarshalJSON Uses

func (src Text) MarshalJSON() ([]byte, error)

func (Text) PreferredParamFormat Uses

func (Text) PreferredParamFormat() int16

func (Text) PreferredResultFormat Uses

func (Text) PreferredResultFormat() int16

func (*Text) Scan Uses

func (dst *Text) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Text) Set Uses

func (dst *Text) Set(src interface{}) error

func (*Text) UnmarshalJSON Uses

func (dst *Text) UnmarshalJSON(b []byte) error

func (Text) Value Uses

func (src Text) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type TextArray Uses

type TextArray struct {
    Elements   []Text
    Dimensions []ArrayDimension
    Status     Status
}

func (*TextArray) AssignTo Uses

func (src *TextArray) AssignTo(dst interface{}) error

func (*TextArray) DecodeBinary Uses

func (dst *TextArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*TextArray) DecodeText Uses

func (dst *TextArray) DecodeText(ci *ConnInfo, src []byte) error

func (TextArray) EncodeBinary Uses

func (src TextArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (TextArray) EncodeText Uses

func (src TextArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (TextArray) Get Uses

func (dst TextArray) Get() interface{}

func (*TextArray) Scan Uses

func (dst *TextArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*TextArray) Set Uses

func (dst *TextArray) Set(src interface{}) error

func (TextArray) Value Uses

func (src TextArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type TextDecoder Uses

type TextDecoder interface {
    // DecodeText decodes src into TextDecoder. If src is nil then the original
    // SQL value is NULL. TextDecoder takes ownership of src. The caller MUST not
    // use it again.
    DecodeText(ci *ConnInfo, src []byte) error
}

type TextEncoder Uses

type TextEncoder interface {
    // EncodeText should append the text format of self to buf. If self is the
    // SQL value NULL then append nothing and return (nil, nil). The caller of
    // EncodeText is responsible for writing the correct NULL value or the
    // length of the data written.
    EncodeText(ci *ConnInfo, buf []byte) (newBuf []byte, err error)
}

TextEncoder is implemented by types that can encode themselves into the PostgreSQL text wire format.

type Time Uses

type Time struct {
    Microseconds int64 // Number of microseconds since midnight
    Status       Status
}

Time represents the PostgreSQL time type. The PostgreSQL time is a time of day without time zone.

Time is represented as the number of microseconds since midnight in the same way that PostgreSQL does. Other time and date types in pgtype can use time.Time as the underlying representation. However, pgtype.Time type cannot due to needing to handle 24:00:00. time.Time converts that to 00:00:00 on the following day.

func (*Time) AssignTo Uses

func (src *Time) AssignTo(dst interface{}) error

func (*Time) DecodeBinary Uses

func (dst *Time) DecodeBinary(ci *ConnInfo, src []byte) error

DecodeBinary decodes from src into dst.

func (*Time) DecodeText Uses

func (dst *Time) DecodeText(ci *ConnInfo, src []byte) error

DecodeText decodes from src into dst.

func (Time) EncodeBinary Uses

func (src Time) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

EncodeBinary writes the binary encoding of src into w. If src.Time is not in the UTC time zone it returns an error.

func (Time) EncodeText Uses

func (src Time) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

EncodeText writes the text encoding of src into w.

func (Time) Get Uses

func (dst Time) Get() interface{}

func (*Time) Scan Uses

func (dst *Time) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Time) Set Uses

func (dst *Time) Set(src interface{}) error

Set converts src into a Time and stores in dst.

func (Time) Value Uses

func (src Time) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Timestamp Uses

type Timestamp struct {
    Time             time.Time // Time must always be in UTC.
    Status           Status
    InfinityModifier InfinityModifier
}

Timestamp represents the PostgreSQL timestamp type. The PostgreSQL timestamp does not have a time zone. This presents a problem when translating to and from time.Time which requires a time zone. It is highly recommended to use timestamptz whenever possible. Timestamp methods either convert to UTC or return an error on non-UTC times.

func (*Timestamp) AssignTo Uses

func (src *Timestamp) AssignTo(dst interface{}) error

func (*Timestamp) DecodeBinary Uses

func (dst *Timestamp) DecodeBinary(ci *ConnInfo, src []byte) error

DecodeBinary decodes from src into dst. The decoded time is considered to be in UTC.

func (*Timestamp) DecodeText Uses

func (dst *Timestamp) DecodeText(ci *ConnInfo, src []byte) error

DecodeText decodes from src into dst. The decoded time is considered to be in UTC.

func (Timestamp) EncodeBinary Uses

func (src Timestamp) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

EncodeBinary writes the binary encoding of src into w. If src.Time is not in the UTC time zone it returns an error.

func (Timestamp) EncodeText Uses

func (src Timestamp) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

EncodeText writes the text encoding of src into w. If src.Time is not in the UTC time zone it returns an error.

func (Timestamp) Get Uses

func (dst Timestamp) Get() interface{}

func (*Timestamp) Scan Uses

func (dst *Timestamp) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Timestamp) Set Uses

func (dst *Timestamp) Set(src interface{}) error

Set converts src into a Timestamp and stores in dst. If src is a time.Time in a non-UTC time zone, the time zone is discarded.

func (Timestamp) Value Uses

func (src Timestamp) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type TimestampArray Uses

type TimestampArray struct {
    Elements   []Timestamp
    Dimensions []ArrayDimension
    Status     Status
}

func (*TimestampArray) AssignTo Uses

func (src *TimestampArray) AssignTo(dst interface{}) error

func (*TimestampArray) DecodeBinary Uses

func (dst *TimestampArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*TimestampArray) DecodeText Uses

func (dst *TimestampArray) DecodeText(ci *ConnInfo, src []byte) error

func (TimestampArray) EncodeBinary Uses

func (src TimestampArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (TimestampArray) EncodeText Uses

func (src TimestampArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (TimestampArray) Get Uses

func (dst TimestampArray) Get() interface{}

func (*TimestampArray) Scan Uses

func (dst *TimestampArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*TimestampArray) Set Uses

func (dst *TimestampArray) Set(src interface{}) error

func (TimestampArray) Value Uses

func (src TimestampArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Timestamptz Uses

type Timestamptz struct {
    Time             time.Time
    Status           Status
    InfinityModifier InfinityModifier
}

func (*Timestamptz) AssignTo Uses

func (src *Timestamptz) AssignTo(dst interface{}) error

func (*Timestamptz) DecodeBinary Uses

func (dst *Timestamptz) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Timestamptz) DecodeText Uses

func (dst *Timestamptz) DecodeText(ci *ConnInfo, src []byte) error

func (Timestamptz) EncodeBinary Uses

func (src Timestamptz) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Timestamptz) EncodeText Uses

func (src Timestamptz) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Timestamptz) Get Uses

func (dst Timestamptz) Get() interface{}

func (Timestamptz) MarshalJSON Uses

func (src Timestamptz) MarshalJSON() ([]byte, error)

func (*Timestamptz) Scan Uses

func (dst *Timestamptz) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Timestamptz) Set Uses

func (dst *Timestamptz) Set(src interface{}) error

func (*Timestamptz) UnmarshalJSON Uses

func (dst *Timestamptz) UnmarshalJSON(b []byte) error

func (Timestamptz) Value Uses

func (src Timestamptz) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type TimestamptzArray Uses

type TimestamptzArray struct {
    Elements   []Timestamptz
    Dimensions []ArrayDimension
    Status     Status
}

func (*TimestamptzArray) AssignTo Uses

func (src *TimestamptzArray) AssignTo(dst interface{}) error

func (*TimestamptzArray) DecodeBinary Uses

func (dst *TimestamptzArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*TimestamptzArray) DecodeText Uses

func (dst *TimestamptzArray) DecodeText(ci *ConnInfo, src []byte) error

func (TimestamptzArray) EncodeBinary Uses

func (src TimestamptzArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (TimestamptzArray) EncodeText Uses

func (src TimestamptzArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (TimestamptzArray) Get Uses

func (dst TimestamptzArray) Get() interface{}

func (*TimestamptzArray) Scan Uses

func (dst *TimestamptzArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*TimestamptzArray) Set Uses

func (dst *TimestamptzArray) Set(src interface{}) error

func (TimestamptzArray) Value Uses

func (src TimestamptzArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Tsrange Uses

type Tsrange struct {
    Lower     Timestamp
    Upper     Timestamp
    LowerType BoundType
    UpperType BoundType
    Status    Status
}

func (*Tsrange) AssignTo Uses

func (src *Tsrange) AssignTo(dst interface{}) error

func (*Tsrange) DecodeBinary Uses

func (dst *Tsrange) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Tsrange) DecodeText Uses

func (dst *Tsrange) DecodeText(ci *ConnInfo, src []byte) error

func (Tsrange) EncodeBinary Uses

func (src Tsrange) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Tsrange) EncodeText Uses

func (src Tsrange) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Tsrange) Get Uses

func (dst Tsrange) Get() interface{}

func (*Tsrange) Scan Uses

func (dst *Tsrange) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Tsrange) Set Uses

func (dst *Tsrange) Set(src interface{}) error

func (Tsrange) Value Uses

func (src Tsrange) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Tstzrange Uses

type Tstzrange struct {
    Lower     Timestamptz
    Upper     Timestamptz
    LowerType BoundType
    UpperType BoundType
    Status    Status
}

func (*Tstzrange) AssignTo Uses

func (src *Tstzrange) AssignTo(dst interface{}) error

func (*Tstzrange) DecodeBinary Uses

func (dst *Tstzrange) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Tstzrange) DecodeText Uses

func (dst *Tstzrange) DecodeText(ci *ConnInfo, src []byte) error

func (Tstzrange) EncodeBinary Uses

func (src Tstzrange) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Tstzrange) EncodeText Uses

func (src Tstzrange) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Tstzrange) Get Uses

func (dst Tstzrange) Get() interface{}

func (*Tstzrange) Scan Uses

func (dst *Tstzrange) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Tstzrange) Set Uses

func (dst *Tstzrange) Set(src interface{}) error

func (Tstzrange) Value Uses

func (src Tstzrange) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type TstzrangeArray Uses

type TstzrangeArray struct {
    Elements   []Tstzrange
    Dimensions []ArrayDimension
    Status     Status
}

func (*TstzrangeArray) AssignTo Uses

func (src *TstzrangeArray) AssignTo(dst interface{}) error

func (*TstzrangeArray) DecodeBinary Uses

func (dst *TstzrangeArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*TstzrangeArray) DecodeText Uses

func (dst *TstzrangeArray) DecodeText(ci *ConnInfo, src []byte) error

func (TstzrangeArray) EncodeBinary Uses

func (src TstzrangeArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (TstzrangeArray) EncodeText Uses

func (src TstzrangeArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (TstzrangeArray) Get Uses

func (dst TstzrangeArray) Get() interface{}

func (*TstzrangeArray) Scan Uses

func (dst *TstzrangeArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*TstzrangeArray) Set Uses

func (dst *TstzrangeArray) Set(src interface{}) error

func (TstzrangeArray) Value Uses

func (src TstzrangeArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type TypeValue Uses

type TypeValue interface {
    Value

    // NewTypeValue creates a TypeValue including references to internal type information. e.g. the list of members
    // in an EnumType.
    NewTypeValue() Value

    // TypeName returns the PostgreSQL name of this type.
    TypeName() string
}

TypeValue is a Value where instances can represent different PostgreSQL types. This can be useful for representing types such as enums, composites, and arrays.

In general, instances of TypeValue should not be used to directly represent a value. It should only be used as an encoder and decoder internal to ConnInfo.

type UUID Uses

type UUID struct {
    Bytes  [16]byte
    Status Status
}

func (*UUID) AssignTo Uses

func (src *UUID) AssignTo(dst interface{}) error

func (*UUID) DecodeBinary Uses

func (dst *UUID) DecodeBinary(ci *ConnInfo, src []byte) error

func (*UUID) DecodeText Uses

func (dst *UUID) DecodeText(ci *ConnInfo, src []byte) error

func (UUID) EncodeBinary Uses

func (src UUID) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (UUID) EncodeText Uses

func (src UUID) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (UUID) Get Uses

func (dst UUID) Get() interface{}

func (*UUID) Scan Uses

func (dst *UUID) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*UUID) Set Uses

func (dst *UUID) Set(src interface{}) error

func (UUID) Value Uses

func (src UUID) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type UUIDArray Uses

type UUIDArray struct {
    Elements   []UUID
    Dimensions []ArrayDimension
    Status     Status
}

func (*UUIDArray) AssignTo Uses

func (src *UUIDArray) AssignTo(dst interface{}) error

func (*UUIDArray) DecodeBinary Uses

func (dst *UUIDArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*UUIDArray) DecodeText Uses

func (dst *UUIDArray) DecodeText(ci *ConnInfo, src []byte) error

func (UUIDArray) EncodeBinary Uses

func (src UUIDArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (UUIDArray) EncodeText Uses

func (src UUIDArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (UUIDArray) Get Uses

func (dst UUIDArray) Get() interface{}

func (*UUIDArray) Scan Uses

func (dst *UUIDArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*UUIDArray) Set Uses

func (dst *UUIDArray) Set(src interface{}) error

func (UUIDArray) Value Uses

func (src UUIDArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Unknown Uses

type Unknown struct {
    String string
    Status Status
}

Unknown represents the PostgreSQL unknown type. It is either a string literal or NULL. It is used when PostgreSQL does not know the type of a value. In general, this will only be used in pgx when selecting a null value without type information. e.g. SELECT NULL;

func (*Unknown) AssignTo Uses

func (src *Unknown) AssignTo(dst interface{}) error

AssignTo assigns from src to dst. Note that as Unknown is not a general number type AssignTo does not do automatic type conversion as other number types do.

func (*Unknown) DecodeBinary Uses

func (dst *Unknown) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Unknown) DecodeText Uses

func (dst *Unknown) DecodeText(ci *ConnInfo, src []byte) error

func (Unknown) Get Uses

func (dst Unknown) Get() interface{}

func (*Unknown) Scan Uses

func (dst *Unknown) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Unknown) Set Uses

func (dst *Unknown) Set(src interface{}) error

func (Unknown) Value Uses

func (src Unknown) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type UntypedBinaryRange Uses

type UntypedBinaryRange struct {
    Lower     []byte
    Upper     []byte
    LowerType BoundType
    UpperType BoundType
}

func ParseUntypedBinaryRange Uses

func ParseUntypedBinaryRange(src []byte) (*UntypedBinaryRange, error)

type UntypedTextArray Uses

type UntypedTextArray struct {
    Elements   []string
    Dimensions []ArrayDimension
}

func ParseUntypedTextArray Uses

func ParseUntypedTextArray(src string) (*UntypedTextArray, error)

type UntypedTextRange Uses

type UntypedTextRange struct {
    Lower     string
    Upper     string
    LowerType BoundType
    UpperType BoundType
}

func ParseUntypedTextRange Uses

func ParseUntypedTextRange(src string) (*UntypedTextRange, error)

type Value Uses

type Value interface {
    // Set converts and assigns src to itself. Value takes ownership of src.
    Set(src interface{}) error

    // Get returns the simplest representation of Value. Get may return a pointer to an internal value but it must never
    // mutate that value. e.g. If Get returns a []byte Value must never change the contents of the []byte.
    Get() interface{}

    // AssignTo converts and assigns the Value to dst. AssignTo may a pointer to an internal value but it must never
    // mutate that value. e.g. If Get returns a []byte Value must never change the contents of the []byte.
    AssignTo(dst interface{}) error
}

Value translates values to and from an internal canonical representation for the type. To actually be usable a type that implements Value should also implement some combination of BinaryDecoder, BinaryEncoder, TextDecoder, and TextEncoder.

Operations that update a Value (e.g. Set, DecodeText, DecodeBinary) should entirely replace the value. e.g. Internal slices should be replaced not resized and reused. This allows Get and AssignTo to return a slice directly rather than incur a usually unnecessary copy.

func NewValue Uses

func NewValue(v Value) Value

NewValue returns a new instance of the same type as v.

type ValueTranscoder Uses

type ValueTranscoder interface {
    Value
    TextEncoder
    BinaryEncoder
    TextDecoder
    BinaryDecoder
}

ValueTranscoder is a value that implements the text and binary encoding and decoding interfaces.

type Varbit Uses

type Varbit struct {
    Bytes  []byte
    Len    int32 // Number of bits
    Status Status
}

func (*Varbit) AssignTo Uses

func (src *Varbit) AssignTo(dst interface{}) error

func (*Varbit) DecodeBinary Uses

func (dst *Varbit) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Varbit) DecodeText Uses

func (dst *Varbit) DecodeText(ci *ConnInfo, src []byte) error

func (Varbit) EncodeBinary Uses

func (src Varbit) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Varbit) EncodeText Uses

func (src Varbit) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Varbit) Get Uses

func (dst Varbit) Get() interface{}

func (*Varbit) Scan Uses

func (dst *Varbit) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Varbit) Set Uses

func (dst *Varbit) Set(src interface{}) error

func (Varbit) Value Uses

func (src Varbit) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Varchar Uses

type Varchar Text

func (*Varchar) AssignTo Uses

func (src *Varchar) AssignTo(dst interface{}) error

AssignTo assigns from src to dst. Note that as Varchar is not a general number type AssignTo does not do automatic type conversion as other number types do.

func (*Varchar) DecodeBinary Uses

func (dst *Varchar) DecodeBinary(ci *ConnInfo, src []byte) error

func (*Varchar) DecodeText Uses

func (dst *Varchar) DecodeText(ci *ConnInfo, src []byte) error

func (Varchar) EncodeBinary Uses

func (src Varchar) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (Varchar) EncodeText Uses

func (src Varchar) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (Varchar) Get Uses

func (dst Varchar) Get() interface{}

func (Varchar) MarshalJSON Uses

func (src Varchar) MarshalJSON() ([]byte, error)

func (Varchar) PreferredParamFormat Uses

func (Varchar) PreferredParamFormat() int16

func (Varchar) PreferredResultFormat Uses

func (Varchar) PreferredResultFormat() int16

func (*Varchar) Scan Uses

func (dst *Varchar) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*Varchar) Set Uses

func (dst *Varchar) Set(src interface{}) error

Set converts from src to dst. Note that as Varchar is not a general number type Set does not do automatic type conversion as other number types do.

func (*Varchar) UnmarshalJSON Uses

func (dst *Varchar) UnmarshalJSON(b []byte) error

func (Varchar) Value Uses

func (src Varchar) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type VarcharArray Uses

type VarcharArray struct {
    Elements   []Varchar
    Dimensions []ArrayDimension
    Status     Status
}

func (*VarcharArray) AssignTo Uses

func (src *VarcharArray) AssignTo(dst interface{}) error

func (*VarcharArray) DecodeBinary Uses

func (dst *VarcharArray) DecodeBinary(ci *ConnInfo, src []byte) error

func (*VarcharArray) DecodeText Uses

func (dst *VarcharArray) DecodeText(ci *ConnInfo, src []byte) error

func (VarcharArray) EncodeBinary Uses

func (src VarcharArray) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (VarcharArray) EncodeText Uses

func (src VarcharArray) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (VarcharArray) Get Uses

func (dst VarcharArray) Get() interface{}

func (*VarcharArray) Scan Uses

func (dst *VarcharArray) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*VarcharArray) Set Uses

func (dst *VarcharArray) Set(src interface{}) error

func (VarcharArray) Value Uses

func (src VarcharArray) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type Vec2 Uses

type Vec2 struct {
    X   float64
    Y   float64
}

type XID Uses

type XID pguint32

XID is PostgreSQL's Transaction ID type.

In later versions of PostgreSQL, it is the type used for the backend_xid and backend_xmin columns of the pg_stat_activity system view.

Also, when one does

select xmin, xmax, * from some_table;

it is the data type of the xmin and xmax hidden system columns.

It is currently implemented as an unsigned four byte integer. Its definition can be found in src/include/postgres_ext.h as TransactionId in the PostgreSQL sources.

func (*XID) AssignTo Uses

func (src *XID) AssignTo(dst interface{}) error

AssignTo assigns from src to dst. Note that as XID is not a general number type AssignTo does not do automatic type conversion as other number types do.

func (*XID) DecodeBinary Uses

func (dst *XID) DecodeBinary(ci *ConnInfo, src []byte) error

func (*XID) DecodeText Uses

func (dst *XID) DecodeText(ci *ConnInfo, src []byte) error

func (XID) EncodeBinary Uses

func (src XID) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error)

func (XID) EncodeText Uses

func (src XID) EncodeText(ci *ConnInfo, buf []byte) ([]byte, error)

func (XID) Get Uses

func (dst XID) Get() interface{}

func (*XID) Scan Uses

func (dst *XID) Scan(src interface{}) error

Scan implements the database/sql Scanner interface.

func (*XID) Set Uses

func (dst *XID) Set(src interface{}) error

Set converts from src to dst. Note that as XID is not a general number type Set does not do automatic type conversion as other number types do.

func (XID) Value Uses

func (src XID) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

Directories

PathSynopsis
ext/gofrs-uuid
ext/shopspring-numeric
pgxtype
testutil
zeronullPackage zeronull contains types that automatically convert between database NULLs and Go zero values.

Package pgtype imports 19 packages (graph) and is imported by 30 packages. Updated 2020-08-11. Refresh now. Tools for package owners.