Documentation
¶
Index ¶
- Variables
- func Init(dsnRO, dsnRW string, debug bool) error
- func WithTx(exec boil.Executor, currentTx boil.Transactor, f TxFunc) (err error)
- type QueryLogger
- func (d *QueryLogger) Begin() (boil.Transactor, error)
- func (d *QueryLogger) Close() error
- func (d *QueryLogger) Exec(query string, args ...interface{}) (sql.Result, error)
- func (d *QueryLogger) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (d *QueryLogger) QueryRow(query string, args ...interface{}) *sql.Row
- type TxFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var RO boil.Executor
RO this db can only be used for read-only calls. Calls made that trigger a RW will break replication if successful but also should actually produce an error from mysql.
View Source
var RW boil.Executor
RW this db is used for read-write calls, it can be used for RO calls too but to load balance use the RO please.
Functions ¶
func Init ¶
Init initializes a database connection based on the dsn provided. It also sets it as the global db connection.
Types ¶
type QueryLogger ¶
QueryLogger is used to add extended logging for db queries in debug mode.
func (*QueryLogger) Begin ¶
func (d *QueryLogger) Begin() (boil.Transactor, error)
Begin implementation of Executor
func (*QueryLogger) Exec ¶
func (d *QueryLogger) Exec(query string, args ...interface{}) (sql.Result, error)
Exec implementation of Executor
type TxFunc ¶
type TxFunc func(tx boil.Transactor) error
TxFunc is a function that can be wrapped in a transaction
Click to show internal directories.
Click to hide internal directories.