Documentation ¶
Index ¶
- func Array(a interface{}) interface{ ... }
- type ArrayDelimiter
- type BoolArray
- type BytesArray
- type Float64Array
- type HStore
- type Int64Array
- type JSON
- func (j *JSON) Marshal(obj interface{}) error
- func (j JSON) MarshalJSON() ([]byte, error)
- func (j *JSON) Scan(src interface{}) error
- func (j JSON) String() string
- func (j JSON) Unmarshal(dest interface{}) error
- func (j *JSON) UnmarshalJSON(data []byte) error
- func (j JSON) Value() (driver.Value, error)
- type StringArray
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Array ¶
Array returns the optimal driver.Valuer and sql.Scanner for an array or slice of any dimension.
For example:
db.Query(`SELECT * FROM t WHERE id = ANY($1)`, pq.Array([]int{235, 401})) var x []sql.NullInt64 db.QueryRow('SELECT ARRAY[235, 401]').Scan(pq.Array(&x))
Scanning multi-dimensional arrays is not supported. Arrays where the lower bound is not one (such as `[0:0]={1}') are not supported.
Types ¶
type ArrayDelimiter ¶
type ArrayDelimiter interface { // ArrayDelimiter returns the delimiter character(s) for this element's type. ArrayDelimiter() string }
ArrayDelimiter may be optionally implemented by driver.Valuer or sql.Scanner to override the array delimiter used by GenericArray.
type BoolArray ¶
type BoolArray []bool
BoolArray represents a one-dimensional array of the PostgreSQL boolean type.
type BytesArray ¶
type BytesArray [][]byte
BytesArray represents a one-dimensional array of the PostgreSQL bytea type.
func (*BytesArray) Scan ¶
func (a *BytesArray) Scan(src interface{}) error
Scan implements the sql.Scanner interface.
type Float64Array ¶
type Float64Array []float64
Float64Array represents a one-dimensional array of the PostgreSQL double precision type.
func (*Float64Array) Scan ¶
func (a *Float64Array) Scan(src interface{}) error
Scan implements the sql.Scanner interface.
type HStore ¶
type HStore map[string]sql.NullString
HStore is a wrapper for transferring HStore values back and forth easily.
type Int64Array ¶
type Int64Array []int64
func (*Int64Array) Scan ¶
func (a *Int64Array) Scan(src interface{}) error
Scan implements the sql.Scanner interface.
type JSON ¶
type JSON json.RawMessage
JSON is an alias for json.RawMessage, which is a []byte underneath. JSON implements Marshal and Unmarshal.
func (JSON) MarshalJSON ¶
MarshalJSON returns j as the JSON encoding of j.
func (*JSON) UnmarshalJSON ¶
UnmarshalJSON sets *j to a copy of data.
type StringArray ¶
type StringArray []string
StringArray represents a one-dimensional array of the PostgreSQL character types.
func (*StringArray) Scan ¶
func (a *StringArray) Scan(src interface{}) error
Scan implements the sql.Scanner interface.