Documentation ¶
Index ¶
- Constants
- func EscapeIdentifier(name string) string
- type CommonArg
- type FieldFilter
- type FieldUpdate
- type IConn
- type IQueryable
- type Preparable
- type QC_Exec
- type QC_ExecEx
- type QC_Query
- type QC_QueryEx
- type QC_QueryRow
- type QC_QueryRowEx
- type QueryArg
- type QueryCollection
- func (qc *QueryCollection) AddExec(p Preparable) QC_Exec
- func (qc *QueryCollection) AddExecEx(p Preparable, options *pgx.QueryExOptions) QC_ExecEx
- func (qc *QueryCollection) AddPrepared(p Preparable, name string)
- func (qc *QueryCollection) AddQuery(p Preparable) QC_Query
- func (qc *QueryCollection) AddQueryEx(p Preparable, options *pgx.QueryExOptions) QC_QueryEx
- func (qc *QueryCollection) AddQueryRow(p Preparable) QC_QueryRow
- func (qc *QueryCollection) AddQueryRowEx(p Preparable, options *pgx.QueryExOptions) QC_QueryRowEx
- func (qc *QueryCollection) Init(q IQueryable) error
- type SqlSelect
- type SqlUpdate
Constants ¶
View Source
const AutoName = "i_query_%i"
Variables ¶
This section is empty.
Functions ¶
func EscapeIdentifier ¶
Types ¶
type FieldFilter ¶
func FieldFilterEq ¶
func FieldFilterEq(q QueryArg) FieldFilter
func FieldFilterGe ¶
func FieldFilterGe(q QueryArg) FieldFilter
func FieldFilterGt ¶
func FieldFilterGt(q QueryArg) FieldFilter
func FieldFilterLe ¶
func FieldFilterLe(q QueryArg) FieldFilter
func FieldFilterLt ¶
func FieldFilterLt(q QueryArg) FieldFilter
type FieldUpdate ¶
func FieldUpdateArraySet ¶
func FieldUpdateArraySet(idx QueryArg, nval CommonArg) FieldUpdate
nval = QueryArg|FieldUpdate
func FieldUpdateSet ¶
func FieldUpdateSet(arg QueryArg) FieldUpdate
type IConn ¶
type IConn interface { IQueryable Begin() (*pgx.Tx, error) BeginEx(ctx context.Context, txOptions *pgx.TxOptions) (*pgx.Tx, error) }
Generically allows access to *Conn and *ConnPool
var _ IConn = (*pgx.ConnPool)(nil) var _ IConn = (*pgx.Conn)(nil)
type IQueryable ¶
type IQueryable interface { BeginBatch() *pgx.Batch CopyFrom(tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int, error) CopyFromReader(r io.Reader, sql string) (commandTag pgx.CommandTag, err error) CopyToWriter(w io.Writer, sql string, args ...interface{}) (commandTag pgx.CommandTag, err error) Exec(sql string, arguments ...interface{}) (commandTag pgx.CommandTag, err error) ExecEx(ctx context.Context, sql string, options *pgx.QueryExOptions, arguments ...interface{}) (commandTag pgx.CommandTag, err error) Prepare(name, sql string) (*pgx.PreparedStatement, error) PrepareEx(ctx context.Context, name, sql string, opts *pgx.PrepareExOptions) (*pgx.PreparedStatement, error) Query(sql string, args ...interface{}) (*pgx.Rows, error) QueryEx(ctx context.Context, sql string, options *pgx.QueryExOptions, args ...interface{}) (*pgx.Rows, error) QueryRow(sql string, args ...interface{}) *pgx.Row QueryRowEx(ctx context.Context, sql string, options *pgx.QueryExOptions, args ...interface{}) *pgx.Row }
Generically allows access to *Tx, *Conn and *ConnPool
var _ IQueryable = (*pgx.ConnPool)(nil) var _ IQueryable = (*pgx.Conn)(nil) var _ IQueryable = (*pgx.Tx)(nil)
type Preparable ¶
type Preparable interface {
PrepareWith(q IQueryable, name string) (*pgx.PreparedStatement, error)
}
type QC_Exec ¶
type QC_Exec func(q IQueryable, args ...interface{}) (pgx.CommandTag, error)
type QC_ExecEx ¶
type QC_ExecEx func(q IQueryable, ctx context.Context, args ...interface{}) (pgx.CommandTag, error)
type QC_QueryEx ¶
type QC_QueryRow ¶
type QC_QueryRow func(q IQueryable, args ...interface{}) *pgx.Row
type QC_QueryRowEx ¶
type QC_QueryRowEx func(q IQueryable, ctx context.Context, args ...interface{}) *pgx.Row
type QueryArg ¶
type QueryArg interface { CommonArg // contains filtered or unexported methods }
func NewQueryArg ¶
func NewQueryArgArray ¶
func NewQueryArgRow ¶
func NewQueryArgValue ¶
func NewQueryArgValue(i interface{}) QueryArg
type QueryCollection ¶
type QueryCollection struct {
// contains filtered or unexported fields
}
func (*QueryCollection) AddExec ¶
func (qc *QueryCollection) AddExec(p Preparable) QC_Exec
func (*QueryCollection) AddExecEx ¶
func (qc *QueryCollection) AddExecEx(p Preparable, options *pgx.QueryExOptions) QC_ExecEx
func (*QueryCollection) AddPrepared ¶
func (qc *QueryCollection) AddPrepared(p Preparable, name string)
func (*QueryCollection) AddQuery ¶
func (qc *QueryCollection) AddQuery(p Preparable) QC_Query
func (*QueryCollection) AddQueryEx ¶
func (qc *QueryCollection) AddQueryEx(p Preparable, options *pgx.QueryExOptions) QC_QueryEx
func (*QueryCollection) AddQueryRow ¶
func (qc *QueryCollection) AddQueryRow(p Preparable) QC_QueryRow
func (*QueryCollection) AddQueryRowEx ¶
func (qc *QueryCollection) AddQueryRowEx(p Preparable, options *pgx.QueryExOptions) QC_QueryRowEx
func (*QueryCollection) Init ¶
func (qc *QueryCollection) Init(q IQueryable) error
type SqlSelect ¶
type SqlSelect interface { SetExprs(exprs string) AddExpr(expr string) AddWhere(name string, filter CommonArg) // filter = QueryArg|FieldFilter String() string PrepareWith(q IQueryable, name string) (*pgx.PreparedStatement, error) }
func NewSqlSelect ¶
type SqlUpdate ¶
type SqlUpdate interface { AddUpdate(name string, update CommonArg) // update = QueryArg|FieldUpdate AddWhere(name string, filter CommonArg) // filter = QueryArg|FieldFilter String() string PrepareWith(q IQueryable, name string) (*pgx.PreparedStatement, error) }
func NewSqlUpdate ¶
Click to show internal directories.
Click to hide internal directories.