package sqlite3

Import Path
	github.com/ncruces/go-sqlite3 (on go.dev)

Dependency Relation
	imports 25 packages, and imported by 3 packages


Code Examples package main import ( "fmt" "log" "github.com/ncruces/go-sqlite3" _ "github.com/ncruces/go-sqlite3/embed" ) const memory = ":memory:" func main() { db, err := sqlite3.Open(memory) if err != nil { log.Fatal(err) } err = db.Exec(`CREATE TABLE users (id INT, name VARCHAR(10))`) if err != nil { log.Fatal(err) } err = db.Exec(`INSERT INTO users (id, name) VALUES (0, 'go'), (1, 'zig'), (2, 'whatever')`) if err != nil { log.Fatal(err) } stmt, _, err := db.Prepare(`SELECT id, name FROM users`) if err != nil { log.Fatal(err) } defer stmt.Close() for stmt.Step() { fmt.Println(stmt.ColumnInt(0), stmt.ColumnText(1)) } if err := stmt.Err(); err != nil { log.Fatal(err) } err = stmt.Close() if err != nil { log.Fatal(err) } err = db.Close() if err != nil { log.Fatal(err) } }
Package-Level Type Names (total 52)
/* sort by: | */
AggregateConstructor is a an [AggregateFunction] constructor. func (*Conn).CreateWindowFunction(name string, nArg int, flag FunctionFlag, fn AggregateConstructor) error
AggregateFunction is the interface an aggregate function should implement. https://sqlite.org/appfunc.html Step is invoked to add a row to the current window. The function arguments, if any, corresponding to the row being added, are passed to Step. Implementations must not retain arg. Value is invoked to return the current (or final) value of the aggregate. WindowFunction (interface)
AggregateSeqFunction is the type of an aggregate SQL function. Implementations must not retain the slices yielded by seq. func (*Conn).CreateAggregateFunction(name string, nArg int, flag FunctionFlag, fn AggregateSeqFunction) error
AuthorizerReturnCode are the integer codes that the authorizer callback may return. https://sqlite.org/c3ref/c_deny.html const AUTH_DENY const AUTH_IGNORE const AUTH_OK
Backup is an handle to an ongoing online backup operation. https://sqlite.org/c3ref/backup.html Close finishes a backup operation. It is safe to close a nil, zero or closed Backup. https://sqlite.org/c3ref/backup_finish.html#sqlite3backupfinish PageCount returns the total number of pages in the source database at the conclusion of the most recent [Backup.Step]. https://sqlite.org/c3ref/backup_finish.html#sqlite3backuppagecount Remaining returns the number of pages still to be backed up at the conclusion of the most recent [Backup.Step]. https://sqlite.org/c3ref/backup_finish.html#sqlite3backupremaining Step copies up to nPage pages between the source and destination databases. If nPage is negative, all remaining source pages are copied. https://sqlite.org/c3ref/backup_finish.html#sqlite3backupstep *Backup : github.com/prometheus/common/expfmt.Closer *Backup : io.Closer func (*Conn).BackupInit(srcDB, dstURI string) (*Backup, error)
Blob is an handle to an open BLOB. It implements [io.ReadWriteSeeker] for incremental BLOB I/O. https://sqlite.org/c3ref/blob.html Close closes a BLOB handle. It is safe to close a nil, zero or closed Blob. https://sqlite.org/c3ref/blob_close.html Read implements the [io.Reader] interface. https://sqlite.org/c3ref/blob_read.html ReadFrom implements the [io.ReaderFrom] interface. https://sqlite.org/c3ref/blob_write.html Reopen moves a BLOB handle to a new row of the same database table. https://sqlite.org/c3ref/blob_reopen.html Seek implements the [io.Seeker] interface. Size returns the size of the BLOB in bytes. https://sqlite.org/c3ref/blob_bytes.html Write implements the [io.Writer] interface. https://sqlite.org/c3ref/blob_write.html WriteTo implements the [io.WriterTo] interface. https://sqlite.org/c3ref/blob_read.html *Blob : github.com/gobwas/ws.HandshakeHeader *Blob : github.com/miekg/dns.Writer *Blob : github.com/pion/stun.Connection *Blob : github.com/pion/stun/v3.Connection *Blob : github.com/prometheus/common/expfmt.Closer *Blob : internal/bisect.Writer *Blob : io.Closer *Blob : io.ReadCloser *Blob : io.Reader *Blob : io.ReaderFrom *Blob : io.ReadSeekCloser *Blob : io.ReadSeeker *Blob : io.ReadWriteCloser *Blob : io.ReadWriter *Blob : io.ReadWriteSeeker *Blob : io.Seeker *Blob : io.WriteCloser *Blob : io.Writer *Blob : io.WriterTo *Blob : io.WriteSeeker func (*Conn).OpenBlob(db, table, column string, row int64, write bool) (*Blob, error)
CheckpointMode are all the checkpoint mode values. https://sqlite.org/c3ref/c_checkpoint_full.html func (*Conn).WALCheckpoint(schema string, mode CheckpointMode) (nLog, nCkpt int, err error) const CHECKPOINT_FULL const CHECKPOINT_PASSIVE const CHECKPOINT_RESTART const CHECKPOINT_TRUNCATE
CollatingFunction is the type of a collation callback. Implementations must not retain a or b. func (*Conn).CreateCollation(name string, fn CollatingFunction) error
Conn is a database connection handle. A Conn is not safe for concurrent use by multiple goroutines. https://sqlite.org/c3ref/sqlite3.html AnyCollationNeeded uses [Conn.CollationNeeded] to register a fake collating function for any unknown collating sequence. The fake collating function works like BINARY. This can be used to load schemas that contain one or more unknown collating sequences. AutoVacuumPages registers a autovacuum compaction amount callback. https://sqlite.org/c3ref/autovacuum_pages.html Backup backs up srcDB on the src connection to the "main" database in dstURI. Backup opens the SQLite database file dstURI, and blocks until the entire backup is complete. Use [Conn.BackupInit] for incremental backup. https://sqlite.org/backup.html BackupInit initializes a backup operation to copy the content of one database into another. BackupInit opens the SQLite database file dstURI, then initializes a backup that copies the contents of srcDB on the src connection to the "main" database in dstURI. https://sqlite.org/c3ref/backup_finish.html#sqlite3backupinit Begin starts a deferred transaction. It panics if a transaction is in-progress. For nested transactions, use [Conn.Savepoint]. https://sqlite.org/lang_transaction.html BeginConcurrent starts a concurrent transaction. Experimental: requires a custom build of SQLite. https://sqlite.org/cgi/src/doc/begin-concurrent/doc/begin_concurrent.md BeginExclusive starts an exclusive transaction. https://sqlite.org/lang_transaction.html BeginImmediate starts an immediate transaction. https://sqlite.org/lang_transaction.html BusyHandler registers a callback to handle [BUSY] errors. https://sqlite.org/c3ref/busy_handler.html BusyTimeout sets a busy timeout. https://sqlite.org/c3ref/busy_timeout.html CacheFlush flushes caches to disk mid-transaction. https://sqlite.org/c3ref/db_cacheflush.html Changes returns the number of rows modified, inserted or deleted by the most recently completed INSERT, UPDATE or DELETE statement on the database connection. https://sqlite.org/c3ref/changes.html Close closes the database connection. If the database connection is associated with unfinalized prepared statements, open blob handles, and/or unfinished backup objects, Close will leave the database connection open and return [BUSY]. It is safe to close a nil, zero or closed Conn. https://sqlite.org/c3ref/close.html CollationNeeded registers a callback to be invoked whenever an unknown collation sequence is required. https://sqlite.org/c3ref/collation_needed.html CommitHook registers a callback function to be invoked whenever a transaction is committed. Return true to allow the commit operation to continue normally. https://sqlite.org/c3ref/commit_hook.html Config makes configuration changes to a database connection. Only boolean configuration options are supported. Called with no arg reads the current configuration value, called with one arg sets and returns the new value. https://sqlite.org/c3ref/db_config.html ConfigLog sets up the error logging callback for the connection. https://sqlite.org/errlog.html CreateAggregateFunction defines a new aggregate SQL function. https://sqlite.org/c3ref/create_function.html CreateCollation defines a new collating sequence. https://sqlite.org/c3ref/create_collation.html CreateFunction defines a new scalar SQL function. https://sqlite.org/c3ref/create_function.html CreateWindowFunction defines a new aggregate or aggregate window SQL function. If fn returns a [WindowFunction], an aggregate window function is created. If fn returns an [io.Closer], it will be called to free resources. https://sqlite.org/c3ref/create_function.html DBName returns the schema name for n-th database on the database connection. https://sqlite.org/c3ref/db_name.html DeclareVTab declares the schema of a virtual table. https://sqlite.org/c3ref/declare_vtab.html EnableChecksums enables checksums on a database. https://sqlite.org/cksumvfs.html Exec is a convenience function that allows an application to run multiple statements of SQL without having to use a lot of code. https://sqlite.org/c3ref/exec.html FileControl allows low-level control of database files. Only a subset of opcodes are supported. https://sqlite.org/c3ref/file_control.html Filename returns the filename for a database. https://sqlite.org/c3ref/db_filename.html GetAutocommit tests the connection for auto-commit mode. https://sqlite.org/c3ref/get_autocommit.html GetInterrupt gets the context set with [Conn.SetInterrupt]. HardHeapLimit imposes a hard limit on heap size. https://sqlite.org/c3ref/hard_heap_limit64.html LastInsertRowID returns the rowid of the most recent successful INSERT on the database connection. https://sqlite.org/c3ref/last_insert_rowid.html Limit allows the size of various constructs to be limited on a connection by connection basis. https://sqlite.org/c3ref/limit.html Log writes a message into the error log established by [Conn.ConfigLog]. https://sqlite.org/c3ref/log.html OpenBlob opens a BLOB for incremental I/O. https://sqlite.org/c3ref/blob_open.html OverloadFunction overloads a function for a virtual table. https://sqlite.org/c3ref/overload_function.html Prepare calls [Conn.PrepareFlags] with no flags. PrepareFlags compiles the first SQL statement in sql; tail is left pointing to what remains uncompiled. If the input text contains no SQL (if the input is an empty string or a comment), both stmt and err will be nil. https://sqlite.org/c3ref/prepare.html ReadOnly determines if a database is read-only. https://sqlite.org/c3ref/db_readonly.html ReleaseMemory frees memory used by a database connection. https://sqlite.org/c3ref/db_release_memory.html Restore restores dstDB on the dst connection from the "main" database in srcURI. Restore opens the SQLite database file srcURI, and blocks until the entire restore is complete. https://sqlite.org/backup.html RollbackHook registers a callback function to be invoked whenever a transaction is rolled back. https://sqlite.org/c3ref/commit_hook.html Savepoint establishes a new transaction savepoint. https://sqlite.org/lang_savepoint.html SetAuthorizer registers an authorizer callback with the database connection. https://sqlite.org/c3ref/set_authorizer.html SetInterrupt interrupts a long-running query when a context is done. Subsequent uses of the connection will return [INTERRUPT] until the context is reset by another call to SetInterrupt. To associate a timeout with a connection: ctx, cancel := context.WithTimeout(context.TODO(), 100*time.Millisecond) conn.SetInterrupt(ctx) defer cancel() SetInterrupt returns the old context assigned to the connection. https://sqlite.org/c3ref/interrupt.html SetLastInsertRowID allows the application to set the value returned by [Conn.LastInsertRowID]. https://sqlite.org/c3ref/set_last_insert_rowid.html SoftHeapLimit imposes a soft limit on heap size. https://sqlite.org/c3ref/hard_heap_limit64.html Status retrieves runtime status information about a database connection. https://sqlite.org/c3ref/db_status.html Stmts returns an iterator for the prepared statements associated with the database connection. https://sqlite.org/c3ref/next_stmt.html TableColumnMetadata extracts metadata about a column of a table. https://sqlite.org/c3ref/table_column_metadata.html TotalChanges returns the number of rows modified, inserted or deleted by all INSERT, UPDATE or DELETE statements completed since the database connection was opened. https://sqlite.org/c3ref/total_changes.html Trace registers a trace callback function against the database connection. https://sqlite.org/c3ref/trace_v2.html TxnState determines the transaction state of a database. https://sqlite.org/c3ref/txn_state.html UpdateHook registers a callback function to be invoked whenever a row is updated, inserted or deleted in a rowid table. https://sqlite.org/c3ref/update_hook.html VTabConfig configures various facets of the virtual table interface. https://sqlite.org/c3ref/vtab_config.html VTabOnConflict determines the virtual table conflict policy. https://sqlite.org/c3ref/vtab_on_conflict.html WALAutoCheckpoint configures WAL auto-checkpoints. https://sqlite.org/c3ref/wal_autocheckpoint.html WALCheckpoint checkpoints a WAL database. https://sqlite.org/c3ref/wal_checkpoint_v2.html WALHook registers a callback function to be invoked each time data is committed to a database in WAL mode. https://sqlite.org/c3ref/wal_hook.html *Conn : github.com/prometheus/common/expfmt.Closer *Conn : io.Closer func Open(filename string) (*Conn, error) func OpenContext(ctx context.Context, filename string) (*Conn, error) func OpenFlags(filename string, flags OpenFlag) (*Conn, error) func Context.Conn() *Conn func (*Stmt).Conn() *Conn func github.com/ncruces/go-sqlite3/driver.Conn.Raw() *Conn func CreateModule[T](db *Conn, name string, create, connect VTabConstructor[T]) error
Context is the context in which an SQL function executes. An SQLite [Context] is in no way related to a Go [context.Context]. https://sqlite.org/c3ref/context.html Conn returns the database connection of the [Conn.CreateFunction] or [Conn.CreateWindowFunction] routines that originally registered the application defined function. https://sqlite.org/c3ref/context_db_handle.html GetAuxData returns metadata for argument n of the function. https://sqlite.org/c3ref/get_auxdata.html ResultBlob sets the result of the function to a []byte. https://sqlite.org/c3ref/result_blob.html ResultBool sets the result of the function to a bool. SQLite does not have a separate boolean storage class. Instead, boolean values are stored as integers 0 (false) and 1 (true). https://sqlite.org/c3ref/result_blob.html ResultError sets the result of the function an error. https://sqlite.org/c3ref/result_blob.html ResultFloat sets the result of the function to a float64. https://sqlite.org/c3ref/result_blob.html ResultInt sets the result of the function to an int. https://sqlite.org/c3ref/result_blob.html ResultInt64 sets the result of the function to an int64. https://sqlite.org/c3ref/result_blob.html ResultJSON sets the result of the function to the JSON encoding of value. https://sqlite.org/c3ref/result_blob.html ResultNull sets the result of the function to NULL. https://sqlite.org/c3ref/result_blob.html ResultPointer sets the result of the function to NULL, just like [Context.ResultNull], except that it also associates ptr with that NULL value such that it can be retrieved within an application-defined SQL function using [Value.Pointer]. https://sqlite.org/c3ref/result_blob.html ResultRawText sets the text result of the function to a []byte. https://sqlite.org/c3ref/result_blob.html ResultSubtype sets the subtype of the result of the function. https://sqlite.org/c3ref/result_subtype.html ResultText sets the result of the function to a string. https://sqlite.org/c3ref/result_blob.html ResultTime sets the result of the function to a [time.Time]. https://sqlite.org/c3ref/result_blob.html ResultValue sets the result of the function to a copy of [Value]. https://sqlite.org/c3ref/result_blob.html ResultZeroBlob sets the result of the function to a zero-filled, length n BLOB. https://sqlite.org/c3ref/result_blob.html SetAuxData saves metadata for argument n of the function. https://sqlite.org/c3ref/get_auxdata.html VTabNoChange may return true if a column is being fetched as part of an update during which the column value will not change. https://sqlite.org/c3ref/vtab_nochange.html func AggregateFunction.Step(ctx Context, arg ...Value) func AggregateFunction.Value(ctx Context) func VTabCursor.Column(ctx Context, n int) error func WindowFunction.Inverse(ctx Context, arg ...Value) func WindowFunction.Step(ctx Context, arg ...Value) func WindowFunction.Value(ctx Context)
Datatype is a fundamental datatype of SQLite. https://sqlite.org/c3ref/c_blob.html String implements the [fmt.Stringer] interface. Datatype : expvar.Var Datatype : fmt.Stringer func (*Stmt).ColumnType(col int) Datatype func Value.NumericType() Datatype func Value.Type() Datatype const BLOB const FLOAT const INTEGER const NULL const TEXT
DBStatus are the available "verbs" that can be passed to the [Conn.Status] method. https://sqlite.org/c3ref/c_dbstatus_options.html func (*Conn).Status(op DBStatus, reset bool) (current, highwater int, err error) const DBSTATUS_CACHE_HIT const DBSTATUS_CACHE_MISS const DBSTATUS_CACHE_SPILL const DBSTATUS_CACHE_USED const DBSTATUS_CACHE_USED_SHARED const DBSTATUS_CACHE_WRITE const DBSTATUS_DEFERRED_FKS const DBSTATUS_LOOKASIDE_HIT const DBSTATUS_LOOKASIDE_MISS_FULL const DBSTATUS_LOOKASIDE_MISS_SIZE const DBSTATUS_LOOKASIDE_USED const DBSTATUS_SCHEMA_USED const DBSTATUS_STMT_USED
Error wraps an SQLite Error Code. https://sqlite.org/c3ref/errcode.html As converts this error to an [ErrorCode] or [ExtendedErrorCode]. Code returns the primary error code for this error. https://sqlite.org/rescode.html Error implements the error interface. ExtendedCode returns the extended error code for this error. https://sqlite.org/rescode.html Is tests whether this error matches a given [ErrorCode] or [ExtendedErrorCode]. It makes it possible to do: if errors.Is(err, sqlite3.BUSY) { // ... handle BUSY } SQL returns the SQL starting at the token that triggered a syntax error. Temporary returns true for [BUSY] errors. Timeout returns true for [BUSY_TIMEOUT] errors. *Error : github.com/jbenet/go-temp-err-catcher.Temporary *Error : error *Error : net.Error
ErrorCode is a result code that [Error.Code] might return. https://sqlite.org/rescode.html Error implements the error interface. ExtendedCode returns the extended error code for this error. Temporary returns true for [BUSY] errors. ErrorCode : github.com/jbenet/go-temp-err-catcher.Temporary ErrorCode : error func (*Error).Code() ErrorCode func ExtendedErrorCode.Code() ErrorCode const ABORT const AUTH const BUSY const CANTOPEN const CONSTRAINT const CORRUPT const EMPTY const ERROR const FORMAT const FULL const INTERNAL const INTERRUPT const IOERR const LOCKED const MISMATCH const MISUSE const NOLFS const NOMEM const NOTADB const NOTFOUND const NOTICE const PERM const PROTOCOL const RANGE const READONLY const SCHEMA const TOOBIG const WARNING
ExtendedErrorCode is a result code that [Error.ExtendedCode] might return. https://sqlite.org/rescode.html As converts this error to an [ErrorCode]. Code returns the primary error code for this error. Error implements the error interface. Is tests whether this error matches a given [ErrorCode]. Temporary returns true for [BUSY] errors. Timeout returns true for [BUSY_TIMEOUT] errors. ExtendedErrorCode : github.com/jbenet/go-temp-err-catcher.Temporary ExtendedErrorCode : error ExtendedErrorCode : net.Error func (*Error).ExtendedCode() ExtendedErrorCode func ErrorCode.ExtendedCode() ExtendedErrorCode func (*Conn).Log(code ExtendedErrorCode, format string, a ...any) const ABORT_ROLLBACK const AUTH_USER const BUSY_RECOVERY const BUSY_SNAPSHOT const BUSY_TIMEOUT const CANTOPEN_CONVPATH const CANTOPEN_FULLPATH const CANTOPEN_ISDIR const CANTOPEN_NOTEMPDIR const CANTOPEN_SYMLINK const CONSTRAINT_CHECK const CONSTRAINT_COMMITHOOK const CONSTRAINT_DATATYPE const CONSTRAINT_FOREIGNKEY const CONSTRAINT_FUNCTION const CONSTRAINT_NOTNULL const CONSTRAINT_PINNED const CONSTRAINT_PRIMARYKEY const CONSTRAINT_ROWID const CONSTRAINT_TRIGGER const CONSTRAINT_UNIQUE const CONSTRAINT_VTAB const CORRUPT_INDEX const CORRUPT_SEQUENCE const CORRUPT_VTAB const ERROR_MISSING_COLLSEQ const ERROR_RETRY const ERROR_SNAPSHOT const IOERR_ACCESS const IOERR_AUTH const IOERR_BEGIN_ATOMIC const IOERR_BLOCKED const IOERR_CHECKRESERVEDLOCK const IOERR_CLOSE const IOERR_COMMIT_ATOMIC const IOERR_CONVPATH const IOERR_CORRUPTFS const IOERR_DATA const IOERR_DELETE const IOERR_DELETE_NOENT const IOERR_DIR_CLOSE const IOERR_DIR_FSYNC const IOERR_FSTAT const IOERR_FSYNC const IOERR_GETTEMPPATH const IOERR_IN_PAGE const IOERR_LOCK const IOERR_MMAP const IOERR_NOMEM const IOERR_RDLOCK const IOERR_READ const IOERR_ROLLBACK_ATOMIC const IOERR_SEEK const IOERR_SHMLOCK const IOERR_SHMMAP const IOERR_SHMOPEN const IOERR_SHMSIZE const IOERR_SHORT_READ const IOERR_TRUNCATE const IOERR_UNLOCK const IOERR_VNODE const IOERR_WRITE const LOCKED_SHAREDCACHE const LOCKED_VTAB const NOTICE_RBU const NOTICE_RECOVER_ROLLBACK const NOTICE_RECOVER_WAL const READONLY_CANTINIT const READONLY_CANTLOCK const READONLY_DBMOVED const READONLY_DIRECTORY const READONLY_RECOVERY const READONLY_ROLLBACK const WARNING_AUTOINDEX
FcntlOpcode are the available opcodes for [Conn.FileControl]. https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html func (*Conn).FileControl(schema string, op FcntlOpcode, arg ...any) (any, error) const FCNTL_CHUNK_SIZE const FCNTL_DATA_VERSION const FCNTL_FILE_POINTER const FCNTL_JOURNAL_POINTER const FCNTL_LOCKSTATE const FCNTL_NULL_IO const FCNTL_PERSIST_WAL const FCNTL_POWERSAFE_OVERWRITE const FCNTL_RESERVE_BYTES const FCNTL_RESET_CACHE const FCNTL_VFS_POINTER
FunctionFlag is a flag that can be passed to [Conn.CreateFunction] and [Conn.CreateWindowFunction]. https://sqlite.org/c3ref/c_deterministic.html func (*Conn).CreateAggregateFunction(name string, nArg int, flag FunctionFlag, fn AggregateSeqFunction) error func (*Conn).CreateFunction(name string, nArg int, flag FunctionFlag, fn ScalarFunction) error func (*Conn).CreateWindowFunction(name string, nArg int, flag FunctionFlag, fn AggregateConstructor) error const DETERMINISTIC const DIRECTONLY const INNOCUOUS const RESULT_SUBTYPE const SELFORDER1 const SUBTYPE
An IndexConstraint describes virtual table indexing constraint information. https://sqlite.org/c3ref/index_info.html Column int Op IndexConstraintOp Usable bool
An IndexConstraintUsage describes how virtual table indexing constraints will be used. https://sqlite.org/c3ref/index_info.html ArgvIndex int Omit bool
An IndexInfo describes virtual table indexing information. https://sqlite.org/c3ref/index_info.html ColumnsUsed uint64 Inputs Outputs EstimatedCost float64 EstimatedRows int64 IdxFlags IndexScanFlag IdxNum int IdxStr string OrderBy []IndexOrderBy OrderByConsumed bool Collation returns the name of the collation for a virtual table constraint. https://sqlite.org/c3ref/vtab_collation.html Distinct determines if a virtual table query is DISTINCT. https://sqlite.org/c3ref/vtab_distinct.html In identifies and handles IN constraints. https://sqlite.org/c3ref/vtab_in.html RHSValue returns the value of the right-hand operand of a constraint if the right-hand operand is known. https://sqlite.org/c3ref/vtab_rhs_value.html func VTab.BestIndex(*IndexInfo) error func VTabChecker.BestIndex(*IndexInfo) error func VTabDestroyer.BestIndex(*IndexInfo) error func VTabOverloader.BestIndex(*IndexInfo) error func VTabRenamer.BestIndex(*IndexInfo) error func VTabSavepointer.BestIndex(*IndexInfo) error func VTabShadowTabler.BestIndex(*IndexInfo) error func VTabTxn.BestIndex(*IndexInfo) error func VTabUpdater.BestIndex(*IndexInfo) error
An IndexOrderBy describes virtual table indexing order by information. https://sqlite.org/c3ref/index_info.html Column int Desc bool
IndexScanFlag is a virtual table scan flag. https://sqlite.org/c3ref/c_index_scan_unique.html const INDEX_SCAN_UNIQUE
LimitCategory are the available run-time limit categories. https://sqlite.org/c3ref/c_limit_attached.html func (*Conn).Limit(id LimitCategory, value int) int const LIMIT_ATTACHED const LIMIT_COLUMN const LIMIT_COMPOUND_SELECT const LIMIT_EXPR_DEPTH const LIMIT_FUNCTION_ARG const LIMIT_LENGTH const LIMIT_LIKE_PATTERN_LENGTH const LIMIT_SQL_LENGTH const LIMIT_TRIGGER_DEPTH const LIMIT_VARIABLE_NUMBER const LIMIT_VDBE_OP const LIMIT_WORKER_THREADS
OpenFlag is a flag for the [OpenFlags] function. https://sqlite.org/c3ref/c_open_autoproxy.html func OpenFlags(filename string, flags OpenFlag) (*Conn, error) const OPEN_CREATE const OPEN_EXRESCODE const OPEN_FULLMUTEX const OPEN_MEMORY const OPEN_NOFOLLOW const OPEN_NOMUTEX const OPEN_PRIVATECACHE const OPEN_READONLY const OPEN_READWRITE const OPEN_SHAREDCACHE const OPEN_URI
PrepareFlag is a flag that can be passed to [Conn.PrepareFlags]. https://sqlite.org/c3ref/c_prepare_normalize.html func (*Conn).PrepareFlags(sql string, flags PrepareFlag) (stmt *Stmt, tail string, err error) const PREPARE_DONT_LOG const PREPARE_NO_VTAB const PREPARE_NORMALIZE const PREPARE_PERSISTENT
Savepoint is a marker within a transaction that allows for partial rollback. https://sqlite.org/lang_savepoint.html Release releases the savepoint rolling back any changes if *error points to a non-nil error. This is meant to be deferred: func doWork(db *sqlite3.Conn) (err error) { savept := db.Savepoint() defer savept.Release(&err) // ... do work in the transaction } Rollback rolls the transaction back to the savepoint, even if the connection has been interrupted. Rollback does not release the savepoint. https://sqlite.org/lang_transaction.html func (*Conn).Savepoint() Savepoint func github.com/ncruces/go-sqlite3/driver.Savepoint(tx *sql.Tx) Savepoint
ScalarFunction is the type of a scalar SQL function. Implementations must not retain arg. func VTabOverloader.FindFunction(arg int, name string) (ScalarFunction, IndexConstraintOp) func (*Conn).CreateFunction(name string, nArg int, flag FunctionFlag, fn ScalarFunction) error
Stmt is a prepared statement object. https://sqlite.org/c3ref/stmt.html BindBlob binds a []byte to the prepared statement. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html BindBool binds a bool to the prepared statement. The leftmost SQL parameter has an index of 1. SQLite does not have a separate boolean storage class. Instead, boolean values are stored as integers 0 (false) and 1 (true). https://sqlite.org/c3ref/bind_blob.html BindCount returns the number of SQL parameters in the prepared statement. https://sqlite.org/c3ref/bind_parameter_count.html BindFloat binds a float64 to the prepared statement. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html BindIndex returns the index of a parameter in the prepared statement given its name. https://sqlite.org/c3ref/bind_parameter_index.html BindInt binds an int to the prepared statement. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html BindInt64 binds an int64 to the prepared statement. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html BindJSON binds the JSON encoding of value to the prepared statement. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html BindName returns the name of a parameter in the prepared statement. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_parameter_name.html BindNull binds a NULL to the prepared statement. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html BindPointer binds a NULL to the prepared statement, just like [Stmt.BindNull], but it also associates ptr with that NULL value such that it can be retrieved within an application-defined SQL function using [Value.Pointer]. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html BindRawText binds a []byte to the prepared statement as text. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html BindText binds a string to the prepared statement. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html BindTime binds a [time.Time] to the prepared statement. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html BindValue binds a copy of value to the prepared statement. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html BindZeroBlob binds a zero-filled, length n BLOB to the prepared statement. The leftmost SQL parameter has an index of 1. https://sqlite.org/c3ref/bind_blob.html Busy determines if a prepared statement has been reset. https://sqlite.org/c3ref/stmt_busy.html ClearBindings resets all bindings on the prepared statement. https://sqlite.org/c3ref/clear_bindings.html Close destroys the prepared statement object. It is safe to close a nil, zero or closed Stmt. https://sqlite.org/c3ref/finalize.html ColumnBlob appends to buf and returns the value of the result column as a []byte. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_blob.html ColumnBool returns the value of the result column as a bool. The leftmost column of the result set has the index 0. SQLite does not have a separate boolean storage class. Instead, boolean values are retrieved as numbers, with 0 converted to false and any other value to true. https://sqlite.org/c3ref/column_blob.html ColumnCount returns the number of columns in a result set. https://sqlite.org/c3ref/column_count.html ColumnDatabaseName returns the name of the database that is the origin of a particular result column. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_database_name.html ColumnDeclType returns the declared datatype of the result column. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_decltype.html ColumnFloat returns the value of the result column as a float64. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_blob.html ColumnInt returns the value of the result column as an int. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_blob.html ColumnInt64 returns the value of the result column as an int64. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_blob.html ColumnJSON parses the JSON-encoded value of the result column and stores it in the value pointed to by ptr. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_blob.html ColumnName returns the name of the result column. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_name.html ColumnOriginName returns the name of the table column that is the origin of a particular result column. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_database_name.html ColumnRawBlob returns the value of the result column as a []byte. The []byte is owned by SQLite and may be invalidated by subsequent calls to [Stmt] methods. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_blob.html ColumnRawText returns the value of the result column as a []byte. The []byte is owned by SQLite and may be invalidated by subsequent calls to [Stmt] methods. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_blob.html ColumnTableName returns the name of the table that is the origin of a particular result column. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_database_name.html ColumnText returns the value of the result column as a string. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_blob.html ColumnTime returns the value of the result column as a [time.Time]. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_blob.html ColumnType returns the initial [Datatype] of the result column. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_blob.html ColumnValue returns the unprotected value of the result column. The leftmost column of the result set has the index 0. https://sqlite.org/c3ref/column_blob.html Columns populates result columns into the provided slice. The slice must have [Stmt.ColumnCount] length. [INTEGER] columns will be retrieved as int64 values, [FLOAT] as float64, [NULL] as nil, [TEXT] as string, and [BLOB] as []byte. ColumnsRaw populates result columns into the provided slice. The slice must have [Stmt.ColumnCount] length. [INTEGER] columns will be retrieved as int64 values, [FLOAT] as float64, [NULL] as nil, [TEXT] and [BLOB] as []byte. Any []byte are owned by SQLite and may be invalidated by subsequent calls to [Stmt] methods. Conn returns the database connection to which the prepared statement belongs. https://sqlite.org/c3ref/db_handle.html DataCount resets the number of columns in a result set. https://sqlite.org/c3ref/data_count.html Err gets the last error occurred during [Stmt.Step]. Err returns nil after [Stmt.Reset] is called. https://sqlite.org/c3ref/step.html Exec is a convenience function that repeatedly calls [Stmt.Step] until it returns false, then calls [Stmt.Reset] to reset the statement and get any error that occurred. ExpandedSQL returns the SQL text of the prepared statement with bound parameters expanded. https://sqlite.org/c3ref/expanded_sql.html ReadOnly returns true if and only if the statement makes no direct changes to the content of the database file. https://sqlite.org/c3ref/stmt_readonly.html Reset resets the prepared statement object. https://sqlite.org/c3ref/reset.html SQL returns the SQL text used to create the prepared statement. https://sqlite.org/c3ref/expanded_sql.html Status monitors the performance characteristics of prepared statements. https://sqlite.org/c3ref/stmt_status.html Step evaluates the SQL statement. If the SQL statement being executed returns any data, then true is returned each time a new row of data is ready for processing by the caller. The values may be accessed using the Column access functions. Step is called again to retrieve the next row of data. If an error has occurred, Step returns false; call [Stmt.Err] or [Stmt.Reset] to get the error. https://sqlite.org/c3ref/step.html *Stmt : github.com/prometheus/common/expfmt.Closer *Stmt : io.Closer func (*Conn).Prepare(sql string) (stmt *Stmt, tail string, err error) func (*Conn).PrepareFlags(sql string, flags PrepareFlag) (stmt *Stmt, tail string, err error)
StmtStatus name counter values associated with the [Stmt.Status] method. https://sqlite.org/c3ref/c_stmtstatus_counter.html func (*Stmt).Status(op StmtStatus, reset bool) int const STMTSTATUS_AUTOINDEX const STMTSTATUS_FILTER_HIT const STMTSTATUS_FILTER_MISS const STMTSTATUS_FULLSCAN_STEP const STMTSTATUS_MEMUSED const STMTSTATUS_REPREPARE const STMTSTATUS_RUN const STMTSTATUS_SORT const STMTSTATUS_VM_STEP
TimeFormat specifies how to encode/decode time values. See the documentation for the [TimeFormatDefault] constant for formats recognized by SQLite. https://sqlite.org/lang_datefunc.html Decode decodes a time value using this format. The time value can be a string, an int64, or a float64. Formats [TimeFormat8] through [TimeFormat10] (and [TimeFormat8TZ] through [TimeFormat10TZ]) assume a date of 2000-01-01. The timezone indicator and fractional seconds are always optional for formats [TimeFormat2] through [TimeFormat10] (and [TimeFormat2TZ] through [TimeFormat10TZ]). [TimeFormatAuto] implements (and extends) the SQLite auto modifier. Julian day numbers are safe to use for historical dates, from 4712BC through 9999AD. Unix timestamps (expressed in seconds, milliseconds, microseconds, or nanoseconds) are safe to use for current events, from at least 1980 through at least 2260. Unix timestamps before 1980 and after 9999 may be misinterpreted as julian day numbers, or have the wrong time unit. https://sqlite.org/lang_datefunc.html Encode encodes a time value using this format. [TimeFormatDefault] and [TimeFormatAuto] encode using [time.RFC3339Nano], with nanosecond accuracy, and preserving any timezone offset. This is the format used by the [database/sql] driver: [database/sql.Row.Scan] will decode as [time.Time] values encoded with [time.RFC3339Nano]. Time values encoded with [time.RFC3339Nano] cannot be sorted as strings to produce a time-ordered sequence. Assuming that the time zones of the time values are the same (e.g., all in UTC), and expressed using the same string (e.g., all "Z" or all "+00:00"), use the TIME [collating sequence] to produce a time-ordered sequence. Otherwise, use [TimeFormat7] for time-ordered encoding. Formats [TimeFormat1] through [TimeFormat10] convert time values to UTC before encoding. Returns a string for the text formats, a float64 for [TimeFormatJulianDay] and [TimeFormatUnixFrac], or an int64 for the other numeric formats. https://sqlite.org/lang_datefunc.html Scanner returns a [database/sql.Scanner] that can be used as an argument to [database/sql.Row.Scan] and similar methods to decode a time value into dest using this format. func Context.ResultTime(value time.Time, format TimeFormat) func (*Stmt).BindTime(param int, value time.Time, format TimeFormat) error func (*Stmt).ColumnTime(col int, format TimeFormat) time.Time func Value.Time(format TimeFormat) time.Time const TimeFormat1 const TimeFormat10 const TimeFormat10TZ const TimeFormat2 const TimeFormat2TZ const TimeFormat3 const TimeFormat3TZ const TimeFormat4 const TimeFormat4TZ const TimeFormat5 const TimeFormat5TZ const TimeFormat6 const TimeFormat6TZ const TimeFormat7 const TimeFormat7TZ const TimeFormat8 const TimeFormat8TZ const TimeFormat9 const TimeFormat9TZ const TimeFormatAuto const TimeFormatDefault const TimeFormatJulianDay const TimeFormatUnix const TimeFormatUnixFrac const TimeFormatUnixMicro const TimeFormatUnixMilli const TimeFormatUnixNano
TraceEvent identify classes of events that can be monitored with [Conn.Trace]. https://sqlite.org/c3ref/c_trace.html func (*Conn).Trace(mask TraceEvent, cb func(evt TraceEvent, arg1 any, arg2 any) error) error const TRACE_CLOSE const TRACE_PROFILE const TRACE_ROW const TRACE_STMT
Txn is an in-progress database transaction. https://sqlite.org/lang_transaction.html Commit commits the transaction. https://sqlite.org/lang_transaction.html End calls either [Txn.Commit] or [Txn.Rollback] depending on whether *error points to a nil or non-nil error. This is meant to be deferred: func doWork(db *sqlite3.Conn) (err error) { tx := db.Begin() defer tx.End(&err) // ... do work in the transaction } https://sqlite.org/lang_transaction.html Rollback rolls back the transaction, even if the connection has been interrupted. https://sqlite.org/lang_transaction.html Txn : database/sql/driver.Tx Txn : gorm.io/gorm.TxCommitter func (*Conn).Begin() Txn func (*Conn).BeginConcurrent() (Txn, error) func (*Conn).BeginExclusive() (Txn, error) func (*Conn).BeginImmediate() (Txn, error)
TxnState are the allowed return values from [Conn.TxnState]. https://sqlite.org/c3ref/c_txn_none.html func (*Conn).TxnState(schema string) TxnState const TXN_NONE const TXN_READ const TXN_WRITE
Value is any value that can be stored in a database table. https://sqlite.org/c3ref/value.html Blob appends to buf and returns the value as a []byte. https://sqlite.org/c3ref/value_blob.html Bool returns the value as a bool. SQLite does not have a separate boolean storage class. Instead, boolean values are retrieved as numbers, with 0 converted to false and any other value to true. https://sqlite.org/c3ref/value_blob.html Close frees an SQL value previously obtained by [Value.Dup]. https://sqlite.org/c3ref/value_dup.html Dup makes a copy of the SQL value and returns a pointer to that copy. https://sqlite.org/c3ref/value_dup.html Float returns the value as a float64. https://sqlite.org/c3ref/value_blob.html FromBind returns true if value originated from a bound parameter. https://sqlite.org/c3ref/value_blob.html InFirst returns the first element on the right-hand side of an IN constraint. https://sqlite.org/c3ref/vtab_in_first.html InNext returns the next element on the right-hand side of an IN constraint. https://sqlite.org/c3ref/vtab_in_first.html Int returns the value as an int. https://sqlite.org/c3ref/value_blob.html Int64 returns the value as an int64. https://sqlite.org/c3ref/value_blob.html JSON parses a JSON-encoded value and stores the result in the value pointed to by ptr. NoChange returns true if and only if the value is unchanged in a virtual table update operatiom. https://sqlite.org/c3ref/value_blob.html NumericType returns the numeric datatype of the value. https://sqlite.org/c3ref/value_blob.html Pointer gets the pointer associated with this value, or nil if it has no associated pointer. RawBlob returns the value as a []byte. The []byte is owned by SQLite and may be invalidated by subsequent calls to [Value] methods. https://sqlite.org/c3ref/value_blob.html RawText returns the value as a []byte. The []byte is owned by SQLite and may be invalidated by subsequent calls to [Value] methods. https://sqlite.org/c3ref/value_blob.html Subtype returns the subtype of the value. https://sqlite.org/c3ref/value_subtype.html Text returns the value as a string. https://sqlite.org/c3ref/value_blob.html Time returns the value as a [time.Time]. https://sqlite.org/c3ref/value_blob.html Type returns the initial datatype of the value. https://sqlite.org/c3ref/value_blob.html *Value : github.com/prometheus/common/expfmt.Closer *Value : io.Closer func (*IndexInfo).RHSValue(column int) (Value, error) func (*Stmt).ColumnValue(col int) Value func Value.Dup() *Value func Value.InFirst() (Value, error) func Value.InNext() (Value, error) func AggregateFunction.Step(ctx Context, arg ...Value) func Context.ResultValue(value Value) func (*Stmt).BindValue(param int, value Value) error func VTabCursor.Filter(idxNum int, idxStr string, arg ...Value) error func VTabUpdater.Update(arg ...Value) (rowid int64, err error) func WindowFunction.Inverse(ctx Context, arg ...Value) func WindowFunction.Step(ctx Context, arg ...Value)
A VTab describes a particular instance of the virtual table. A VTab may optionally implement [io.Closer] to free resources. https://sqlite.org/c3ref/vtab.html https://sqlite.org/vtab.html#xbestindex https://sqlite.org/vtab.html#xopen VTabChecker (interface) VTabDestroyer (interface) VTabOverloader (interface) VTabRenamer (interface) VTabSavepointer (interface) VTabShadowTabler (interface) VTabTxn (interface) VTabUpdater (interface)
A VTabChecker allows a virtual table to report errors to the PRAGMA integrity_check and PRAGMA quick_check commands. Integrity should return an error if it finds problems in the content of the virtual table, but should avoid returning a (wrapped) [Error], [ErrorCode] or [ExtendedErrorCode], as those indicate the Integrity method itself encountered problems while trying to evaluate the virtual table content. https://sqlite.org/vtab.html#xbestindex https://sqlite.org/vtab.html#xintegrity https://sqlite.org/vtab.html#xopen VTabChecker : VTab
VTabConfigOption is a virtual table configuration option. https://sqlite.org/c3ref/c_vtab_constraint_support.html func (*Conn).VTabConfig(op VTabConfigOption, args ...any) error const VTAB_CONSTRAINT_SUPPORT const VTAB_DIRECTONLY const VTAB_INNOCUOUS const VTAB_USES_ALL_SCHEMAS
VTabConflictMode is a virtual table conflict resolution mode. https://sqlite.org/c3ref/c_fail.html func (*Conn).VTabOnConflict() VTabConflictMode const VTAB_ABORT const VTAB_FAIL const VTAB_IGNORE const VTAB_REPLACE const VTAB_ROLLBACK
Type Parameters: T: VTab VTabConstructor is a virtual table constructor function. func CreateModule[T](db *Conn, name string, create, connect VTabConstructor[T]) error
A VTabCursor describes cursors that point into the virtual table and are used to loop through the virtual table. A VTabCursor may optionally implement [io.Closer] to free resources. Implementations of Filter must not retain arg. https://sqlite.org/c3ref/vtab_cursor.html https://sqlite.org/vtab.html#xcolumn https://sqlite.org/vtab.html#xeof https://sqlite.org/vtab.html#xfilter https://sqlite.org/vtab.html#xnext https://sqlite.org/vtab.html#xrowid func VTab.Open() (VTabCursor, error) func VTabChecker.Open() (VTabCursor, error) func VTabDestroyer.Open() (VTabCursor, error) func VTabOverloader.Open() (VTabCursor, error) func VTabRenamer.Open() (VTabCursor, error) func VTabSavepointer.Open() (VTabCursor, error) func VTabShadowTabler.Open() (VTabCursor, error) func VTabTxn.Open() (VTabCursor, error) func VTabUpdater.Open() (VTabCursor, error)
A VTabDestroyer allows a virtual table to drop persistent state. https://sqlite.org/vtab.html#xbestindex https://sqlite.org/vtab.html#sqlite3_module.xDestroy https://sqlite.org/vtab.html#xopen VTabDestroyer : VTab
A VTabOverloader allows a virtual table to overload SQL functions. https://sqlite.org/vtab.html#xbestindex https://sqlite.org/vtab.html#xfindfunction https://sqlite.org/vtab.html#xopen VTabOverloader : VTab
A VTabRenamer allows a virtual table to be renamed. https://sqlite.org/vtab.html#xbestindex https://sqlite.org/vtab.html#xopen https://sqlite.org/vtab.html#xrename VTabRenamer : VTab
A VTabSavepointer allows a virtual table to implement nested transactions. https://sqlite.org/vtab.html#xsavepoint https://sqlite.org/vtab.html#xBegin https://sqlite.org/vtab.html#xbestindex https://sqlite.org/vtab.html#xcommit https://sqlite.org/vtab.html#xopen ( VTabSavepointer) Release(id int) error https://sqlite.org/vtab.html#xrollback ( VTabSavepointer) RollbackTo(id int) error ( VTabSavepointer) Savepoint(id int) error https://sqlite.org/vtab.html#xsync VTabSavepointer : VTab VTabSavepointer : VTabTxn VTabSavepointer : github.com/polarsignals/frostdb.Sync VTabSavepointer : database/sql/driver.Tx VTabSavepointer : gorm.io/gorm.TxCommitter
A VTabShadowTabler allows a virtual table to protect the content of shadow tables from being corrupted by hostile SQL. Implementing this interface signals that a virtual table named "mumble" reserves all table names starting with "mumble_". https://sqlite.org/vtab.html#xbestindex https://sqlite.org/vtab.html#xopen https://sqlite.org/vtab.html#the_xshadowname_method VTabShadowTabler : VTab
A VTabTxn allows a virtual table to implement transactions with two-phase commit. Anything that is required as part of a commit that may fail should be performed in the Sync() callback. Current versions of SQLite ignore any errors returned by Commit() and Rollback(). https://sqlite.org/vtab.html#xBegin https://sqlite.org/vtab.html#xbestindex https://sqlite.org/vtab.html#xcommit https://sqlite.org/vtab.html#xopen https://sqlite.org/vtab.html#xrollback https://sqlite.org/vtab.html#xsync VTabSavepointer (interface) VTabTxn : VTab VTabTxn : github.com/polarsignals/frostdb.Sync VTabTxn : database/sql/driver.Tx VTabTxn : gorm.io/gorm.TxCommitter
A VTabUpdater allows a virtual table to be updated. Implementations must not retain arg. https://sqlite.org/vtab.html#xbestindex https://sqlite.org/vtab.html#xopen https://sqlite.org/vtab.html#xupdate VTabUpdater : VTab
WindowFunction is the interface an aggregate window function should implement. https://sqlite.org/windowfunctions.html Inverse is invoked to remove the oldest presently aggregated result of Step from the current window. The function arguments, if any, are those passed to Step for the row being removed. Implementations must not retain arg. Step is invoked to add a row to the current window. The function arguments, if any, corresponding to the row being added, are passed to Step. Implementations must not retain arg. Value is invoked to return the current (or final) value of the aggregate. WindowFunction : AggregateFunction
ZeroBlob represents a zero-filled, length n BLOB that can be used as an argument to [database/sql.DB.Exec] and similar methods.
Package-Level Functions (total 11)
AutoExtension causes the entryPoint function to be invoked for each new database connection that is created. https://sqlite.org/c3ref/auto_extension.html
ConfigLog sets up the default error logging callback for new connections. https://sqlite.org/errlog.html
Type Parameters: T: VTab CreateModule registers a new virtual table module name. If create is nil, the virtual table is eponymous. https://sqlite.org/c3ref/create_module.html
Initialize decodes and compiles the SQLite Wasm binary. This is called implicitly when the first connection is openned, but is potentially slow, so you may want to call it at a more convenient time.
JSON returns a value that can be used as an argument to [database/sql.DB.Exec], [database/sql.Row.Scan] and similar methods to store value as JSON, or decode JSON into value. JSON should NOT be used with [Stmt.BindJSON], [Stmt.ColumnJSON], [Value.JSON], or [Context.ResultJSON].
Open calls [OpenFlags] with [OPEN_READWRITE], [OPEN_CREATE] and [OPEN_URI].
OpenContext is like [Open] but includes a context, which is used to interrupt the process of opening the connection.
OpenFlags opens an SQLite database file as specified by the filename argument. If none of the required flags are used, a combination of [OPEN_READWRITE] and [OPEN_CREATE] is used. If a URI filename is used, PRAGMA statements to execute can be specified using "_pragma": sqlite3.Open("file:demo.db?_pragma=busy_timeout(10000)") https://sqlite.org/c3ref/open.html
Pointer returns a pointer to a value that can be used as an argument to [database/sql.DB.Exec] and similar methods. Pointer should NOT be used with [Stmt.BindPointer], [Value.Pointer], or [Context.ResultPointer]. https://sqlite.org/bindptr.html
Quote escapes and quotes a value making it safe to embed in SQL text. Strings with embedded NUL characters are truncated. https://sqlite.org/lang_corefunc.html#quote
QuoteIdentifier escapes and quotes an identifier making it safe to embed in SQL text. Strings with embedded NUL characters panic.
Package-Level Variables (total 3)
Configure SQLite Wasm. Importing package embed initializes [Binary] with an appropriate build of SQLite: import _ "github.com/ncruces/go-sqlite3/embed"
Configure SQLite Wasm. Importing package embed initializes [Binary] with an appropriate build of SQLite: import _ "github.com/ncruces/go-sqlite3/embed"
Configure SQLite Wasm. Importing package embed initializes [Binary] with an appropriate build of SQLite: import _ "github.com/ncruces/go-sqlite3/embed"
Package-Level Constants (total 295)
const ABORT ErrorCode = 4 // Callback routine requested an abort
const AUTH ErrorCode = 23 // Authorization denied
const AUTH_ALTER_TABLE AuthorizerActionCode = 26 // Database Name Table Name
const AUTH_ANALYZE AuthorizerActionCode = 28 // Table Name NULL
const AUTH_ATTACH AuthorizerActionCode = 24 // Filename NULL
**************************************************** 3rd ************ 4th **********
const AUTH_CREATE_TABLE AuthorizerActionCode = 2 // Table Name NULL
const AUTH_CREATE_TEMP_INDEX AuthorizerActionCode = 3 // Index Name Table Name
const AUTH_CREATE_TEMP_TABLE AuthorizerActionCode = 4 // Table Name NULL
const AUTH_CREATE_TEMP_TRIGGER AuthorizerActionCode = 5 // Trigger Name Table Name
const AUTH_CREATE_TEMP_VIEW AuthorizerActionCode = 6 // View Name NULL
const AUTH_CREATE_TRIGGER AuthorizerActionCode = 7 // Trigger Name Table Name
const AUTH_CREATE_VIEW AuthorizerActionCode = 8 // View Name NULL
const AUTH_CREATE_VTABLE AuthorizerActionCode = 29 // Table Name Module Name
const AUTH_DELETE AuthorizerActionCode = 9 // Table Name NULL
const AUTH_DENY AuthorizerReturnCode = 1 // Abort the SQL statement with an error
const AUTH_DETACH AuthorizerActionCode = 25 // Database Name NULL
const AUTH_DROP_INDEX AuthorizerActionCode = 10 // Index Name Table Name
const AUTH_DROP_TABLE AuthorizerActionCode = 11 // Table Name NULL
const AUTH_DROP_TEMP_INDEX AuthorizerActionCode = 12 // Index Name Table Name
const AUTH_DROP_TEMP_TABLE AuthorizerActionCode = 13 // Table Name NULL
const AUTH_DROP_TEMP_TRIGGER AuthorizerActionCode = 14 // Trigger Name Table Name
const AUTH_DROP_TEMP_VIEW AuthorizerActionCode = 15 // View Name NULL
const AUTH_DROP_TRIGGER AuthorizerActionCode = 16 // Trigger Name Table Name
const AUTH_DROP_VIEW AuthorizerActionCode = 17 // View Name NULL
const AUTH_DROP_VTABLE AuthorizerActionCode = 30 // Table Name Module Name
const AUTH_FUNCTION AuthorizerActionCode = 31 // NULL Function Name
const AUTH_IGNORE AuthorizerReturnCode = 2 // Don't allow access, but don't generate an error
const AUTH_INSERT AuthorizerActionCode = 18 // Table Name NULL
const AUTH_PRAGMA AuthorizerActionCode = 19 // Pragma Name 1st arg or NULL
const AUTH_READ AuthorizerActionCode = 20 // Table Name Column Name
const AUTH_RECURSIVE AuthorizerActionCode = 33 // NULL NULL
const AUTH_REINDEX AuthorizerActionCode = 27 // Index Name NULL
const AUTH_SAVEPOINT AuthorizerActionCode = 32 // Operation Savepoint Name
const AUTH_SELECT AuthorizerActionCode = 21 // NULL NULL
const AUTH_TRANSACTION AuthorizerActionCode = 22 // Operation NULL
const AUTH_UPDATE AuthorizerActionCode = 23 // Table Name Column Name
const BLOB Datatype = 4
const BUSY ErrorCode = 5 // The database file is locked
const CANTOPEN ErrorCode = 14 // Unable to open the database file
const CHECKPOINT_FULL CheckpointMode = 1 // Wait for writers, then checkpoint
const CHECKPOINT_PASSIVE CheckpointMode = 0 // Do as much as possible w/o blocking
const CHECKPOINT_RESTART CheckpointMode = 2 // Like FULL but wait for readers
const CHECKPOINT_TRUNCATE CheckpointMode = 3 // Like RESTART but also truncate WAL
const CONSTRAINT ErrorCode = 19 // Abort due to constraint violation
const CORRUPT ErrorCode = 11 // The database disk image is malformed
DBCONFIG_MAINDBNAME DBConfig = 1000 DBCONFIG_LOOKASIDE DBConfig = 1001
const DIRECTONLY FunctionFlag = 524288
const EMPTY ErrorCode = 16 // Internal use only
const ERROR ErrorCode = 1 // Generic error
const FLOAT Datatype = 2
const FORMAT ErrorCode = 24 // Not used
const FULL ErrorCode = 13 // Insertion failed because database is full
const INNOCUOUS FunctionFlag = 2097152
const INTEGER Datatype = 1
const INTERNAL ErrorCode = 2 // Internal logic error in SQLite
const INTERRUPT ErrorCode = 9 // Operation terminated by sqlite3_interrupt()
const IOERR ErrorCode = 10 // Some kind of disk I/O error occurred
const LOCKED ErrorCode = 6 // A table in the database is locked
const MISMATCH ErrorCode = 20 // Data type mismatch
const MISUSE ErrorCode = 21 // Library used incorrectly
const NOLFS ErrorCode = 22 // Uses OS features not supported on host
const NOMEM ErrorCode = 7 // A malloc() failed
const NOTADB ErrorCode = 26 // File opened that is not a database file
const NOTFOUND ErrorCode = 12 // Unknown opcode in sqlite3_file_control()
const NOTICE ErrorCode = 27 // Notifications from sqlite3_log()
const NULL Datatype = 5
const OPEN_CREATE OpenFlag = 4 // Ok for sqlite3_open_v2()
const OPEN_EXRESCODE OpenFlag = 33554432 // Extended result codes
const OPEN_FULLMUTEX OpenFlag = 65536 // Ok for sqlite3_open_v2()
const OPEN_MEMORY OpenFlag = 128 // Ok for sqlite3_open_v2()
const OPEN_NOFOLLOW OpenFlag = 16777216 // Ok for sqlite3_open_v2()
const OPEN_NOMUTEX OpenFlag = 32768 // Ok for sqlite3_open_v2()
const OPEN_PRIVATECACHE OpenFlag = 262144 // Ok for sqlite3_open_v2()
const OPEN_READONLY OpenFlag = 1 // Ok for sqlite3_open_v2()
const OPEN_READWRITE OpenFlag = 2 // Ok for sqlite3_open_v2()
const OPEN_SHAREDCACHE OpenFlag = 131072 // Ok for sqlite3_open_v2()
const OPEN_URI OpenFlag = 64 // Ok for sqlite3_open_v2()
const PERM ErrorCode = 3 // Access permission denied
const PROTOCOL ErrorCode = 15 // Database lock protocol error
const RANGE ErrorCode = 25 // 2nd parameter to sqlite3_bind out of range
const READONLY ErrorCode = 8 // Attempt to write a readonly database
const RESULT_SUBTYPE FunctionFlag = 16777216
const SCHEMA ErrorCode = 17 // The database schema changed
const SELFORDER1 FunctionFlag = 33554432
const SUBTYPE FunctionFlag = 1048576
const TEXT Datatype = 3
Text formats
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
Auto
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
Numeric formats
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
TimeFormats recognized by SQLite to encode/decode time values. https://sqlite.org/lang_datefunc.html#time_values
const TOOBIG ErrorCode = 18 // String or BLOB exceeds size limit
const TXN_NONE TxnState = 0
const TXN_READ TxnState = 1
const TXN_WRITE TxnState = 2
const WARNING ErrorCode = 28 // Warnings from sqlite3_log()