Versions in this module Expand all Collapse all v1 v1.0.2 Sep 19, 2024 v1.0.1 Sep 19, 2024 Changes in this version + 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 + var Binary []byte + var Path string + var RuntimeConfig wazero.RuntimeConfig + func AutoExtension(entryPoint func(*Conn) error) + func CreateModule[T VTab](db *Conn, name string, create, connect VTabConstructor[T]) error + func Initialize() error + func JSON(value any) any + func Pointer[T any](value T) any + func Quote(value any) string + func QuoteIdentifier(id string) string + type AggregateFunction interface + Step func(ctx Context, arg ...Value) + Value func(ctx Context) + type AuthorizerActionCode uint32 + const AUTH_ALTER_TABLE + const AUTH_ANALYZE + const AUTH_ATTACH + const AUTH_CREATE_INDEX + const AUTH_CREATE_TABLE + const AUTH_CREATE_TEMP_INDEX + const AUTH_CREATE_TEMP_TABLE + const AUTH_CREATE_TEMP_TRIGGER + const AUTH_CREATE_TEMP_VIEW + const AUTH_CREATE_TRIGGER + const AUTH_CREATE_VIEW + const AUTH_CREATE_VTABLE + const AUTH_DELETE + const AUTH_DETACH + const AUTH_DROP_INDEX + const AUTH_DROP_TABLE + const AUTH_DROP_TEMP_INDEX + const AUTH_DROP_TEMP_TABLE + const AUTH_DROP_TEMP_TRIGGER + const AUTH_DROP_TEMP_VIEW + const AUTH_DROP_TRIGGER + const AUTH_DROP_VIEW + const AUTH_DROP_VTABLE + const AUTH_FUNCTION + const AUTH_INSERT + const AUTH_PRAGMA + const AUTH_READ + const AUTH_RECURSIVE + const AUTH_REINDEX + const AUTH_SAVEPOINT + const AUTH_SELECT + const AUTH_TRANSACTION + const AUTH_UPDATE + type AuthorizerReturnCode uint32 + const AUTH_DENY + const AUTH_IGNORE + const AUTH_OK + type Backup struct + func (b *Backup) Close() error + func (b *Backup) PageCount() int + func (b *Backup) Remaining() int + func (b *Backup) Step(nPage int) (done bool, err error) + type Blob struct + func (b *Blob) Close() error + func (b *Blob) Read(p []byte) (n int, err error) + func (b *Blob) ReadFrom(r io.Reader) (n int64, err error) + func (b *Blob) Reopen(row int64) error + func (b *Blob) Seek(offset int64, whence int) (int64, error) + func (b *Blob) Size() int64 + func (b *Blob) Write(p []byte) (n int, err error) + func (b *Blob) WriteTo(w io.Writer) (n int64, err error) + type CheckpointMode uint32 + const CHECKPOINT_FULL + const CHECKPOINT_PASSIVE + const CHECKPOINT_RESTART + const CHECKPOINT_TRUNCATE + type Conn struct + func Open(filename string) (*Conn, error) + func OpenFlags(filename string, flags OpenFlag) (*Conn, error) + func (c *Conn) AutoVacuumPages(cb func(schema string, dbPages, freePages, bytesPerPage uint) uint) error + func (c *Conn) Begin() Txn + func (c *Conn) BeginConcurrent() (Txn, error) + func (c *Conn) BeginExclusive() (Txn, error) + func (c *Conn) BeginImmediate() (Txn, error) + func (c *Conn) BusyHandler(cb func(count int) (retry bool)) error + func (c *Conn) BusyTimeout(timeout time.Duration) error + func (c *Conn) CacheFlush() error + func (c *Conn) Changes() int64 + func (c *Conn) Close() error + func (c *Conn) CollationNeeded(cb func(db *Conn, name string)) error + func (c *Conn) CommitHook(cb func() (ok bool)) + func (c *Conn) Config(op DBConfig, arg ...bool) (bool, error) + func (c *Conn) ConfigLog(cb func(code ExtendedErrorCode, msg string)) error + func (c *Conn) CreateCollation(name string, fn func(a, b []byte) int) error + func (c *Conn) CreateFunction(name string, nArg int, flag FunctionFlag, fn ScalarFunction) error + func (c *Conn) CreateWindowFunction(name string, nArg int, flag FunctionFlag, fn func() AggregateFunction) error + func (c *Conn) DBName(n int) string + func (c *Conn) DeclareVTab(sql string) error + func (c *Conn) Exec(sql string) error + func (c *Conn) FileControl(schema string, op FcntlOpcode, arg ...any) (any, error) + func (c *Conn) Filename(schema string) *vfs.Filename + func (c *Conn) GetAutocommit() bool + func (c *Conn) GetInterrupt() context.Context + func (c *Conn) HardHeapLimit(n int64) int64 + func (c *Conn) LastInsertRowID() int64 + func (c *Conn) Limit(id LimitCategory, value int) int + func (c *Conn) OpenBlob(db, table, column string, row int64, write bool) (*Blob, error) + func (c *Conn) OverloadFunction(name string, nArg int) error + func (c *Conn) Prepare(sql string) (stmt *Stmt, tail string, err error) + func (c *Conn) PrepareFlags(sql string, flags PrepareFlag) (stmt *Stmt, tail string, err error) + func (c *Conn) ReadOnly(schema string) (ro bool, ok bool) + func (c *Conn) ReleaseMemory() error + func (c *Conn) RollbackHook(cb func()) + func (c *Conn) Savepoint() Savepoint + func (c *Conn) SetAuthorizer(...) error + func (c *Conn) SetInterrupt(ctx context.Context) (old context.Context) + func (c *Conn) SetLastInsertRowID(id int64) + func (c *Conn) SoftHeapLimit(n int64) int64 + func (c *Conn) Status(op DBStatus, reset bool) (current, highwater int, err error) + func (c *Conn) Stmts() iter.Seq[*Stmt] + func (c *Conn) TableColumnMetadata(schema, table, column string) (declType, collSeq string, notNull, primaryKey, autoInc bool, err error) + func (c *Conn) TotalChanges() int64 + func (c *Conn) Trace(mask TraceEvent, cb func(evt TraceEvent, arg1 any, arg2 any) error) error + func (c *Conn) TxnState(schema string) TxnState + func (c *Conn) UpdateHook(cb func(action AuthorizerActionCode, schema, table string, rowid int64)) + func (c *Conn) VTabConfig(op VTabConfigOption, args ...any) error + func (c *Conn) VTabOnConflict() VTabConflictMode + func (c *Conn) WalAutoCheckpoint(pages int) error + func (c *Conn) WalCheckpoint(schema string, mode CheckpointMode) (nLog, nCkpt int, err error) + func (c *Conn) WalHook(cb func(db *Conn, schema string, pages int) error) + func (c Conn) AnyCollationNeeded() error + func (dst *Conn) Restore(dstDB, srcURI string) error + func (src *Conn) Backup(srcDB, dstURI string) error + func (src *Conn) BackupInit(srcDB, dstURI string) (*Backup, error) + type Context struct + func (ctx Context) Conn() *Conn + func (ctx Context) GetAuxData(n int) any + func (ctx Context) ResultBlob(value []byte) + func (ctx Context) ResultBool(value bool) + func (ctx Context) ResultError(err error) + func (ctx Context) ResultFloat(value float64) + func (ctx Context) ResultInt(value int) + func (ctx Context) ResultInt64(value int64) + func (ctx Context) ResultJSON(value any) + func (ctx Context) ResultNull() + func (ctx Context) ResultPointer(ptr any) + func (ctx Context) ResultRawText(value []byte) + func (ctx Context) ResultText(value string) + func (ctx Context) ResultTime(value time.Time, format TimeFormat) + func (ctx Context) ResultValue(value Value) + func (ctx Context) ResultZeroBlob(n int64) + func (ctx Context) SetAuxData(n int, data any) + func (ctx Context) VTabNoChange() bool + type DBConfig uint32 + const DBCONFIG_DEFENSIVE + const DBCONFIG_DQS_DDL + const DBCONFIG_DQS_DML + const DBCONFIG_ENABLE_FKEY + const DBCONFIG_ENABLE_FTS3_TOKENIZER + const DBCONFIG_ENABLE_LOAD_EXTENSION + const DBCONFIG_ENABLE_QPSG + const DBCONFIG_ENABLE_TRIGGER + const DBCONFIG_ENABLE_VIEW + const DBCONFIG_LEGACY_ALTER_TABLE + const DBCONFIG_LEGACY_FILE_FORMAT + const DBCONFIG_NO_CKPT_ON_CLOSE + const DBCONFIG_RESET_DATABASE + const DBCONFIG_REVERSE_SCANORDER + const DBCONFIG_STMT_SCANSTATUS + const DBCONFIG_TRIGGER_EQP + const DBCONFIG_TRUSTED_SCHEMA + const DBCONFIG_WRITABLE_SCHEMA + type DBStatus uint32 + 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 + type Datatype uint32 + const BLOB + const FLOAT + const INTEGER + const NULL + const TEXT + func (t Datatype) String() string + type DriverConn interface + Raw func() *Conn + type Error struct + func (e *Error) As(err any) bool + func (e *Error) Code() ErrorCode + func (e *Error) Error() string + func (e *Error) ExtendedCode() ExtendedErrorCode + func (e *Error) Is(err error) bool + func (e *Error) SQL() string + func (e *Error) Temporary() bool + func (e *Error) Timeout() bool + type ErrorCode uint8 + 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 + func (e ErrorCode) Error() string + func (e ErrorCode) Temporary() bool + type ExtendedErrorCode uint16 + 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 + func (e ExtendedErrorCode) As(err any) bool + func (e ExtendedErrorCode) Error() string + func (e ExtendedErrorCode) Is(err error) bool + func (e ExtendedErrorCode) Temporary() bool + func (e ExtendedErrorCode) Timeout() bool + type FcntlOpcode uint32 + const FCNTL_CHUNK_SIZE + const FCNTL_DATA_VERSION + const FCNTL_FILE_POINTER + const FCNTL_JOURNAL_POINTER + const FCNTL_LOCKSTATE + const FCNTL_PERSIST_WAL + const FCNTL_POWERSAFE_OVERWRITE + const FCNTL_RESERVE_BYTES + const FCNTL_RESET_CACHE + const FCNTL_VFS_POINTER + type FunctionFlag uint32 + const DETERMINISTIC + const DIRECTONLY + const INNOCUOUS + type IndexConstraint struct + Column int + Op IndexConstraintOp + Usable bool + type IndexConstraintOp uint8 + const INDEX_CONSTRAINT_EQ + const INDEX_CONSTRAINT_FUNCTION + const INDEX_CONSTRAINT_GE + const INDEX_CONSTRAINT_GLOB + const INDEX_CONSTRAINT_GT + const INDEX_CONSTRAINT_IS + const INDEX_CONSTRAINT_ISNOT + const INDEX_CONSTRAINT_ISNOTNULL + const INDEX_CONSTRAINT_ISNULL + const INDEX_CONSTRAINT_LE + const INDEX_CONSTRAINT_LIKE + const INDEX_CONSTRAINT_LIMIT + const INDEX_CONSTRAINT_LT + const INDEX_CONSTRAINT_MATCH + const INDEX_CONSTRAINT_NE + const INDEX_CONSTRAINT_OFFSET + const INDEX_CONSTRAINT_REGEXP + type IndexConstraintUsage struct + ArgvIndex int + Omit bool + type IndexInfo struct + ColumnsUsed int64 + Constraint []IndexConstraint + ConstraintUsage []IndexConstraintUsage + EstimatedCost float64 + EstimatedRows int64 + IdxFlags IndexScanFlag + IdxNum int + IdxStr string + OrderBy []IndexOrderBy + OrderByConsumed bool + func (idx *IndexInfo) Collation(column int) string + func (idx *IndexInfo) Distinct() int + func (idx *IndexInfo) In(column, handle int) bool + func (idx *IndexInfo) RHSValue(column int) (Value, error) + type IndexOrderBy struct + Column int + Desc bool + type IndexScanFlag uint32 + const INDEX_SCAN_UNIQUE + type LimitCategory uint32 + 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 + type OpenFlag uint32 + 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 + type PrepareFlag uint32 + const PREPARE_NORMALIZE + const PREPARE_NO_VTAB + const PREPARE_PERSISTENT + type Savepoint struct + func (s Savepoint) Release(errp *error) + func (s Savepoint) Rollback() error + type ScalarFunction func(ctx Context, arg ...Value) + type Stmt struct + func (s *Stmt) BindBlob(param int, value []byte) error + func (s *Stmt) BindBool(param int, value bool) error + func (s *Stmt) BindCount() int + func (s *Stmt) BindFloat(param int, value float64) error + func (s *Stmt) BindIndex(name string) int + func (s *Stmt) BindInt(param int, value int) error + func (s *Stmt) BindInt64(param int, value int64) error + func (s *Stmt) BindJSON(param int, value any) error + func (s *Stmt) BindName(param int) string + func (s *Stmt) BindNull(param int) error + func (s *Stmt) BindPointer(param int, ptr any) error + func (s *Stmt) BindRawText(param int, value []byte) error + func (s *Stmt) BindText(param int, value string) error + func (s *Stmt) BindTime(param int, value time.Time, format TimeFormat) error + func (s *Stmt) BindValue(param int, value Value) error + func (s *Stmt) BindZeroBlob(param int, n int64) error + func (s *Stmt) Busy() bool + func (s *Stmt) ClearBindings() error + func (s *Stmt) Close() error + func (s *Stmt) ColumnBlob(col int, buf []byte) []byte + func (s *Stmt) ColumnBool(col int) bool + func (s *Stmt) ColumnCount() int + func (s *Stmt) ColumnDatabaseName(col int) string + func (s *Stmt) ColumnDeclType(col int) string + func (s *Stmt) ColumnFloat(col int) float64 + func (s *Stmt) ColumnInt(col int) int + func (s *Stmt) ColumnInt64(col int) int64 + func (s *Stmt) ColumnJSON(col int, ptr any) error + func (s *Stmt) ColumnName(col int) string + func (s *Stmt) ColumnOriginName(col int) string + func (s *Stmt) ColumnRawBlob(col int) []byte + func (s *Stmt) ColumnRawText(col int) []byte + func (s *Stmt) ColumnTableName(col int) string + func (s *Stmt) ColumnText(col int) string + func (s *Stmt) ColumnTime(col int, format TimeFormat) time.Time + func (s *Stmt) ColumnType(col int) Datatype + func (s *Stmt) ColumnValue(col int) Value + func (s *Stmt) Columns(dest []any) error + func (s *Stmt) Conn() *Conn + func (s *Stmt) Err() error + func (s *Stmt) Exec() error + func (s *Stmt) ExpandedSQL() string + func (s *Stmt) ReadOnly() bool + func (s *Stmt) Reset() error + func (s *Stmt) SQL() string + func (s *Stmt) Status(op StmtStatus, reset bool) int + func (s *Stmt) Step() bool + type StmtStatus uint32 + 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 + type TimeFormat string + func (f TimeFormat) Decode(v any) (time.Time, error) + func (f TimeFormat) Encode(t time.Time) any + func (f TimeFormat) Scanner(dest *time.Time) interface{ ... } + type TraceEvent uint32 + const TRACE_CLOSE + const TRACE_PROFILE + const TRACE_ROW + const TRACE_STMT + type Txn struct + func (tx Txn) Commit() error + func (tx Txn) End(errp *error) + func (tx Txn) Rollback() error + type TxnState uint32 + const TXN_NONE + const TXN_READ + const TXN_WRITE + type VTab interface + BestIndex func(*IndexInfo) error + Open func() (VTabCursor, error) + type VTabChecker interface + Integrity func(schema, table string, flags int) error + type VTabConfigOption uint8 + const VTAB_CONSTRAINT_SUPPORT + const VTAB_DIRECTONLY + const VTAB_INNOCUOUS + const VTAB_USES_ALL_SCHEMAS + type VTabConflictMode uint8 + const VTAB_ABORT + const VTAB_FAIL + const VTAB_IGNORE + const VTAB_REPLACE + const VTAB_ROLLBACK + type VTabConstructor func(db *Conn, module, schema, table string, arg ...string) (T, error) + type VTabCursor interface + Column func(ctx Context, n int) error + EOF func() bool + Filter func(idxNum int, idxStr string, arg ...Value) error + Next func() error + RowID func() (int64, error) + type VTabDestroyer interface + Destroy func() error + type VTabOverloader interface + FindFunction func(arg int, name string) (ScalarFunction, IndexConstraintOp) + type VTabRenamer interface + Rename func(new string) error + type VTabSavepointer interface + Release func(id int) error + RollbackTo func(id int) error + Savepoint func(id int) error + type VTabShadowTabler interface + ShadowTables func() + type VTabTxn interface + Begin func() error + Commit func() error + Rollback func() error + Sync func() error + type VTabUpdater interface + Update func(arg ...Value) (rowid int64, err error) + type Value struct + func (dup *Value) Close() error + func (v Value) Blob(buf []byte) []byte + func (v Value) Bool() bool + func (v Value) Dup() *Value + func (v Value) Float() float64 + func (v Value) FromBind() bool + func (v Value) InFirst() (Value, error) + func (v Value) InNext() (Value, error) + func (v Value) Int() int + func (v Value) Int64() int64 + func (v Value) JSON(ptr any) error + func (v Value) NoChange() bool + func (v Value) NumericType() Datatype + func (v Value) Pointer() any + func (v Value) RawBlob() []byte + func (v Value) RawText() []byte + func (v Value) Text() string + func (v Value) Time(format TimeFormat) time.Time + func (v Value) Type() Datatype + type WindowFunction interface + Inverse func(ctx Context, arg ...Value) + type ZeroBlob int64