util

package
v0.0.0-...-e08bc68 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(wr io.Writer, params qry.Params, v interface{}) error

func QueryContext

func QueryContext(ctx context.Context, dialect qry.Dialect, qc qry.QueryContexter, q interface{}) (qry.Rows, error)

func QueryRowContext

func QueryRowContext(ctx context.Context, dialect qry.Dialect, qc qry.QueryRowContexter, q interface{}) qry.Row

Types

type NameFunc

type NameFunc func(int, interface{}) string

type Params

type Params struct {
	NameFunc        NameFunc
	PlaceholderFunc PlaceholderFunc
	// contains filtered or unexported fields
}

func (*Params) Append

func (ps *Params) Append(v interface{}) (name string)

func (Params) Names

func (ps Params) Names() (names []string)

func (Params) Placeholder

func (ps Params) Placeholder(name string) (placeholder string, ok bool)

func (Params) Value

func (ps Params) Value(name string) (v interface{}, ok bool)

func (Params) Values

func (ps Params) Values() (values []interface{})

type PlaceholderFunc

type PlaceholderFunc func(int, interface{}) string

type Row

type Row struct {
	*sql.Row
	// contains filtered or unexported fields
}

func (Row) Err

func (r Row) Err() error

func (Row) Scan

func (r Row) Scan(dest ...interface{}) error

type Rows

type Rows struct {
	*sql.Rows
}

func (Rows) Scan

func (r Rows) Scan(dest ...interface{}) error

type V

type V = Verbatim

V is a short-hand reference to Verbatim

type Verbatim

type Verbatim string

Verbatim string like a keyword or object name that should be rendered literally

func (Verbatim) MarshalSql

func (v Verbatim) MarshalSql(wr io.Writer, _ qry.Params) error

Jump to

Keyboard shortcuts

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