Documentation
¶
Overview ¶
Package cgosqlite is a low-level interface onto SQLite using cgo.
This package is designed to have as few opinions as possible. It wraps the SQLite3 C API with functions that are Go-friendly and are designed to make any feature of the underlying C API usable. That means not unduly heap allocating where C wouldn't.
Users of this package do not need to use any cgo, which means code using cgosqlite can focus on semantic transform of the API, not C<->Go transforms.
Index ¶
- func Open(filename string, flags sqliteh.OpenFlags, vfs string) (sqliteh.DB, error)
- type DB
- func (db *DB) AutoCheckpoint(n int) error
- func (db *DB) BusyTimeout(d time.Duration)
- func (db *DB) Changes() int
- func (db *DB) Checkpoint(dbName string, mode sqliteh.Checkpoint) (int, int, error)
- func (db *DB) Close() error
- func (db *DB) ErrMsg() string
- func (db *DB) ExtendedErrCode() sqliteh.Code
- func (db *DB) Interrupt()
- func (db *DB) LastInsertRowid() int64
- func (db *DB) Prepare(query string, prepFlags sqliteh.PrepareFlags) (stmt sqliteh.Stmt, remainingQuery string, err error)
- func (db *DB) SetWALHook(f func(dbName string, pages int))
- func (db *DB) TotalChanges() int
- func (db *DB) TxnState(schema string) sqliteh.TxnState
- type Stmt
- func (stmt *Stmt) BindBlob64(col int, val []byte) error
- func (stmt *Stmt) BindDouble(col int, val float64) error
- func (stmt *Stmt) BindInt64(col int, val int64) error
- func (stmt *Stmt) BindNull(col int) error
- func (stmt *Stmt) BindParameterCount() int
- func (stmt *Stmt) BindParameterIndex(name string) int
- func (stmt *Stmt) BindParameterIndexSearch(name string) int
- func (stmt *Stmt) BindParameterName(col int) string
- func (stmt *Stmt) BindText64(col int, val string) error
- func (stmt *Stmt) BindZeroBlob64(col int, n uint64) error
- func (stmt *Stmt) ClearBindings() error
- func (stmt *Stmt) ColumnBlob(col int) []byte
- func (stmt *Stmt) ColumnCount() int
- func (stmt *Stmt) ColumnDatabaseName(col int) string
- func (stmt *Stmt) ColumnDeclType(col int) string
- func (stmt *Stmt) ColumnDouble(col int) float64
- func (stmt *Stmt) ColumnInt64(col int) int64
- func (stmt *Stmt) ColumnName(col int) string
- func (stmt *Stmt) ColumnTableName(col int) string
- func (stmt *Stmt) ColumnText(col int) string
- func (stmt *Stmt) ColumnType(col int) sqliteh.ColumnType
- func (stmt *Stmt) DBHandle() sqliteh.DB
- func (stmt *Stmt) ExpandedSQL() string
- func (stmt *Stmt) Finalize() error
- func (stmt *Stmt) Reset() error
- func (stmt *Stmt) ResetAndClear() (time.Duration, error)
- func (stmt *Stmt) SQL() string
- func (stmt *Stmt) StartTimer()
- func (stmt *Stmt) Step(colType []sqliteh.ColumnType) (row bool, err error)
- func (stmt *Stmt) StepResult() (row bool, lastInsertRowID, changes int64, d time.Duration, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB implements sqliteh.DB.
func (*DB) AutoCheckpoint ¶
func (*DB) BusyTimeout ¶
func (*DB) Checkpoint ¶
func (*DB) ExtendedErrCode ¶
func (*DB) LastInsertRowid ¶
func (*DB) SetWALHook ¶
func (*DB) TotalChanges ¶
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
Stmt implements sqliteh.Stmt.
func (*Stmt) BindParameterCount ¶
func (*Stmt) BindParameterIndex ¶
func (*Stmt) BindParameterIndexSearch ¶
func (*Stmt) BindParameterName ¶
func (*Stmt) ClearBindings ¶
func (*Stmt) ColumnBlob ¶
func (*Stmt) ColumnCount ¶
func (*Stmt) ColumnDatabaseName ¶
func (*Stmt) ColumnDeclType ¶
func (*Stmt) ColumnDouble ¶
func (*Stmt) ColumnInt64 ¶
func (*Stmt) ColumnName ¶
func (*Stmt) ColumnTableName ¶
func (*Stmt) ColumnText ¶
func (*Stmt) ColumnType ¶
func (stmt *Stmt) ColumnType(col int) sqliteh.ColumnType
func (*Stmt) ExpandedSQL ¶
func (*Stmt) StartTimer ¶
func (stmt *Stmt) StartTimer()
Click to show internal directories.
Click to hide internal directories.