cgosqlite

package
v0.0.0-...-9328d04 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(filename string, flags sqliteh.OpenFlags, vfs string) (sqliteh.DB, error)

Open implements sqliteh.OpenFunc.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB implements sqliteh.DB.

func (*DB) AutoCheckpoint

func (db *DB) AutoCheckpoint(n int) error

func (*DB) BusyTimeout

func (db *DB) BusyTimeout(d time.Duration)

func (*DB) Changes

func (db *DB) Changes() int

func (*DB) Checkpoint

func (db *DB) Checkpoint(dbName string, mode sqliteh.Checkpoint) (int, int, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) ErrMsg

func (db *DB) ErrMsg() string

func (*DB) ExtendedErrCode

func (db *DB) ExtendedErrCode() sqliteh.Code

func (*DB) Interrupt

func (db *DB) Interrupt()

func (*DB) LastInsertRowid

func (db *DB) LastInsertRowid() int64

func (*DB) Prepare

func (db *DB) Prepare(query string, prepFlags sqliteh.PrepareFlags) (stmt sqliteh.Stmt, remainingQuery string, err error)

func (*DB) SetWALHook

func (db *DB) SetWALHook(f func(dbName string, pages int))

func (*DB) TotalChanges

func (db *DB) TotalChanges() int

func (*DB) TxnState

func (db *DB) TxnState(schema string) sqliteh.TxnState

type Stmt

type Stmt struct {
	// contains filtered or unexported fields
}

Stmt implements sqliteh.Stmt.

func (*Stmt) BindBlob64

func (stmt *Stmt) BindBlob64(col int, val []byte) error

func (*Stmt) BindDouble

func (stmt *Stmt) BindDouble(col int, val float64) error

func (*Stmt) BindInt64

func (stmt *Stmt) BindInt64(col int, val int64) error

func (*Stmt) BindNull

func (stmt *Stmt) BindNull(col int) error

func (*Stmt) BindParameterCount

func (stmt *Stmt) BindParameterCount() int

func (*Stmt) BindParameterIndex

func (stmt *Stmt) BindParameterIndex(name string) int

func (*Stmt) BindParameterIndexSearch

func (stmt *Stmt) BindParameterIndexSearch(name string) int

func (*Stmt) BindParameterName

func (stmt *Stmt) BindParameterName(col int) string

func (*Stmt) BindText64

func (stmt *Stmt) BindText64(col int, val string) error

func (*Stmt) BindZeroBlob64

func (stmt *Stmt) BindZeroBlob64(col int, n uint64) error

func (*Stmt) ClearBindings

func (stmt *Stmt) ClearBindings() error

func (*Stmt) ColumnBlob

func (stmt *Stmt) ColumnBlob(col int) []byte

func (*Stmt) ColumnCount

func (stmt *Stmt) ColumnCount() int

func (*Stmt) ColumnDatabaseName

func (stmt *Stmt) ColumnDatabaseName(col int) string

func (*Stmt) ColumnDeclType

func (stmt *Stmt) ColumnDeclType(col int) string

func (*Stmt) ColumnDouble

func (stmt *Stmt) ColumnDouble(col int) float64

func (*Stmt) ColumnInt64

func (stmt *Stmt) ColumnInt64(col int) int64

func (*Stmt) ColumnName

func (stmt *Stmt) ColumnName(col int) string

func (*Stmt) ColumnTableName

func (stmt *Stmt) ColumnTableName(col int) string

func (*Stmt) ColumnText

func (stmt *Stmt) ColumnText(col int) string

func (*Stmt) ColumnType

func (stmt *Stmt) ColumnType(col int) sqliteh.ColumnType

func (*Stmt) DBHandle

func (stmt *Stmt) DBHandle() sqliteh.DB

func (*Stmt) ExpandedSQL

func (stmt *Stmt) ExpandedSQL() string

func (*Stmt) Finalize

func (stmt *Stmt) Finalize() error

func (*Stmt) Reset

func (stmt *Stmt) Reset() error

func (*Stmt) ResetAndClear

func (stmt *Stmt) ResetAndClear() (time.Duration, error)

func (*Stmt) SQL

func (stmt *Stmt) SQL() string

func (*Stmt) StartTimer

func (stmt *Stmt) StartTimer()

func (*Stmt) Step

func (stmt *Stmt) Step(colType []sqliteh.ColumnType) (row bool, err error)

func (*Stmt) StepResult

func (stmt *Stmt) StepResult() (row bool, lastInsertRowID, changes int64, d time.Duration, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL