Documentation ¶
Index ¶
- type DB
- type Driver
- func (d Driver) BoolString(v bool) string
- func (d Driver) EscapeCharacter() string
- func (d Driver) IgnoreConflictSQL(_ *qb.Table, _ []qb.Field) (string, []interface{})
- func (d Driver) LimitOffset(sql qb.SQL, limit, offset int)
- func (d Driver) Override() qb.OverrideMap
- func (d Driver) Returning(b qb.SQLBuilder, q qb.Query, f []qb.Field) (string, []interface{})
- func (d Driver) TypeName(t qb.DataType) string
- func (d Driver) UpsertSQL(_ *qb.Table, _ []qb.Field, _ qb.Query) (string, []interface{})
- func (d Driver) ValueString(c int) string
- type Result
- type Row
- type Rows
- type Stmt
- type Target
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct{}
Driver is a default driver used for tests
func (Driver) BoolString ¶
BoolString returns the notation for boolean values
func (Driver) EscapeCharacter ¶
EscapeCharacter returns the character to escape table and field names
func (Driver) IgnoreConflictSQL ¶
IgnoreConflictSQL implements qb.Driver
func (Driver) LimitOffset ¶
LimitOffset implements qb.Driver
func (Driver) Override ¶
func (d Driver) Override() qb.OverrideMap
Override returns the override map
func (Driver) ValueString ¶
ValueString returns the placeholder for prepare values
type Result ¶
Result is a wrapper for sql.Result that adds MustLastInsertId and MustRowsAffected
func (Result) MustLastInsertId ¶
MustLastInsertId is the same as LastInsertId except if an error occurs returned it will panic
func (Result) MustRowsAffected ¶
MustRowsAffected is the same as RowsAffected except if an error occurs returned it will panic
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
Stmt represents a prepared statement in the database
type Target ¶
type Target interface { Render(qb.Query) (string, []interface{}) Query(qb.SelectQuery) (Rows, error) RawQuery(string, ...interface{}) (Rows, error) MustQuery(qb.SelectQuery) Rows MustRawQuery(string, ...interface{}) Rows QueryRow(qb.SelectQuery) Row RawQueryRow(string, ...interface{}) Row Exec(q qb.Query) (Result, error) RawExec(string, ...interface{}) (Result, error) MustExec(q qb.Query) Result MustRawExec(string, ...interface{}) Result Prepare(qb.Query) (*Stmt, error) MustPrepare(qb.Query) *Stmt Driver() qb.Driver SetDebug(bool) }
Target is a target for a query, either a plain DB or a Tx