Versions in this module Expand all Collapse all v0 v0.1.0 Jan 28, 2021 Changes in this version + var ErrCancelled = errors.New("canceling statement due to user request") + type BatchInsertBuilder struct + MaxBatchSize int + Suffix string + Table *Table + func (b *BatchInsertBuilder) Exec() error + func (b *BatchInsertBuilder) Row(row map[string]interface{}) error + func (b *BatchInsertBuilder) RowStruct(row interface{}) error + type Conn interface + ExecContext func(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + GetContext func(ctx context.Context, dest interface{}, query string, args ...interface{}) error + QueryxContext func(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error) + Rebind func(sql string) string + SelectContext func(ctx context.Context, dest interface{}, query string, args ...interface{}) error + type DeleteBuilder struct + Table *Table + func (delb *DeleteBuilder) Exec() (sql.Result, error) + func (delb *DeleteBuilder) Where(pred interface{}, args ...interface{}) *DeleteBuilder + type GetBuilder struct + Table *Table + func (gb *GetBuilder) Exec() error + func (gb *GetBuilder) Offset(offset uint64) *GetBuilder + func (gb *GetBuilder) OrderBy(orderBys ...string) *GetBuilder + func (gb *GetBuilder) Prefix(sql string, args ...interface{}) *GetBuilder + func (gb *GetBuilder) Suffix(sql string, args ...interface{}) *GetBuilder + func (gb *GetBuilder) Where(pred interface{}, args ...interface{}) *GetBuilder + type InsertBuilder struct + Table *Table + func (ib *InsertBuilder) Exec() (sql.Result, error) + func (ib *InsertBuilder) IgnoreCols(cols ...string) *InsertBuilder + func (ib *InsertBuilder) Rows(rows ...interface{}) *InsertBuilder + type MockSession struct + func (m *MockSession) Begin() error + func (m *MockSession) BeginTx(opts *sql.TxOptions) error + func (m *MockSession) Clone() *Session + func (m *MockSession) Close() error + func (m *MockSession) Exec(query squirrel.Sqlizer) (sql.Result, error) + func (m *MockSession) ExecRaw(query string, args ...interface{}) (sql.Result, error) + func (m *MockSession) Get(dest interface{}, query sq.Sqlizer) error + func (m *MockSession) GetRaw(dest interface{}, query string, args ...interface{}) error + func (m *MockSession) GetTable(name string) *Table + func (m *MockSession) NoRows(err error) bool + func (m *MockSession) Rollback() error + func (m *MockSession) Select(dest interface{}, query squirrel.Sqlizer) error + func (m *MockSession) SelectRaw(dest interface{}, query string, args ...interface{}) error + func (m *MockSession) TruncateTables(tables []string) error + type NoRowsError struct + func (err *NoRowsError) Error() string + type SelectBuilder struct + Table *Table + func (sb *SelectBuilder) Exec() error + func (sb *SelectBuilder) Limit(limit uint64) *SelectBuilder + func (sb *SelectBuilder) Offset(offset uint64) *SelectBuilder + func (sb *SelectBuilder) OrderBy(orderBys ...string) *SelectBuilder + func (sb *SelectBuilder) Prefix(sql string, args ...interface{}) *SelectBuilder + func (sb *SelectBuilder) Suffix(sql string, args ...interface{}) *SelectBuilder + func (sb *SelectBuilder) Where(pred interface{}, args ...interface{}) *SelectBuilder + type Session struct + Ctx context.Context + DB *sqlx.DB + func Open(dialect, dsn string) (*Session, error) + func Wrap(base *sql.DB, dialect string) *Session + func (s *Session) Begin() error + func (s *Session) BeginTx(opts *sql.TxOptions) error + func (s *Session) Clone() *Session + func (s *Session) Close() error + func (s *Session) Commit() error + func (s *Session) DeleteRange(start, end int64, table string, idCol string) error + func (s *Session) Dialect() string + func (s *Session) Exec(query sq.Sqlizer) (sql.Result, error) + func (s *Session) ExecAll(script string) error + func (s *Session) ExecRaw(query string, args ...interface{}) (sql.Result, error) + func (s *Session) Get(dest interface{}, query sq.Sqlizer) error + func (s *Session) GetRaw(dest interface{}, query string, args ...interface{}) error + func (s *Session) GetTable(name string) *Table + func (s *Session) GetTx() *sqlx.Tx + func (s *Session) GetTxOptions() *sql.TxOptions + func (s *Session) NoRows(err error) bool + func (s *Session) Query(query sq.Sqlizer) (*sqlx.Rows, error) + func (s *Session) QueryRaw(query string, args ...interface{}) (*sqlx.Rows, error) + func (s *Session) ReplacePlaceholders(query string) (string, error) + func (s *Session) Rollback() error + func (s *Session) Select(dest interface{}, query sq.Sqlizer) error + func (s *Session) SelectRaw(dest interface{}, query string, args ...interface{}) error + func (s *Session) TruncateTables(tables []string) error + type SessionInterface interface + Begin func() error + BeginTx func(opts *sql.TxOptions) error + Clone func() *Session + Close func() error + Exec func(query squirrel.Sqlizer) (sql.Result, error) + ExecRaw func(query string, args ...interface{}) (sql.Result, error) + Get func(dest interface{}, query squirrel.Sqlizer) error + GetRaw func(dest interface{}, query string, args ...interface{}) error + GetTable func(name string) *Table + NoRows func(err error) bool + Rollback func() error + Select func(dest interface{}, query squirrel.Sqlizer) error + SelectRaw func(dest interface{}, query string, args ...interface{}) error + TruncateTables func(tables []string) error + type Table struct + Name string + Session *Session + func (tbl *Table) Delete(pred interface{}, args ...interface{}) *DeleteBuilder + func (tbl *Table) Get(dest interface{}, pred interface{}, args ...interface{}) *GetBuilder + func (tbl *Table) Insert(rows ...interface{}) *InsertBuilder + func (tbl *Table) Select(dest interface{}, pred interface{}, args ...interface{}) *SelectBuilder + func (tbl *Table) Update() *UpdateBuilder + type UpdateBuilder struct + Table *Table + func (ub *UpdateBuilder) Exec() (sql.Result, error) + func (ub *UpdateBuilder) Limit(limit uint64) *UpdateBuilder + func (ub *UpdateBuilder) Offset(offset uint64) *UpdateBuilder + func (ub *UpdateBuilder) OrderBy(orderBys ...string) *UpdateBuilder + func (ub *UpdateBuilder) Prefix(sql string, args ...interface{}) *UpdateBuilder + func (ub *UpdateBuilder) Set(column string, value interface{}) *UpdateBuilder + func (ub *UpdateBuilder) SetMap(clauses map[string]interface{}) *UpdateBuilder + func (ub *UpdateBuilder) SetStruct(s interface{}, ignored []string) *UpdateBuilder + func (ub *UpdateBuilder) Suffix(sql string, args ...interface{}) *UpdateBuilder + func (ub *UpdateBuilder) Where(pred interface{}, args ...interface{}) *UpdateBuilder