types

package
v4.9.5 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2016 License: BSD-2-Clause Imports: 11 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(b []byte, v interface{}, quote int) []byte

func AppendField

func AppendField(b []byte, field string, quote int) []byte

func AppendFieldBytes

func AppendFieldBytes(b []byte, field []byte, quote int) []byte

func AppendJSONB

func AppendJSONB(b, jsonb []byte, quote int) []byte

func AppendNull

func AppendNull(b []byte, quote int) []byte

func AppendString

func AppendString(b []byte, s string, quote int) []byte

func AppendStringStringMap

func AppendStringStringMap(b []byte, m map[string]string, quote int) []byte

func AppendTime

func AppendTime(b []byte, tm time.Time, quote int) []byte

func IsSQLScanner added in v4.1.3

func IsSQLScanner(typ reflect.Type) bool

func ParseTime

func ParseTime(b []byte) (time.Time, error)

func Scan

func Scan(v interface{}, b []byte) error

func ScanValue

func ScanValue(v reflect.Value, b []byte) error

Types

type AppenderFunc

type AppenderFunc func([]byte, reflect.Value, int) []byte

func Appender

func Appender(typ reflect.Type) AppenderFunc

func ArrayAppender

func ArrayAppender(typ reflect.Type) AppenderFunc

func HstoreAppender added in v4.6.0

func HstoreAppender(typ reflect.Type) AppenderFunc

type Array

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

func NewArray

func NewArray(vi interface{}) *Array

func (*Array) AppendValue

func (a *Array) AppendValue(b []byte, quote int) ([]byte, error)

func (*Array) Scan

func (a *Array) Scan(b interface{}) error

func (*Array) Value

func (a *Array) Value() interface{}

type F

type F string

F represents a SQL field, e.g. table or column name.

func (F) AppendValue

func (f F) AppendValue(dst []byte, quote int) ([]byte, error)

type Hstore added in v4.6.0

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

func NewHstore added in v4.6.0

func NewHstore(vi interface{}) *Hstore

func (*Hstore) AppendValue added in v4.6.0

func (h *Hstore) AppendValue(b []byte, quote int) ([]byte, error)

func (*Hstore) Scan added in v4.6.0

func (h *Hstore) Scan(b interface{}) error

func (*Hstore) Value added in v4.6.0

func (h *Hstore) Value() interface{}

type InOp added in v4.7.3

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

func In added in v4.7.3

func In(slice interface{}) *InOp

func (*InOp) AppendValue added in v4.7.3

func (in *InOp) AppendValue(b []byte, quote int) ([]byte, error)

type Q

type Q []byte

Q represents safe SQL query.

func (Q) AppendValue

func (q Q) AppendValue(dst []byte, quote int) ([]byte, error)

type Result

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

A Result summarizes an executed SQL command.

func ParseResult

func ParseResult(b []byte) *Result

func (Result) Affected

func (r Result) Affected() int

Affected returns the number of rows affected by SELECT, INSERT, UPDATE, or DELETE queries. It returns -1 when query can't possibly affect any rows, e.g. in case of CREATE or SHOW queries.

type ScannerFunc

type ScannerFunc func(reflect.Value, []byte) error

func ArrayScanner

func ArrayScanner(typ reflect.Type) ScannerFunc

func HstoreScanner added in v4.6.0

func HstoreScanner(typ reflect.Type) ScannerFunc

func Scanner

func Scanner(typ reflect.Type) ScannerFunc

type ValueAppender

type ValueAppender interface {
	AppendValue(b []byte, quote int) ([]byte, error)
}

Jump to

Keyboard shortcuts

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