Documentation ¶
Index ¶
- func CloseConnection() error
- func InitialiseConnection(connectionString string, driver string) error
- type Connector
- type Result
- type Row
- type Rows
- type Transaction
- func (t *Transaction) Commit() error
- func (t *Transaction) Exec(sql string, args ...interface{}) (Result, error)
- func (t *Transaction) QueryRow(sql string, args ...interface{}) (Row, error)
- func (t *Transaction) QueryRows(sql string, args ...interface{}) (Rows, error)
- func (t *Transaction) Rollback() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseConnection ¶
func CloseConnection() error
func InitialiseConnection ¶
Types ¶
type Connector ¶
type Connector interface { QueryRow(sql string, args ...interface{}) (Row, error) QueryRows(sql string, args ...interface{}) (Rows, error) Exec(sql string, args ...interface{}) (Result, error) }
Connector provides an interface for database operations that can be performed during application operation. Returned types such as Row, Rows, and Result provide an abstraction layer over database/sql types, but are compatible with them.
func GetConnection ¶
func GetConnection() Connector
type Transaction ¶ added in v0.2.0
type Transaction struct {
// contains filtered or unexported fields
}
func BeginTransaction ¶ added in v0.2.0
func BeginTransaction() (*Transaction, error)
func (*Transaction) Commit ¶ added in v0.2.0
func (t *Transaction) Commit() error
func (*Transaction) Exec ¶ added in v0.2.0
func (t *Transaction) Exec(sql string, args ...interface{}) (Result, error)
func (*Transaction) QueryRow ¶ added in v0.2.0
func (t *Transaction) QueryRow(sql string, args ...interface{}) (Row, error)
func (*Transaction) QueryRows ¶ added in v0.2.0
func (t *Transaction) QueryRows(sql string, args ...interface{}) (Rows, error)
func (*Transaction) Rollback ¶ added in v0.2.0
func (t *Transaction) Rollback() error
Click to show internal directories.
Click to hide internal directories.