package
Version:
v0.0.0-...-c39e8e5
Opens a new window with list of versions in this module.
Published: Oct 27, 2022
License: AGPL-3.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 4
Opens a new window with list of known importers.
Documentation
¶
View Source
const (
Psql = "postgres"
Sqlite3 = "sqlite3"
SqliteGo = "sqlite"
)
Driver names.
DestroyTable is a helper for destroying a table.
DestroyTables is a helper for destroying a set of tables.
Error creates a query error if err is not nil.
It returns nil if err is nil
RunTasks runs a series of tasks, and returns error on the first one that
fails.
type DB struct {
*sql.DB
}
DB is a wrapper that extends the sql.DB structure.
OpenPsql opens a postgresql database.
OpenSqlite3 opens a sqlite3 database.
Begin begins a transaction.
Driver returns the driver name when the database is being opened.
Q queries the database with a query string.
func (w DB) Q1(q string, args ...interface{}) *Row
Q1 executes a query string that expects one single row as the return.
X executes a query string.
Row is a result with the row and the query.
Scan scans a row into values.
Rows is a result with the rows and the query.
Close closes the rows result.
func (r *Rows) Scan(dest ...interface{}) error
Scan scans a row into values.
type Tx struct {
*sql.Tx
}
Tx wraps a transaction
Q queries the database with a query string.
func (w Tx) Q1(q string, args ...interface{}) *Row
Q1 executes a query string that expects one single row as the return.
X executes a query string.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.