gosql

package module
v2.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

gosql

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	DB pgxtype.Querier

	// Dest is the interface of the original pointer passed to Select
	Dest interface{}
	// contains filtered or unexported fields
}

func New

func New(db pgxtype.Querier) *Builder

func (*Builder) Args

func (b *Builder) Args() []interface{}

func (*Builder) Except

func (b *Builder) Except(cols ...string) *Builder

func (*Builder) Exec

func (b *Builder) Exec() (pgconn.CommandTag, error)

func (*Builder) From

func (b *Builder) From(qp string) *Builder

func (*Builder) InsertInto added in v2.1.0

func (b *Builder) InsertInto(qp string) *Builder

func (*Builder) Query

func (b *Builder) Query() (*Rows, error)

func (*Builder) QueryRow

func (b *Builder) QueryRow() *Row

func (*Builder) Reset

func (b *Builder) Reset()

func (*Builder) Returning added in v2.1.1

func (b *Builder) Returning(dest interface{}, except ...string) *Builder

func (*Builder) Select

func (b *Builder) Select(dest interface{}) *Builder

func (*Builder) Set

func (b *Builder) Set(src interface{}) *Builder

func (*Builder) String

func (b *Builder) String() string

func (*Builder) Update

func (b *Builder) Update(qp string) *Builder

func (*Builder) Values added in v2.1.0

func (b *Builder) Values(src interface{}) *Builder

func (*Builder) Where

func (b *Builder) Where(qp string, args ...interface{}) *Builder

func (*Builder) Write

func (b *Builder) Write(qp string, args ...interface{}) *Builder

Write writes the query string to the buffer and args to b.args If necessary variable placeholders {?} will be replaced

type Field

type Field struct {
	Column string
	// To avoid the allocation in reflect.Field we only traverse the struct once
	// and then use FieldByIndex to avoid allocations
	Index []int
}

func Cache

func Cache(t interface{}) []Field

Cache expects t to be a pointer to a struct

type Row

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

func (*Row) Scan

func (r *Row) Scan() error

type Rows

type Rows struct {
	pgx.Rows
	// contains filtered or unexported fields
}

func (*Rows) Scan

func (rs *Rows) Scan() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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