Documentation
¶
Index ¶
- Variables
- func MustOpen(conn string) db.DB
- func Open(conn string) (db.DB, error)
- type DB
- func (d *DB) BeginTx(ctx context.Context, isolationLevel string, readOnly bool) (db.Tx, error)
- func (d *DB) ConvertParameters(query string, args []interface{}) (outQuery string, outArgs []interface{})
- func (d *DB) DriverName() string
- func (d *DB) ErrGetCode(err error) string
- func (d *DB) ErrNoRows() error
- func (d *DB) Exec(query string, args ...interface{}) (db.Result, error)
- func (d *DB) ExecContext(ctx context.Context, query string, args ...interface{}) (db.Result, error)
- func (d *DB) Query(query string, args ...interface{}) (db.Rows, error)
- func (d *DB) QueryContext(ctx context.Context, query string, args ...interface{}) (db.Rows, error)
- func (d *DB) QueryRow(query string, args ...interface{}) db.Row
- func (d *DB) QueryRowContext(ctx context.Context, query string, args ...interface{}) db.Row
- type Result
- type Tx
- func (t *Tx) Commit(ctx context.Context) error
- func (t *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (db.Result, error)
- func (t *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (db.Rows, error)
- func (t *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) db.Row
- func (t *Tx) Rollback(ctx context.Context) error
- type TypesReader
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // These functions are copied from the go-pg package, so that you don't // have to import "github.com/go-pg/pg/v10/types". TypesScan = types.Scan TypesScanString = types.ScanString TypesScanBytes = types.ScanBytes TypesReadBytes = types.ReadBytes TypesScanInt = types.ScanInt TypesScanInt64 = types.ScanInt64 TypesScanUint64 = types.ScanUint64 TypesScanFloat32 = types.ScanFloat32 TypesScanFloat64 = types.ScanFloat64 TypesScanTime = types.ScanTime TypesScanBool = types.ScanBool )
Functions ¶
Types ¶
type DB ¶
type DB struct {
*pg.DB
}
func (*DB) ConvertParameters ¶
func (d *DB) ConvertParameters(query string, args []interface{}) (outQuery string, outArgs []interface{})
Convert positional parameters (like $1 in "WHERE name = $1") to question marks ("?") used in go-pg.
func (*DB) DriverName ¶ added in v1.2.1
func (*DB) ErrGetCode ¶
func (*DB) ExecContext ¶ added in v1.2.0
func (*DB) QueryContext ¶ added in v1.2.0
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (Result) RowsAffected ¶
type Tx ¶
type Tx struct {
*pg.Tx
}
func (*Tx) ExecContext ¶
func (*Tx) QueryContext ¶
func (*Tx) QueryRowContext ¶
type TypesReader ¶
types.Reader from go-pg package, so that you don't have to import it.
Click to show internal directories.
Click to hide internal directories.