pqtype

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 4 Imported by: 46

README

Go Reference go

pqtype

pqtype implements Go types for PostgreSQL types when using the lib/pq driver.

Compatibility

pqtype is tested against PostgreSQL 9.6 through 13 and Go 1.13 through 1.17. While these types may work with other drivers, they are only tested against the lib/pq driver.

History

pqtype is a fork of jackc/pgtype with all the pgx-specific code removed. The Status field on types has been replaced with a Valid boolean to mirror the standard library sql.Null* types.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CIDR

type CIDR Inet

func (*CIDR) Scan

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

func (CIDR) Value added in v0.3.0

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

type Inet

type Inet struct {
	IPNet net.IPNet
	Valid bool
}

Inet represents both inet and cidr PostgreSQL types.

func (*Inet) Scan

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

func (Inet) Value

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

Value implements the database/sql/driver Valuer interface.

type Macaddr

type Macaddr struct {
	Addr  net.HardwareAddr
	Valid bool
}

func (*Macaddr) Scan

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

Scan implements the database/sql Scanner interface.

func (Macaddr) Value

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

Value implements the database/sql/driver Valuer interface.

type NullRawMessage

type NullRawMessage struct {
	RawMessage json.RawMessage
	Valid      bool // Valid is true if RawMessage is not NULL
}

NullRawMessage represents a json.RawMessage that may be null. NullRawMessage implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullRawMessage) Scan

func (n *NullRawMessage) Scan(src interface{}) error

Scan implements the Scanner interface.

func (NullRawMessage) Value

func (n NullRawMessage) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Jump to

Keyboard shortcuts

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