sqlite3

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACCESSPERMS                           = 511
	ADJ_ESTERROR                          = 0x0008
	ADJ_FREQUENCY                         = 0x0002
	ADJ_MAXERROR                          = 0x0004
	ADJ_MICRO                             = 0x1000
	ADJ_NANO                              = 0x2000
	ADJ_OFFSET                            = 0x0001
	ADJ_OFFSET_SINGLESHOT                 = 0x8001
	ADJ_OFFSET_SS_READ                    = 0xa001
	ADJ_SETOFFSET                         = 0x0100
	ADJ_STATUS                            = 0x0010
	ADJ_TAI                               = 0x0080
	ADJ_TICK                              = 0x4000
	ADJ_TIMECONST                         = 0x0020
	ALLPERMS                              = 4095
	ALT_SCHEMA_TABLE                      = "sqlite_schema"
	ALT_TEMP_SCHEMA_TABLE                 = "sqlite_temp_schema"
	AT_EACCESS                            = 0x200
	AT_EMPTY_PATH                         = 0x1000
	AT_FDCWD                              = -100
	AT_NO_AUTOMOUNT                       = 0x800
	AT_REMOVEDIR                          = 0x200
	AT_STATX_DONT_SYNC                    = 0x4000
	AT_STATX_FORCE_SYNC                   = 0x2000
	AT_STATX_SYNC_AS_STAT                 = 0x0000
	AT_STATX_SYNC_TYPE                    = 0x6000
	AT_SYMLINK_FOLLOW                     = 0x400
	AT_SYMLINK_NOFOLLOW                   = 0x100
	BIG_ENDIAN                            = 4321
	BITVEC_SZ                             = 512
	BITVEC_SZELEM                         = 8
	BTALLOC_ANY                           = 0
	BTALLOC_EXACT                         = 1
	BTALLOC_LE                            = 2
	BTCF_AtLast                           = 0x08
	BTCF_Incrblob                         = 0x10
	BTCF_Multiple                         = 0x20
	BTCF_Pinned                           = 0x40
	BTCF_ValidNKey                        = 0x02
	BTCF_ValidOvfl                        = 0x04
	BTCF_WriteFlag                        = 0x01
	BTCURSOR_MAX_DEPTH                    = 20
	BTREE_APPEND                          = 0x08
	BTREE_APPLICATION_ID                  = 8
	BTREE_AUTOVACUUM_FULL                 = 1
	BTREE_AUTOVACUUM_INCR                 = 2
	BTREE_AUTOVACUUM_NONE                 = 0
	BTREE_AUXDELETE                       = 0x04
	BTREE_BLOBKEY                         = 2
	BTREE_BULKLOAD                        = 0x00000001
	BTREE_DATA_VERSION                    = 15
	BTREE_DEFAULT_CACHE_SIZE              = 3
	BTREE_FILE_FORMAT                     = 2
	BTREE_FORDELETE                       = 0x00000008
	BTREE_FREE_PAGE_COUNT                 = 0
	BTREE_HINT_RANGE                      = 0
	BTREE_INCR_VACUUM                     = 7
	BTREE_INTKEY                          = 1
	BTREE_LARGEST_ROOT_PAGE               = 4
	BTREE_MEMORY                          = 2
	BTREE_OMIT_JOURNAL                    = 1
	BTREE_PREFORMAT                       = 0x80
	BTREE_SAVEPOSITION                    = 0x02
	BTREE_SCHEMA_VERSION                  = 1
	BTREE_SEEK_EQ                         = 0x00000002
	BTREE_SINGLE                          = 4
	BTREE_TEXT_ENCODING                   = 5
	BTREE_UNORDERED                       = 8
	BTREE_USER_VERSION                    = 6
	BTREE_WRCSR                           = 0x00000004
	BTS_EXCLUSIVE                         = 0x0040
	BTS_FAST_SECURE                       = 0x000c
	BTS_INITIALLY_EMPTY                   = 0x0010
	BTS_NO_WAL                            = 0x0020
	BTS_OVERWRITE                         = 0x0008
	BTS_PAGESIZE_FIXED                    = 0x0002
	BTS_PENDING                           = 0x0080
	BTS_READ_ONLY                         = 0x0001
	BTS_SECURE_DELETE                     = 0x0004
	BUFSIZ                                = 8192
	BYTE_ORDER                            = 1234
	CACHE_STALE                           = 0
	CBRK                                  = 0
	CC_AND                                = 24
	CC_BANG                               = 15
	CC_BOM                                = 30
	CC_COMMA                              = 23
	CC_DIGIT                              = 3
	CC_DOLLAR                             = 4
	CC_DOT                                = 26
	CC_EQ                                 = 14
	CC_GT                                 = 13
	CC_ID                                 = 27
	CC_ILLEGAL                            = 28
	CC_KYWD                               = 2
	CC_KYWD0                              = 1
	CC_LP                                 = 17
	CC_LT                                 = 12
	CC_MINUS                              = 11
	CC_NUL                                = 29
	CC_PERCENT                            = 22
	CC_PIPE                               = 10
	CC_PLUS                               = 20
	CC_QUOTE                              = 8
	CC_QUOTE2                             = 9
	CC_RP                                 = 18
	CC_SEMI                               = 19
	CC_SLASH                              = 16
	CC_SPACE                              = 7
	CC_STAR                               = 21
	CC_TILDA                              = 25
	CC_VARALPHA                           = 5
	CC_VARNUM                             = 6
	CC_X                                  = 0
	CDISCARD                              = 15
	CDSUSP                                = 25
	CEOF                                  = 4
	CEOL                                  = 0
	CEOT                                  = 4
	CERASE                                = 0177
	CFLUSH                                = 15
	CINTR                                 = 3
	CKCNSTRNT_COLUMN                      = 0x01
	CKCNSTRNT_ROWID                       = 0x02
	CKILL                                 = 21
	CLNEXT                                = 22
	CLOCK_BOOTTIME                        = 7
	CLOCK_BOOTTIME_ALARM                  = 9
	CLOCK_MONOTONIC                       = 1
	CLOCK_MONOTONIC_COARSE                = 6
	CLOCK_MONOTONIC_RAW                   = 4
	CLOCK_PROCESS_CPUTIME_ID              = 2
	CLOCK_REALTIME                        = 0
	CLOCK_REALTIME_ALARM                  = 8
	CLOCK_REALTIME_COARSE                 = 5
	CLOCK_TAI                             = 11
	CLOCK_THREAD_CPUTIME_ID               = 3
	CLONE_CHILD_CLEARTID                  = 0x00200000
	CLONE_CHILD_SETTID                    = 0x01000000
	CLONE_DETACHED                        = 0x00400000
	CLONE_FILES                           = 0x00000400
	CLONE_FS                              = 0x00000200
	CLONE_IO                              = 0x80000000
	CLONE_NEWCGROUP                       = 0x02000000
	CLONE_NEWIPC                          = 0x08000000
	CLONE_NEWNET                          = 0x40000000
	CLONE_NEWNS                           = 0x00020000
	CLONE_NEWPID                          = 0x20000000
	CLONE_NEWUSER                         = 0x10000000
	CLONE_NEWUTS                          = 0x04000000
	CLONE_PARENT                          = 0x00008000
	CLONE_PARENT_SETTID                   = 0x00100000
	CLONE_PTRACE                          = 0x00002000
	CLONE_SETTLS                          = 0x00080000
	CLONE_SIGHAND                         = 0x00000800
	CLONE_SYSVSEM                         = 0x00040000
	CLONE_THREAD                          = 0x00010000
	CLONE_UNTRACED                        = 0x00800000
	CLONE_VFORK                           = 0x00004000
	CLONE_VM                              = 0x00000100
	CMIN                                  = 1
	COLFLAG_BUSY                          = 0x0100
	COLFLAG_GENERATED                     = 0x0060
	COLFLAG_HASTYPE                       = 0x0004
	COLFLAG_HIDDEN                        = 0x0002
	COLFLAG_NOINSERT                      = 0x0062
	COLFLAG_NOTAVAIL                      = 0x0080
	COLFLAG_PRIMKEY                       = 0x0001
	COLFLAG_SORTERREF                     = 0x0010
	COLFLAG_STORED                        = 0x0040
	COLFLAG_UNIQUE                        = 0x0008
	COLFLAG_VIRTUAL                       = 0x0020
	COLNAME_COLUMN                        = 4
	COLNAME_DATABASE                      = 2
	COLNAME_DECLTYPE                      = 1
	COLNAME_N                             = 5
	COLNAME_NAME                          = 0
	COLNAME_TABLE                         = 3
	CPU_SETSIZE                           = 1024
	CQUIT                                 = 034
	CREPRINT                              = 18
	CRPRNT                                = 18
	CSIGNAL                               = 0x000000ff
	CSTART                                = 17
	CSTATUS                               = 0
	CSTOP                                 = 19
	CSUSP                                 = 26
	CTIME                                 = 0
	CURSOR_FAULT                          = 4
	CURSOR_INVALID                        = 1
	CURSOR_REQUIRESEEK                    = 3
	CURSOR_SKIPNEXT                       = 2
	CURSOR_VALID                          = 0
	CURTYPE_BTREE                         = 0
	CURTYPE_PSEUDO                        = 3
	CURTYPE_SORTER                        = 1
	CURTYPE_VTAB                          = 2
	CWERASE                               = 23
	DBFLAG_EncodingFixed                  = 0x0040
	DBFLAG_InternalFunc                   = 0x0020
	DBFLAG_PreferBuiltin                  = 0x0002
	DBFLAG_SchemaChange                   = 0x0001
	DBFLAG_SchemaKnownOk                  = 0x0010
	DBFLAG_Vacuum                         = 0x0004
	DBFLAG_VacuumInto                     = 0x0008
	DBPAGE_COLUMN_DATA                    = 1
	DBPAGE_COLUMN_PGNO                    = 0
	DBPAGE_COLUMN_SCHEMA                  = 2
	DB_ResetWanted                        = 0x0008
	DB_SchemaLoaded                       = 0x0001
	DB_UnresetViews                       = 0x0002
	DEFFILEMODE                           = 438
	DFLT_SCHEMA_TABLE                     = "sqlite_master"
	DFLT_TEMP_SCHEMA_TABLE                = "sqlite_temp_master"
	DIRECT_MODE                           = 0
	DN_ACCESS                             = 0x00000001
	DN_ATTRIB                             = 0x00000020
	DN_CREATE                             = 0x00000004
	DN_DELETE                             = 0x00000008
	DN_MODIFY                             = 0x00000002
	DN_MULTISHOT                          = 0x80000000
	DN_RENAME                             = 0x00000010
	DOTLOCK_SUFFIX                        = ".lock"
	E2BIG                                 = 7
	EACCES                                = 13
	EADDRINUSE                            = 98
	EADDRNOTAVAIL                         = 99
	EADV                                  = 68
	EAFNOSUPPORT                          = 97
	EAGAIN                                = 11
	EALREADY                              = 114
	EBADE                                 = 52
	EBADF                                 = 9
	EBADFD                                = 77
	EBADMSG                               = 74
	EBADR                                 = 53
	EBADRQC                               = 56
	EBADSLT                               = 57
	EBFONT                                = 59
	EBUSY                                 = 16
	ECANCELED                             = 125
	ECHILD                                = 10
	ECHRNG                                = 44
	ECOMM                                 = 70
	ECONNABORTED                          = 103
	ECONNREFUSED                          = 111
	ECONNRESET                            = 104
	EDEADLK                               = 35
	EDEADLOCK                             = 35
	EDESTADDRREQ                          = 89
	EDOM                                  = 33
	EDOTDOT                               = 73
	EDQUOT                                = 122
	EEXIST                                = 17
	EFAULT                                = 14
	EFBIG                                 = 27
	EHOSTDOWN                             = 112
	EHOSTUNREACH                          = 113
	EHWPOISON                             = 133
	EIDRM                                 = 43
	EILSEQ                                = 84
	EINPROGRESS                           = 115
	EINTR                                 = 4
	EINVAL                                = 22
	EIO                                   = 5
	EISCONN                               = 106
	EISDIR                                = 21
	EISNAM                                = 120
	EKEYEXPIRED                           = 127
	EKEYREJECTED                          = 129
	EKEYREVOKED                           = 128
	EL2HLT                                = 51
	EL2NSYNC                              = 45
	EL3HLT                                = 46
	EL3RST                                = 47
	ELIBACC                               = 79
	ELIBBAD                               = 80
	ELIBEXEC                              = 83
	ELIBMAX                               = 82
	ELIBSCN                               = 81
	ELNRNG                                = 48
	ELOOP                                 = 40
	EMEDIUMTYPE                           = 124
	EMFILE                                = 24
	EMLINK                                = 31
	EMSGSIZE                              = 90
	EMULTIHOP                             = 72
	ENAMETOOLONG                          = 36
	ENAME_NAME                            = 0
	ENAME_SPAN                            = 1
	ENAME_TAB                             = 2
	ENAVAIL                               = 119
	ENETDOWN                              = 100
	ENETRESET                             = 102
	ENETUNREACH                           = 101
	ENFILE                                = 23
	ENOANO                                = 55
	ENOBUFS                               = 105
	ENOCSI                                = 50
	ENODATA                               = 61
	ENODEV                                = 19
	ENOENT                                = 2
	ENOEXEC                               = 8
	ENOKEY                                = 126
	ENOLCK                                = 37
	ENOLINK                               = 67
	ENOMEDIUM                             = 123
	ENOMEM                                = 12
	ENOMSG                                = 42
	ENONET                                = 64
	ENOPKG                                = 65
	ENOPROTOOPT                           = 92
	ENOSPC                                = 28
	ENOSR                                 = 63
	ENOSTR                                = 60
	ENOSYS                                = 38
	ENOTBLK                               = 15
	ENOTCONN                              = 107
	ENOTDIR                               = 20
	ENOTEMPTY                             = 39
	ENOTNAM                               = 118
	ENOTRECOVERABLE                       = 131
	ENOTSOCK                              = 88
	ENOTSUP                               = 95
	ENOTTY                                = 25
	ENOTUNIQ                              = 76
	ENXIO                                 = 6
	EOF                                   = -1
	EOPNOTSUPP                            = 95
	EOVERFLOW                             = 75
	EOWNERDEAD                            = 130
	EPERM                                 = 1
	EPFNOSUPPORT                          = 96
	EPIPE                                 = 32
	EPROTO                                = 71
	EPROTONOSUPPORT                       = 93
	EPROTOTYPE                            = 91
	EP_Agg                                = 0x000010
	EP_CanBeNull                          = 0x100000
	EP_Collate                            = 0x000100
	EP_Commuted                           = 0x000200
	EP_ConstFunc                          = 0x080000
	EP_DblQuoted                          = 0x000040
	EP_Distinct                           = 0x000002
	EP_FixedCol                           = 0x000008
	EP_FromDDL                            = 0x40000000
	EP_FromJoin                           = 0x000001
	EP_HasFunc                            = 0x000004
	EP_IfNullRow                          = 0x020000
	EP_Immutable                          = 0x02
	EP_InfixFunc                          = 0x000080
	EP_IntValue                           = 0x000400
	EP_IsFalse                            = 0x20000000
	EP_IsTrue                             = 0x10000000
	EP_Leaf                               = 0x800000
	EP_MemToken                           = 0x010000
	EP_NoReduce                           = 0x01
	EP_Propagate                          = 2097412
	EP_Quoted                             = 0x4000000
	EP_Reduced                            = 0x002000
	EP_Skip                               = 0x001000
	EP_Static                             = 0x8000000
	EP_Subquery                           = 0x200000
	EP_Subrtn                             = 0x2000000
	EP_TokenOnly                          = 0x004000
	EP_Unlikely                           = 0x040000
	EP_VarSelect                          = 0x000020
	EP_Win                                = 0x008000
	EP_WinFunc                            = 0x1000000
	EP_xIsSelect                          = 0x000800
	ERANGE                                = 34
	EREMCHG                               = 78
	EREMOTE                               = 66
	EREMOTEIO                             = 121
	ERESTART                              = 85
	ERFKILL                               = 132
	EROFS                                 = 30
	ESHUTDOWN                             = 108
	ESOCKTNOSUPPORT                       = 94
	ESPIPE                                = 29
	ESRCH                                 = 3
	ESRMNT                                = 69
	ESTALE                                = 116
	ESTRPIPE                              = 86
	ETIME                                 = 62
	ETIMEDOUT                             = 110
	ETOOMANYREFS                          = 109
	ETXTBSY                               = 26
	EUCLEAN                               = 117
	EUNATCH                               = 49
	EUSERS                                = 87
	EWOULDBLOCK                           = 11
	EXCLUDED_TABLE_NUMBER                 = 2
	EXCLUSIVE_LOCK                        = 4
	EXDEV                                 = 18
	EXFULL                                = 54
	EXIT_FAILURE                          = 1
	EXIT_SUCCESS                          = 0
	EXPRDUP_REDUCE                        = 0x0001
	F2FS_FEATURE_ATOMIC_WRITE             = 0x0004
	F2FS_IOCTL_MAGIC                      = 0xf5
	F2FS_IOC_ABORT_VOLATILE_WRITE         = 62725
	F2FS_IOC_COMMIT_ATOMIC_WRITE          = 62722
	F2FS_IOC_START_ATOMIC_WRITE           = 62721
	F2FS_IOC_START_VOLATILE_WRITE         = 62723
	FALLOC_FL_COLLAPSE_RANGE              = 0x08
	FALLOC_FL_INSERT_RANGE                = 0x20
	FALLOC_FL_KEEP_SIZE                   = 0x01
	FALLOC_FL_NO_HIDE_STALE               = 0x04
	FALLOC_FL_PUNCH_HOLE                  = 0x02
	FALLOC_FL_UNSHARE_RANGE               = 0x40
	FALLOC_FL_ZERO_RANGE                  = 0x10
	FAPPEND                               = 1024
	FASYNC                                = 8192
	FD_CLOEXEC                            = 1
	FD_SETSIZE                            = 1024
	FFSYNC                                = 1052672
	FILENAME_MAX                          = 4096
	FIOASYNC                              = 0x5452
	FIOCLEX                               = 0x5451
	FIONBIO                               = 0x5421
	FIONCLEX                              = 0x5450
	FIONREAD                              = 0x541B
	FIOQSIZE                              = 0x5460
	FLAG_SIGNED                           = 1
	FLAG_STRING                           = 4
	FNDELAY                               = 2048
	FNONBLOCK                             = 2048
	FOPEN_MAX                             = 16
	FP_ILOGB0                             = -2147483648
	FP_ILOGBNAN                           = -2147483648
	FP_INFINITE1                          = 1
	FP_INT_DOWNWARD1                      = 1
	FP_INT_TONEAREST1                     = 4
	FP_INT_TONEARESTFROMZERO1             = 3
	FP_INT_TOWARDZERO1                    = 2
	FP_INT_UPWARD1                        = 0
	FP_LLOGB0                             = -9223372036854775808
	FP_LLOGBNAN                           = -9223372036854775808
	FP_NAN1                               = 0
	FP_NORMAL1                            = 4
	FP_SUBNORMAL1                         = 3
	FP_ZERO1                              = 2
	FTS5CSR_EOF                           = 0x01
	FTS5CSR_FREE_ZRANK                    = 0x10
	FTS5CSR_REQUIRE_CONTENT               = 0x02
	FTS5CSR_REQUIRE_DOCSIZE               = 0x04
	FTS5CSR_REQUIRE_INST                  = 0x08
	FTS5CSR_REQUIRE_POSLIST               = 0x40
	FTS5CSR_REQUIRE_RESEEK                = 0x20
	FTS5INDEX_QUERY_DESC                  = 0x0002
	FTS5INDEX_QUERY_NOOUTPUT              = 0x0020
	FTS5INDEX_QUERY_PREFIX                = 0x0001
	FTS5INDEX_QUERY_SCAN                  = 0x0008
	FTS5INDEX_QUERY_SKIPEMPTY             = 0x0010
	FTS5INDEX_QUERY_TEST_NOIDX            = 0x0004
	FTS5_AND                              = 2
	FTS5_AVERAGES_ROWID                   = 1
	FTS5_BI_MATCH                         = 0x0001
	FTS5_BI_ORDER_DESC                    = 0x0080
	FTS5_BI_ORDER_RANK                    = 0x0020
	FTS5_BI_ORDER_ROWID                   = 0x0040
	FTS5_BI_RANK                          = 0x0002
	FTS5_BI_ROWID_EQ                      = 0x0004
	FTS5_BI_ROWID_GE                      = 0x0010
	FTS5_BI_ROWID_LE                      = 0x0008
	FTS5_CARET                            = 12
	FTS5_COLON                            = 5
	FTS5_COMMA                            = 13
	FTS5_CONTENT_EXTERNAL                 = 2
	FTS5_CONTENT_NONE                     = 1
	FTS5_CONTENT_NORMAL                   = 0
	FTS5_CORRUPT                          = 267
	FTS5_CURRENT_VERSION                  = 4
	FTS5_DATA_DLI_B                       = 1
	FTS5_DATA_HEIGHT_B                    = 5
	FTS5_DATA_ID_B                        = 16
	FTS5_DATA_PADDING                     = 20
	FTS5_DATA_PAGE_B                      = 31
	FTS5_DATA_ZERO_PADDING                = 8
	FTS5_DEFAULT_AUTOMERGE                = 4
	FTS5_DEFAULT_CRISISMERGE              = 16
	FTS5_DEFAULT_HASHSIZE                 = 1048576
	FTS5_DEFAULT_NEARDIST                 = 10
	FTS5_DEFAULT_PAGE_SIZE                = 4050
	FTS5_DEFAULT_RANK                     = "bm25"
	FTS5_DEFAULT_USERMERGE                = 4
	FTS5_DETAIL_COLUMNS                   = 2
	FTS5_DETAIL_FULL                      = 0
	FTS5_DETAIL_NONE                      = 1
	FTS5_EOF                              = 0
	FTS5_LCP                              = 7
	FTS5_LP                               = 10
	FTS5_MAIN_PREFIX                      = 48
	FTS5_MAX_PAGE_SIZE                    = 65536
	FTS5_MAX_PREFIX_INDEXES               = 31
	FTS5_MAX_SEGMENT                      = 2000
	FTS5_MAX_TOKEN_SIZE                   = 32768
	FTS5_MERGE_NLIST                      = 16
	FTS5_MINUS                            = 6
	FTS5_MIN_DLIDX_SIZE                   = 4
	FTS5_NOT                              = 3
	FTS5_OPT_WORK_UNIT                    = 1000
	FTS5_OR                               = 1
	FTS5_PATTERN_GLOB                     = 66
	FTS5_PATTERN_LIKE                     = 65
	FTS5_PATTERN_NONE                     = 0
	FTS5_PLAN_MATCH                       = 1
	FTS5_PLAN_ROWID                       = 6
	FTS5_PLAN_SCAN                        = 5
	FTS5_PLAN_SORTED_MATCH                = 4
	FTS5_PLAN_SOURCE                      = 2
	FTS5_PLAN_SPECIAL                     = 3
	FTS5_PLUS                             = 14
	FTS5_PORTER_MAX_TOKEN                 = 64
	FTS5_RANK_NAME                        = "rank"
	FTS5_RCP                              = 8
	FTS5_REMOVE_DIACRITICS_COMPLEX        = 2
	FTS5_REMOVE_DIACRITICS_NONE           = 0
	FTS5_REMOVE_DIACRITICS_SIMPLE         = 1
	FTS5_ROWID_NAME                       = "rowid"
	FTS5_RP                               = 11
	FTS5_SEGITER_ONETERM                  = 0x01
	FTS5_SEGITER_REVERSE                  = 0x02
	FTS5_STAR                             = 15
	FTS5_STMT_DELETE_CONTENT              = 5
	FTS5_STMT_DELETE_DOCSIZE              = 7
	FTS5_STMT_INSERT_CONTENT              = 3
	FTS5_STMT_LOOKUP                      = 2
	FTS5_STMT_LOOKUP_DOCSIZE              = 8
	FTS5_STMT_REPLACE_CONFIG              = 9
	FTS5_STMT_REPLACE_CONTENT             = 4
	FTS5_STMT_REPLACE_DOCSIZE             = 6
	FTS5_STMT_SCAN                        = 10
	FTS5_STMT_SCAN_ASC                    = 0
	FTS5_STMT_SCAN_DESC                   = 1
	FTS5_STRING                           = 9
	FTS5_STRUCTURE_ROWID                  = 10
	FTS5_TERM                             = 4
	FTS5_TOKENIZE_AUX                     = 0x0008
	FTS5_TOKENIZE_DOCUMENT                = 0x0004
	FTS5_TOKENIZE_PREFIX                  = 0x0002
	FTS5_TOKENIZE_QUERY                   = 0x0001
	FTS5_TOKEN_COLOCATED                  = 0x0001
	FTS5_VOCAB_COL                        = 0
	FTS5_VOCAB_COL_SCHEMA                 = "term, col, doc, cnt"
	FTS5_VOCAB_INSTANCE                   = 2
	FTS5_VOCAB_INST_SCHEMA                = "term, doc, col, offset"
	FTS5_VOCAB_ROW                        = 1
	FTS5_VOCAB_ROW_SCHEMA                 = "term, doc, cnt"
	FTS5_VOCAB_TERM_EQ                    = 0x01
	FTS5_VOCAB_TERM_GE                    = 0x02
	FTS5_VOCAB_TERM_LE                    = 0x04
	FTS5_WORK_UNIT                        = 64
	FULLY_WITHIN                          = 2
	FUNC_PERFECT_MATCH                    = 6
	F_ADD_SEALS                           = 1033
	F_DUPFD                               = 0
	F_DUPFD_CLOEXEC                       = 1030
	F_EXLCK                               = 4
	F_GETFD                               = 1
	F_GETFL                               = 3
	F_GETLEASE                            = 1025
	F_GETLK                               = 5
	F_GETLK64                             = 5
	F_GETOWN                              = 9
	F_GETOWN_EX                           = 16
	F_GETPIPE_SZ                          = 1032
	F_GETSIG                              = 11
	F_GET_FILE_RW_HINT                    = 1037
	F_GET_RW_HINT                         = 1035
	F_GET_SEALS                           = 1034
	F_LOCK                                = 1
	F_NOTIFY                              = 1026
	F_OFD_GETLK                           = 36
	F_OFD_SETLK                           = 37
	F_OFD_SETLKW                          = 38
	F_OK                                  = 0
	F_RDLCK                               = 0
	F_SEAL_GROW                           = 0x0004
	F_SEAL_SEAL                           = 0x0001
	F_SEAL_SHRINK                         = 0x0002
	F_SEAL_WRITE                          = 0x0008
	F_SETFD                               = 2
	F_SETFL                               = 4
	F_SETLEASE                            = 1024
	F_SETLK                               = 6
	F_SETLK64                             = 6
	F_SETLKW                              = 7
	F_SETLKW64                            = 7
	F_SETOWN                              = 8
	F_SETOWN_EX                           = 15
	F_SETPIPE_SZ                          = 1031
	F_SETSIG                              = 10
	F_SET_FILE_RW_HINT                    = 1038
	F_SET_RW_HINT                         = 1036
	F_SHLCK                               = 8
	F_TEST                                = 3
	F_TLOCK                               = 2
	F_ULOCK                               = 0
	F_UNLCK                               = 2
	F_WRLCK                               = 1
	GCC_VERSION                           = 8003000
	GEOPOLY_PI                            = 3.1415926535897932385
	HASHSIZE                              = 97
	HASHTABLE_HASH_1                      = 383
	HASHTABLE_NPAGE                       = 4096
	HASHTABLE_NSLOT                       = 8192
	HAVE_FCHOWN                           = 1
	HAVE_FULLFSYNC                        = 0
	HAVE_GETHOSTUUID                      = 0
	HAVE_LSTAT                            = 1
	HAVE_MREMAP                           = 1
	HAVE_READLINK                         = 1
	HAVE_USLEEP                           = 1
	INCRINIT_NORMAL                       = 0
	INCRINIT_ROOT                         = 2
	INCRINIT_TASK                         = 1
	INITFLAG_AlterDrop                    = 0x0002
	INITFLAG_AlterRename                  = 0x0001
	INLINEFUNC_affinity                   = 4
	INLINEFUNC_coalesce                   = 0
	INLINEFUNC_expr_compare               = 3
	INLINEFUNC_expr_implies_expr          = 2
	INLINEFUNC_iif                        = 5
	INLINEFUNC_implies_nonnull_row        = 1
	INLINEFUNC_unlikely                   = 99
	INTERFACE                             = 1
	IN_INDEX_EPH                          = 2
	IN_INDEX_INDEX_ASC                    = 3
	IN_INDEX_INDEX_DESC                   = 4
	IN_INDEX_LOOP                         = 0x0004
	IN_INDEX_MEMBERSHIP                   = 0x0002
	IN_INDEX_NOOP                         = 5
	IN_INDEX_NOOP_OK                      = 0x0001
	IN_INDEX_ROWID                        = 1
	IOCSIZE_MASK                          = 1073676288
	IOCSIZE_SHIFT                         = 16
	IOC_IN                                = 1073741824
	IOC_INOUT                             = 3221225472
	IOC_OUT                               = 2147483648
	IsStat4                               = 1
	JEACH_ATOM                            = 3
	JEACH_FULLKEY                         = 6
	JEACH_ID                              = 4
	JEACH_JSON                            = 8
	JEACH_KEY                             = 0
	JEACH_PARENT                          = 5
	JEACH_PATH                            = 7
	JEACH_ROOT                            = 9
	JEACH_TYPE                            = 2
	JEACH_VALUE                           = 1
	JNODE_APPEND                          = 0x20
	JNODE_ESCAPE                          = 0x02
	JNODE_LABEL                           = 0x40
	JNODE_PATCH                           = 0x10
	JNODE_RAW                             = 0x01
	JNODE_REMOVE                          = 0x04
	JNODE_REPLACE                         = 0x08
	JSON_ARRAY                            = 6
	JSON_CACHE_ID                         = -429938
	JSON_CACHE_SZ                         = 4
	JSON_FALSE                            = 2
	JSON_INT                              = 3
	JSON_MAX_DEPTH                        = 2000
	JSON_NULL                             = 0
	JSON_OBJECT                           = 7
	JSON_REAL                             = 4
	JSON_STRING                           = 5
	JSON_SUBTYPE                          = 74
	JSON_TRUE                             = 1
	JT_CROSS                              = 0x0002
	JT_ERROR                              = 0x0040
	JT_INNER                              = 0x0001
	JT_LEFT                               = 0x0008
	JT_NATURAL                            = 0x0004
	JT_OUTER                              = 0x0020
	JT_RIGHT                              = 0x0010
	KEYINFO_ORDER_BIGNULL                 = 0x02
	KEYINFO_ORDER_DESC                    = 0x01
	LITTLE_ENDIAN                         = 1234
	LM_ID_BASE                            = 0
	LM_ID_NEWLM                           = -1
	LOCATE_NOERR                          = 0x02
	LOCATE_VIEW                           = 0x01
	LOCK_EX                               = 2
	LOCK_MAND                             = 32
	LOCK_NB                               = 4
	LOCK_READ                             = 64
	LOCK_RW                               = 192
	LOCK_SH                               = 1
	LOCK_UN                               = 8
	LOCK_WRITE                            = 128
	LOOKASIDE_SMALL                       = 128
	L_INCR                                = 1
	L_SET                                 = 0
	L_XTND                                = 2
	L_ctermid                             = 9
	L_cuserid                             = 9
	L_tmpnam                              = 20
	M10d_Any                              = 1
	M10d_No                               = 2
	M10d_Yes                              = 0
	MADV_DODUMP                           = 17
	MADV_DOFORK                           = 11
	MADV_DONTDUMP                         = 16
	MADV_DONTFORK                         = 10
	MADV_DONTNEED                         = 4
	MADV_FREE                             = 8
	MADV_HUGEPAGE                         = 14
	MADV_HWPOISON                         = 100
	MADV_KEEPONFORK                       = 19
	MADV_MERGEABLE                        = 12
	MADV_NOHUGEPAGE                       = 15
	MADV_NORMAL                           = 0
	MADV_RANDOM                           = 1
	MADV_REMOVE                           = 9
	MADV_SEQUENTIAL                       = 2
	MADV_UNMERGEABLE                      = 13
	MADV_WILLNEED                         = 3
	MADV_WIPEONFORK                       = 18
	MAP_32BIT                             = 0x40
	MAP_ANON                              = 32
	MAP_ANONYMOUS                         = 0x20
	MAP_DENYWRITE                         = 0x00800
	MAP_EXECUTABLE                        = 0x01000
	MAP_FILE                              = 0
	MAP_FIXED                             = 0x10
	MAP_FIXED_NOREPLACE                   = 0x100000
	MAP_GROWSDOWN                         = 0x00100
	MAP_HUGETLB                           = 0x40000
	MAP_HUGE_MASK                         = 0x3f
	MAP_HUGE_SHIFT                        = 26
	MAP_LOCKED                            = 0x02000
	MAP_NONBLOCK                          = 0x10000
	MAP_NORESERVE                         = 0x04000
	MAP_POPULATE                          = 0x08000
	MAP_PRIVATE                           = 0x02
	MAP_SHARED                            = 0x01
	MAP_SHARED_VALIDATE                   = 0x03
	MAP_STACK                             = 0x20000
	MAP_SYNC                              = 0x80000
	MAP_TYPE                              = 0x0f
	MATH_ERREXCEPT                        = 2
	MATH_ERRNO                            = 1
	MAXFLOAT                              = 3.40282347e+38
	MAX_HANDLE_SZ                         = 128
	MAX_PATHNAME                          = 512
	MAX_SECTOR_SIZE                       = 0x10000
	MCL_CURRENT                           = 1
	MCL_FUTURE                            = 2
	MCL_ONFAULT                           = 4
	MEMJOURNAL_DFLT_FILECHUNKSIZE         = 1024
	MEMTYPE_HEAP                          = 0x01
	MEMTYPE_LOOKASIDE                     = 0x02
	MEMTYPE_PCACHE                        = 0x04
	MEM_AffMask                           = 0x003f
	MEM_Agg                               = 0x2000
	MEM_Blob                              = 0x0010
	MEM_Cleared                           = 0x0100
	MEM_Dyn                               = 0x0400
	MEM_Ephem                             = 0x1000
	MEM_FromBind                          = 0x0040
	MEM_Int                               = 0x0004
	MEM_IntReal                           = 0x0020
	MEM_Null                              = 0x0001
	MEM_Real                              = 0x0008
	MEM_Static                            = 0x0800
	MEM_Str                               = 0x0002
	MEM_Subtype                           = 0x8000
	MEM_Term                              = 0x0200
	MEM_TypeMask                          = 0xc1bf
	MEM_Undefined                         = 0x0080
	MEM_Zero                              = 0x4000
	MFD_ALLOW_SEALING                     = 2
	MFD_CLOEXEC                           = 1
	MFD_HUGETLB                           = 4
	MLOCK_ONFAULT                         = 1
	MOD_CLKA                              = 32769
	MOD_CLKB                              = 16384
	MOD_ESTERROR                          = 8
	MOD_FREQUENCY                         = 2
	MOD_MAXERROR                          = 4
	MOD_MICRO                             = 4096
	MOD_NANO                              = 8192
	MOD_OFFSET                            = 1
	MOD_STATUS                            = 16
	MOD_TAI                               = 128
	MOD_TIMECONST                         = 32
	MREMAP_FIXED                          = 2
	MREMAP_MAYMOVE                        = 1
	MSVC_VERSION                          = 0
	MS_ASYNC                              = 1
	MS_INVALIDATE                         = 2
	MS_SYNC                               = 4
	M_1_PI                                = 0.31830988618379067154
	M_1_PIf128                            = 0
	M_1_PIf32                             = 0
	M_1_PIf32x                            = 0
	M_1_PIf64                             = 0
	M_1_PIf64x                            = 0
	M_1_PIl                               = 0.318309886183790671537767526745028724
	M_2_PI                                = 0.63661977236758134308
	M_2_PIf128                            = 0
	M_2_PIf32                             = 0
	M_2_PIf32x                            = 0
	M_2_PIf64                             = 0
	M_2_PIf64x                            = 0
	M_2_PIl                               = 0.636619772367581343075535053490057448
	M_2_SQRTPI                            = 1.12837916709551257390
	M_2_SQRTPIf128                        = 0
	M_2_SQRTPIf32                         = 0
	M_2_SQRTPIf32x                        = 0
	M_2_SQRTPIf64                         = 0
	M_2_SQRTPIf64x                        = 0
	M_2_SQRTPIl                           = 1.128379167095512573896158903121545172
	M_E                                   = 2.7182818284590452354
	M_Ef128                               = 0
	M_Ef32                                = 0
	M_Ef32x                               = 0
	M_Ef64                                = 0
	M_Ef64x                               = 0
	M_El                                  = 2.718281828459045235360287471352662498
	M_LN10                                = 2.30258509299404568402
	M_LN10f128                            = 0
	M_LN10f32                             = 0
	M_LN10f32x                            = 0
	M_LN10f64                             = 0
	M_LN10f64x                            = 0
	M_LN10l                               = 2.302585092994045684017991454684364208
	M_LN2                                 = 0.69314718055994530942
	M_LN2f128                             = 0
	M_LN2f32                              = 0
	M_LN2f32x                             = 0
	M_LN2f64                              = 0
	M_LN2f64x                             = 0
	M_LN2l                                = 0.693147180559945309417232121458176568
	M_LOG10E                              = 0.43429448190325182765
	M_LOG10Ef128                          = 0
	M_LOG10Ef32                           = 0
	M_LOG10Ef32x                          = 0
	M_LOG10Ef64                           = 0
	M_LOG10Ef64x                          = 0
	M_LOG10El                             = 0.434294481903251827651128918916605082
	M_LOG2E                               = 1.4426950408889634074
	M_LOG2Ef128                           = 0
	M_LOG2Ef32                            = 0
	M_LOG2Ef32x                           = 0
	M_LOG2Ef64                            = 0
	M_LOG2Ef64x                           = 0
	M_LOG2El                              = 1.442695040888963407359924681001892137
	M_PI                                  = 3.14159265358979323846
	M_PI_2                                = 1.57079632679489661923
	M_PI_2f128                            = 0
	M_PI_2f32                             = 0
	M_PI_2f32x                            = 0
	M_PI_2f64                             = 0
	M_PI_2f64x                            = 0
	M_PI_2l                               = 1.570796326794896619231321691639751442
	M_PI_4                                = 0.78539816339744830962
	M_PI_4f128                            = 0
	M_PI_4f32                             = 0
	M_PI_4f32x                            = 0
	M_PI_4f64                             = 0
	M_PI_4f64x                            = 0
	M_PI_4l                               = 0.785398163397448309615660845819875721
	M_PIf128                              = 0
	M_PIf32                               = 0
	M_PIf32x                              = 0
	M_PIf64                               = 0
	M_PIf64x                              = 0
	M_PIl                                 = 3.141592653589793238462643383279502884
	M_SQRT1_2                             = 0.70710678118654752440
	M_SQRT1_2f128                         = 0
	M_SQRT1_2f32                          = 0
	M_SQRT1_2f32x                         = 0
	M_SQRT1_2f64                          = 0
	M_SQRT1_2f64x                         = 0
	M_SQRT1_2l                            = 0.707106781186547524400844362104849039
	M_SQRT2                               = 1.41421356237309504880
	M_SQRT2f128                           = 0
	M_SQRT2f32                            = 0
	M_SQRT2f32x                           = 0
	M_SQRT2f64                            = 0
	M_SQRT2f64x                           = 0
	M_SQRT2l                              = 1.414213562373095048801688724209698079
	NB                                    = 3
	NCC                                   = 8
	NC_AllowAgg                           = 0x00001
	NC_AllowWin                           = 0x04000
	NC_Complex                            = 0x02000
	NC_FromDDL                            = 0x40000
	NC_GenCol                             = 0x00008
	NC_HasAgg                             = 0x00010
	NC_HasWin                             = 0x08000
	NC_IdxExpr                            = 0x00020
	NC_InAggFunc                          = 0x20000
	NC_IsCheck                            = 0x00004
	NC_IsDDL                              = 0x10000
	NC_MinMaxAgg                          = 0x01000
	NC_NoSelect                           = 0x80000
	NC_PartIdx                            = 0x00002
	NC_SelfRef                            = 0x0002e
	NC_UAggInfo                           = 0x00100
	NC_UBaseReg                           = 0x00400
	NC_UEList                             = 0x00080
	NC_UUpsert                            = 0x00200
	NC_VarSelect                          = 0x00040
	NDEBUG                                = 1
	NN                                    = 1
	NOT_WITHIN                            = 0
	NO_LOCK                               = 0
	N_6PACK                               = 7
	N_AX25                                = 5
	N_HCI                                 = 15
	N_HDLC                                = 13
	N_IRDA                                = 11
	N_MASC                                = 8
	N_MOUSE                               = 2
	N_OR_COST                             = 3
	N_PPP                                 = 3
	N_PROFIBUS_FDL                        = 10
	N_R3964                               = 9
	N_SLIP                                = 1
	N_SMSBLOCK                            = 12
	N_SORT_BUCKET                         = 32
	N_STATEMENT                           = 8
	N_STRIP                               = 4
	N_SYNC_PPP                            = 14
	N_TTY                                 = 0
	N_X25                                 = 6
	OE_Abort                              = 2
	OE_Cascade                            = 10
	OE_Default                            = 11
	OE_Fail                               = 3
	OE_Ignore                             = 4
	OE_None                               = 0
	OE_Replace                            = 5
	OE_Restrict                           = 7
	OE_Rollback                           = 1
	OE_SetDflt                            = 9
	OE_SetNull                            = 8
	OE_Update                             = 6
	OMIT_TEMPDB                           = 0
	ONEPASS_MULTI                         = 2
	ONEPASS_OFF                           = 0
	ONEPASS_SINGLE                        = 1
	OPFLAG_APPEND                         = 0x08
	OPFLAG_AUXDELETE                      = 0x04
	OPFLAG_BULKCSR                        = 0x01
	OPFLAG_EPHEM                          = 0x01
	OPFLAG_FORDELETE                      = 0x08
	OPFLAG_ISNOOP                         = 0x40
	OPFLAG_ISUPDATE                       = 0x04
	OPFLAG_LASTROWID                      = 0x20
	OPFLAG_LENGTHARG                      = 0x40
	OPFLAG_NCHANGE                        = 0x01
	OPFLAG_NOCHNG                         = 0x01
	OPFLAG_NOCHNG_MAGIC                   = 0x6d
	OPFLAG_P2ISREG                        = 0x10
	OPFLAG_PERMUTE                        = 0x01
	OPFLAG_PREFORMAT                      = 0x80
	OPFLAG_SAVEPOSITION                   = 0x02
	OPFLAG_SEEKEQ                         = 0x02
	OPFLAG_TYPEOFARG                      = 0x80
	OPFLAG_USESEEKRESULT                  = 0x10
	OPFLG_IN1                             = 0x02
	OPFLG_IN2                             = 0x04
	OPFLG_IN3                             = 0x08
	OPFLG_JUMP                            = 0x01
	OPFLG_OUT2                            = 0x10
	OPFLG_OUT3                            = 0x20
	OP_Abortable                          = 179
	OP_Add                                = 106
	OP_AddImm                             = 83
	OP_Affinity                           = 92
	OP_AggFinal                           = 161
	OP_AggInverse                         = 157
	OP_AggStep                            = 158
	OP_AggStep1                           = 159
	OP_AggValue                           = 160
	OP_And                                = 44
	OP_AutoCommit                         = 1
	OP_BitAnd                             = 102
	OP_BitNot                             = 113
	OP_BitOr                              = 103
	OP_Blob                               = 74
	OP_Cast                               = 85
	OP_Checkpoint                         = 6
	OP_ChngCntRow                         = 80
	OP_Clear                              = 141
	OP_Close                              = 118
	OP_CollSeq                            = 82
	OP_Column                             = 91
	OP_ColumnsUsed                        = 119
	OP_Compare                            = 87
	OP_Concat                             = 111
	OP_Copy                               = 77
	OP_Count                              = 94
	OP_CreateBtree                        = 143
	OP_CursorHint                         = 175
	OP_CursorLock                         = 163
	OP_CursorUnlock                       = 164
	OP_DecrJumpZero                       = 59
	OP_DeferredSeek                       = 137
	OP_Delete                             = 126
	OP_Destroy                            = 140
	OP_Divide                             = 109
	OP_DropIndex                          = 148
	OP_DropTable                          = 147
	OP_DropTrigger                        = 149
	OP_ElseEq                             = 58
	OP_EndCoroutine                       = 66
	OP_Eq                                 = 53
	OP_Expire                             = 162
	OP_Explain                            = 178
	OP_FinishSeek                         = 139
	OP_FkCounter                          = 154
	OP_FkIfZero                           = 47
	OP_Found                              = 30
	OP_Function                           = 64
	OP_Ge                                 = 57
	OP_Gosub                              = 12
	OP_Goto                               = 11
	OP_Gt                                 = 54
	OP_Halt                               = 68
	OP_HaltIfNull                         = 67
	OP_IdxDelete                          = 136
	OP_IdxGE                              = 41
	OP_IdxGT                              = 39
	OP_IdxInsert                          = 134
	OP_IdxLE                              = 38
	OP_IdxLT                              = 40
	OP_IdxRowid                           = 138
	OP_If                                 = 18
	OP_IfNoHope                           = 27
	OP_IfNot                              = 20
	OP_IfNotOpen                          = 26
	OP_IfNotZero                          = 49
	OP_IfNullRow                          = 21
	OP_IfPos                              = 48
	OP_IfSmaller                          = 34
	OP_IncrVacuum                         = 60
	OP_Init                               = 62
	OP_InitCoroutine                      = 13
	OP_Insert                             = 124
	OP_Int64                              = 70
	OP_IntCopy                            = 79
	OP_Integer                            = 69
	OP_IntegrityCk                        = 150
	OP_IsNull                             = 50
	OP_IsTrue                             = 88
	OP_JournalMode                        = 7
	OP_Jump                               = 16
	OP_Last                               = 33
	OP_Le                                 = 55
	OP_LoadAnalysis                       = 146
	OP_Lt                                 = 56
	OP_MakeRecord                         = 93
	OP_MaxPgcnt                           = 173
	OP_MemMax                             = 155
	OP_Move                               = 76
	OP_Multiply                           = 108
	OP_MustBeInt                          = 15
	OP_Ne                                 = 52
	OP_NewRowid                           = 123
	OP_Next                               = 5
	OP_NoConflict                         = 28
	OP_Noop                               = 177
	OP_Not                                = 19
	OP_NotExists                          = 32
	OP_NotFound                           = 29
	OP_NotNull                            = 51
	OP_Null                               = 72
	OP_NullRow                            = 132
	OP_Offset                             = 90
	OP_OffsetLimit                        = 156
	OP_Once                               = 17
	OP_OpenAutoindex                      = 101
	OP_OpenDup                            = 100
	OP_OpenEphemeral                      = 112
	OP_OpenPseudo                         = 117
	OP_OpenRead                           = 98
	OP_OpenWrite                          = 99
	OP_Or                                 = 43
	OP_Pagecount                          = 172
	OP_Param                              = 153
	OP_ParseSchema                        = 145
	OP_Permutation                        = 86
	OP_Prev                               = 4
	OP_Program                            = 46
	OP_PureFunc                           = 63
	OP_ReadCookie                         = 95
	OP_Real                               = 152
	OP_RealAffinity                       = 84
	OP_ReleaseReg                         = 176
	OP_Remainder                          = 110
	OP_ReopenIdx                          = 97
	OP_ResetCount                         = 127
	OP_ResetSorter                        = 142
	OP_ResultRow                          = 81
	OP_Return                             = 65
	OP_Rewind                             = 37
	OP_RowCell                            = 125
	OP_RowData                            = 130
	OP_RowSetAdd                          = 151
	OP_RowSetRead                         = 42
	OP_RowSetTest                         = 45
	OP_Rowid                              = 131
	OP_SCopy                              = 78
	OP_Savepoint                          = 0
	OP_SeekEnd                            = 133
	OP_SeekGE                             = 24
	OP_SeekGT                             = 25
	OP_SeekHit                            = 121
	OP_SeekLE                             = 23
	OP_SeekLT                             = 22
	OP_SeekRowid                          = 31
	OP_SeekScan                           = 120
	OP_Sequence                           = 122
	OP_SequenceTest                       = 115
	OP_SetCookie                          = 96
	OP_ShiftLeft                          = 104
	OP_ShiftRight                         = 105
	OP_SoftNull                           = 73
	OP_Sort                               = 36
	OP_SorterCompare                      = 128
	OP_SorterData                         = 129
	OP_SorterInsert                       = 135
	OP_SorterNext                         = 3
	OP_SorterOpen                         = 114
	OP_SorterSort                         = 35
	OP_SqlExec                            = 144
	OP_String                             = 71
	OP_String8                            = 116
	OP_Subtract                           = 107
	OP_TableLock                          = 165
	OP_Trace                              = 174
	OP_Transaction                        = 2
	OP_VBegin                             = 166
	OP_VColumn                            = 170
	OP_VCreate                            = 167
	OP_VDestroy                           = 168
	OP_VFilter                            = 9
	OP_VNext                              = 61
	OP_VOpen                              = 169
	OP_VRename                            = 171
	OP_VUpdate                            = 10
	OP_Vacuum                             = 8
	OP_Variable                           = 75
	OP_Yield                              = 14
	OP_ZeroOrNull                         = 89
	OS_VXWORKS                            = 0
	O_ACCMODE                             = 0003
	O_APPEND                              = 02000
	O_ASYNC                               = 020000
	O_BINARY                              = 0
	O_CLOEXEC                             = 524288
	O_CREAT                               = 0100
	O_DIRECT                              = 16384
	O_DIRECTORY                           = 65536
	O_DSYNC                               = 4096
	O_EXCL                                = 0200
	O_FSYNC                               = 1052672
	O_LARGEFILE                           = 0
	O_NDELAY                              = 2048
	O_NOATIME                             = 262144
	O_NOCTTY                              = 0400
	O_NOFOLLOW                            = 131072
	O_NONBLOCK                            = 04000
	O_PATH                                = 2097152
	O_RDONLY                              = 00
	O_RDWR                                = 02
	O_RSYNC                               = 1052672
	O_SYNC                                = 04010000
	O_TMPFILE                             = 4259840
	O_TRUNC                               = 01000
	O_WRONLY                              = 01
	P4_ADVANCE                            = -5
	P4_COLLSEQ                            = -2
	P4_DYNAMIC                            = -7
	P4_DYNBLOB                            = -17
	P4_EXPR                               = -10
	P4_FREE_IF_LE                         = -7
	P4_FUNCCTX                            = -16
	P4_FUNCDEF                            = -8
	P4_INT32                              = -3
	P4_INT64                              = -14
	P4_INTARRAY                           = -15
	P4_KEYINFO                            = -9
	P4_MEM                                = -11
	P4_NOTUSED                            = 0
	P4_REAL                               = -13
	P4_STATIC                             = -1
	P4_SUBPROGRAM                         = -4
	P4_TABLE                              = -6
	P4_TRANSIENT                          = 0
	P4_VTAB                               = -12
	P5_ConstraintCheck                    = 3
	P5_ConstraintFK                       = 4
	P5_ConstraintNotNull                  = 1
	P5_ConstraintUnique                   = 2
	PAGER_CACHESPILL                      = 0x20
	PAGER_CKPT_FULLFSYNC                  = 0x10
	PAGER_ERROR                           = 6
	PAGER_FLAGS_MASK                      = 0x38
	PAGER_FULLFSYNC                       = 0x08
	PAGER_GET_NOCONTENT                   = 0x01
	PAGER_GET_READONLY                    = 0x02
	PAGER_JOURNALMODE_DELETE              = 0
	PAGER_JOURNALMODE_MEMORY              = 4
	PAGER_JOURNALMODE_OFF                 = 2
	PAGER_JOURNALMODE_PERSIST             = 1
	PAGER_JOURNALMODE_QUERY               = -1
	PAGER_JOURNALMODE_TRUNCATE            = 3
	PAGER_JOURNALMODE_WAL                 = 5
	PAGER_LOCKINGMODE_EXCLUSIVE           = 1
	PAGER_LOCKINGMODE_NORMAL              = 0
	PAGER_LOCKINGMODE_QUERY               = -1
	PAGER_MEMORY                          = 0x0002
	PAGER_OMIT_JOURNAL                    = 0x0001
	PAGER_OPEN                            = 0
	PAGER_READER                          = 1
	PAGER_STAT_HIT                        = 0
	PAGER_STAT_MISS                       = 1
	PAGER_STAT_SPILL                      = 3
	PAGER_STAT_WRITE                      = 2
	PAGER_SYNCHRONOUS_EXTRA               = 0x04
	PAGER_SYNCHRONOUS_FULL                = 0x03
	PAGER_SYNCHRONOUS_MASK                = 0x07
	PAGER_SYNCHRONOUS_NORMAL              = 0x02
	PAGER_SYNCHRONOUS_OFF                 = 0x01
	PAGER_WRITER_CACHEMOD                 = 3
	PAGER_WRITER_DBMOD                    = 4
	PAGER_WRITER_FINISHED                 = 5
	PAGER_WRITER_LOCKED                   = 2
	PARSE_MODE_DECLARE_VTAB               = 1
	PARSE_MODE_NORMAL                     = 0
	PARSE_MODE_RENAME                     = 2
	PARSE_MODE_UNMAP                      = 3
	PARTLY_WITHIN                         = 1
	PCACHE1_MIGHT_USE_GROUP_MUTEX         = 1
	PCACHE_DIRTYLIST_ADD                  = 2
	PCACHE_DIRTYLIST_FRONT                = 3
	PCACHE_DIRTYLIST_REMOVE               = 1
	PDP_ENDIAN                            = 3412
	PENDING_LOCK                          = 3
	PGHDR_CLEAN                           = 0x001
	PGHDR_DIRTY                           = 0x002
	PGHDR_DONT_WRITE                      = 0x010
	PGHDR_MMAP                            = 0x020
	PGHDR_NEED_SYNC                       = 0x008
	PGHDR_WAL_APPEND                      = 0x040
	PGHDR_WRITEABLE                       = 0x004
	PKEY_DISABLE_ACCESS                   = 0x1
	PKEY_DISABLE_WRITE                    = 0x2
	POSIX_FADV_DONTNEED                   = 4
	POSIX_FADV_NOREUSE                    = 5
	POSIX_FADV_NORMAL                     = 0
	POSIX_FADV_RANDOM                     = 1
	POSIX_FADV_SEQUENTIAL                 = 2
	POSIX_FADV_WILLNEED                   = 3
	POSIX_MADV_DONTNEED                   = 4
	POSIX_MADV_NORMAL                     = 0
	POSIX_MADV_RANDOM                     = 1
	POSIX_MADV_SEQUENTIAL                 = 2
	POSIX_MADV_WILLNEED                   = 3
	PROT_EXEC                             = 0x4
	PROT_GROWSDOWN                        = 0x01000000
	PROT_GROWSUP                          = 0x02000000
	PROT_NONE                             = 0x0
	PROT_READ                             = 0x1
	PROT_WRITE                            = 0x2
	PTF_INTKEY                            = 0x01
	PTF_LEAF                              = 0x08
	PTF_LEAFDATA                          = 0x04
	PTF_ZERODATA                          = 0x02
	PTHREAD_BARRIER_SERIAL_THREAD         = -1
	PTHREAD_ONCE_INIT                     = 0
	PTRMAP_BTREE                          = 5
	PTRMAP_FREEPAGE                       = 2
	PTRMAP_OVERFLOW1                      = 3
	PTRMAP_OVERFLOW2                      = 4
	PTRMAP_ROOTPAGE                       = 1
	P_tmpdir                              = "/tmp"
	PragFlg_NeedSchema                    = 0x01
	PragFlg_NoColumns                     = 0x02
	PragFlg_NoColumns1                    = 0x04
	PragFlg_ReadOnly                      = 0x08
	PragFlg_Result0                       = 0x10
	PragFlg_Result1                       = 0x20
	PragFlg_SchemaOpt                     = 0x40
	PragFlg_SchemaReq                     = 0x80
	PragTyp_ACTIVATE_EXTENSIONS           = 0
	PragTyp_ANALYSIS_LIMIT                = 1
	PragTyp_AUTO_VACUUM                   = 3
	PragTyp_BUSY_TIMEOUT                  = 5
	PragTyp_CACHE_SIZE                    = 6
	PragTyp_CACHE_SPILL                   = 7
	PragTyp_CASE_SENSITIVE_LIKE           = 8
	PragTyp_COLLATION_LIST                = 9
	PragTyp_COMPILE_OPTIONS               = 10
	PragTyp_DATABASE_LIST                 = 12
	PragTyp_DATA_STORE_DIRECTORY          = 11
	PragTyp_DEFAULT_CACHE_SIZE            = 13
	PragTyp_ENCODING                      = 14
	PragTyp_FLAG                          = 4
	PragTyp_FOREIGN_KEY_CHECK             = 15
	PragTyp_FOREIGN_KEY_LIST              = 16
	PragTyp_FUNCTION_LIST                 = 17
	PragTyp_HARD_HEAP_LIMIT               = 18
	PragTyp_HEADER_VALUE                  = 2
	PragTyp_INCREMENTAL_VACUUM            = 19
	PragTyp_INDEX_INFO                    = 20
	PragTyp_INDEX_LIST                    = 21
	PragTyp_INTEGRITY_CHECK               = 22
	PragTyp_JOURNAL_MODE                  = 23
	PragTyp_JOURNAL_SIZE_LIMIT            = 24
	PragTyp_LOCKING_MODE                  = 26
	PragTyp_LOCK_PROXY_FILE               = 25
	PragTyp_LOCK_STATUS                   = 43
	PragTyp_MMAP_SIZE                     = 28
	PragTyp_MODULE_LIST                   = 29
	PragTyp_OPTIMIZE                      = 30
	PragTyp_PAGE_COUNT                    = 27
	PragTyp_PAGE_SIZE                     = 31
	PragTyp_PRAGMA_LIST                   = 32
	PragTyp_SECURE_DELETE                 = 33
	PragTyp_SHRINK_MEMORY                 = 34
	PragTyp_SOFT_HEAP_LIMIT               = 35
	PragTyp_STATS                         = 44
	PragTyp_SYNCHRONOUS                   = 36
	PragTyp_TABLE_INFO                    = 37
	PragTyp_TEMP_STORE                    = 38
	PragTyp_TEMP_STORE_DIRECTORY          = 39
	PragTyp_THREADS                       = 40
	PragTyp_WAL_AUTOCHECKPOINT            = 41
	PragTyp_WAL_CHECKPOINT                = 42
	RAND_MAX                              = 2147483647
	RBU_CREATE_STATE                      = "CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)"
	RBU_DELETE                            = 2
	RBU_ENABLE_DELTA_CKSUM                = 0
	RBU_IDX_DELETE                        = 4
	RBU_IDX_INSERT                        = 5
	RBU_INSERT                            = 1
	RBU_PK_EXTERNAL                       = 3
	RBU_PK_IPK                            = 2
	RBU_PK_NONE                           = 1
	RBU_PK_NOTABLE                        = 0
	RBU_PK_VTAB                           = 5
	RBU_PK_WITHOUT_ROWID                  = 4
	RBU_REPLACE                           = 3
	RBU_STAGE_CAPTURE                     = 3
	RBU_STAGE_CKPT                        = 4
	RBU_STAGE_DONE                        = 5
	RBU_STAGE_MOVE                        = 2
	RBU_STAGE_OAL                         = 1
	RBU_STATE_CKPT                        = 6
	RBU_STATE_COOKIE                      = 7
	RBU_STATE_DATATBL                     = 10
	RBU_STATE_IDX                         = 3
	RBU_STATE_OALSZ                       = 8
	RBU_STATE_PHASEONESTEP                = 9
	RBU_STATE_PROGRESS                    = 5
	RBU_STATE_ROW                         = 4
	RBU_STATE_STAGE                       = 1
	RBU_STATE_TBL                         = 2
	RBU_UPDATE                            = 6
	READMARK_NOT_USED                     = 0xffffffff
	READ_LOCK                             = 1
	RENAME_EXCHANGE                       = 2
	RENAME_NOREPLACE                      = 1
	RENAME_WHITEOUT                       = 4
	RESERVED_LOCK                         = 2
	RETURNING_TRIGGER_NAME                = "sqlite_returning"
	RNDAWAY                               = 0
	RNDTOWARDS                            = 0
	ROWSET_ALLOCATION_SIZE                = 1024
	ROWSET_NEXT                           = 0x02
	ROWSET_SORTED                         = 0x01
	RTLD_BINDING_MASK                     = 0x3
	RTLD_DEEPBIND                         = 0x00008
	RTLD_GLOBAL                           = 0x00100
	RTLD_LAZY                             = 0x00001
	RTLD_LOCAL                            = 0
	RTLD_NODELETE                         = 0x01000
	RTLD_NOLOAD                           = 0x00004
	RTLD_NOW                              = 0x00002
	RTREE_CACHE_SZ                        = 5
	RTREE_CHECK_MAX_ERROR                 = 100
	RTREE_COORD_INT32                     = 1
	RTREE_COORD_REAL32                    = 0
	RTREE_DEFAULT_ROWEST                  = 1048576
	RTREE_EQ                              = 0x41
	RTREE_FALSE                           = 0x40
	RTREE_GE                              = 0x44
	RTREE_GT                              = 0x45
	RTREE_LE                              = 0x42
	RTREE_LT                              = 0x43
	RTREE_MATCH                           = 0x46
	RTREE_MAXCELLS                        = 51
	RTREE_MAX_AUX_COLUMN                  = 100
	RTREE_MAX_DEPTH                       = 40
	RTREE_MAX_DIMENSIONS                  = 5
	RTREE_MIN_ROWEST                      = 100
	RTREE_QUERY                           = 0x47
	RTREE_TRUE                            = 0x3f
	RTREE_ZERO                            = 0.0
	RWF_WRITE_LIFE_NOT_SET                = 0
	RWH_WRITE_LIFE_EXTREME                = 5
	RWH_WRITE_LIFE_LONG                   = 4
	RWH_WRITE_LIFE_MEDIUM                 = 3
	RWH_WRITE_LIFE_NONE                   = 1
	RWH_WRITE_LIFE_SHORT                  = 2
	R_OK                                  = 4
	SAVEPOINT_BEGIN                       = 0
	SAVEPOINT_RELEASE                     = 1
	SAVEPOINT_ROLLBACK                    = 2
	SCHED_BATCH                           = 3
	SCHED_DEADLINE                        = 6
	SCHED_FIFO                            = 1
	SCHED_IDLE                            = 5
	SCHED_ISO                             = 4
	SCHED_OTHER                           = 0
	SCHED_RESET_ON_FORK                   = 0x40000000
	SCHED_RR                              = 2
	SCHEMA_ROOT                           = 1
	SEEK_CUR                              = 1
	SEEK_DATA                             = 3
	SEEK_END                              = 2
	SEEK_HOLE                             = 4
	SEEK_SET                              = 0
	SELECTTRACE_ENABLED                   = 0
	SF_Aggregate                          = 0x0000008
	SF_All                                = 0x0000002
	SF_ComplexResult                      = 0x0040000
	SF_Compound                           = 0x0000100
	SF_Converted                          = 0x0010000
	SF_CopyCte                            = 0x4000000
	SF_Distinct                           = 0x0000001
	SF_Expanded                           = 0x0000040
	SF_FixedLimit                         = 0x0004000
	SF_HasAgg                             = 0x0000010
	SF_HasTypeInfo                        = 0x0000080
	SF_IncludeHidden                      = 0x0020000
	SF_MaybeConvert                       = 0x0008000
	SF_MinMaxAgg                          = 0x0001000
	SF_MultiPart                          = 0x2000000
	SF_MultiValue                         = 0x0000400
	SF_NestedFrom                         = 0x0000800
	SF_NoopOrderBy                        = 0x0400000
	SF_PushDown                           = 0x1000000
	SF_Recursive                          = 0x0002000
	SF_Resolved                           = 0x0000004
	SF_UpdateFrom                         = 0x0800000
	SF_UsesEphemeral                      = 0x0000020
	SF_Values                             = 0x0000200
	SF_View                               = 0x0200000
	SF_WhereBegin                         = 0x0080000
	SF_WinRewrite                         = 0x0100000
	SHARED_LOCK                           = 1
	SHARED_SIZE                           = 510
	SIOCADDDLCI                           = 0x8980
	SIOCADDMULTI                          = 0x8931
	SIOCADDRT                             = 0x890B
	SIOCDARP                              = 0x8953
	SIOCDELDLCI                           = 0x8981
	SIOCDELMULTI                          = 0x8932
	SIOCDELRT                             = 0x890C
	SIOCDEVPRIVATE                        = 0x89F0
	SIOCDIFADDR                           = 0x8936
	SIOCDRARP                             = 0x8960
	SIOCGARP                              = 0x8954
	SIOCGIFADDR                           = 0x8915
	SIOCGIFBR                             = 0x8940
	SIOCGIFBRDADDR                        = 0x8919
	SIOCGIFCONF                           = 0x8912
	SIOCGIFCOUNT                          = 0x8938
	SIOCGIFDSTADDR                        = 0x8917
	SIOCGIFENCAP                          = 0x8925
	SIOCGIFFLAGS                          = 0x8913
	SIOCGIFHWADDR                         = 0x8927
	SIOCGIFINDEX                          = 0x8933
	SIOCGIFMAP                            = 0x8970
	SIOCGIFMEM                            = 0x891f
	SIOCGIFMETRIC                         = 0x891d
	SIOCGIFMTU                            = 0x8921
	SIOCGIFNAME                           = 0x8910
	SIOCGIFNETMASK                        = 0x891b
	SIOCGIFPFLAGS                         = 0x8935
	SIOCGIFSLAVE                          = 0x8929
	SIOCGIFTXQLEN                         = 0x8942
	SIOCGRARP                             = 0x8961
	SIOCPROTOPRIVATE                      = 0x89E0
	SIOCRTMSG                             = 0x890D
	SIOCSARP                              = 0x8955
	SIOCSIFADDR                           = 0x8916
	SIOCSIFBR                             = 0x8941
	SIOCSIFBRDADDR                        = 0x891a
	SIOCSIFDSTADDR                        = 0x8918
	SIOCSIFENCAP                          = 0x8926
	SIOCSIFFLAGS                          = 0x8914
	SIOCSIFHWADDR                         = 0x8924
	SIOCSIFHWBROADCAST                    = 0x8937
	SIOCSIFLINK                           = 0x8911
	SIOCSIFMAP                            = 0x8971
	SIOCSIFMEM                            = 0x8920
	SIOCSIFMETRIC                         = 0x891e
	SIOCSIFMTU                            = 0x8922
	SIOCSIFNAME                           = 0x8923
	SIOCSIFNETMASK                        = 0x891c
	SIOCSIFPFLAGS                         = 0x8934
	SIOCSIFSLAVE                          = 0x8930
	SIOCSIFTXQLEN                         = 0x8943
	SIOCSRARP                             = 0x8962
	SIOGIFINDEX                           = 35123
	SLOT_2_0                              = 0x001fc07f
	SLOT_4_2_0                            = 0xf01fc07f
	SORTER_MAX_MERGE_COUNT                = 16
	SORTER_TYPE_INTEGER                   = 0x01
	SORTER_TYPE_TEXT                      = 0x02
	SORTFLAG_UseSorter                    = 0x01
	SPILLFLAG_NOSYNC                      = 0x04
	SPILLFLAG_OFF                         = 0x01
	SPILLFLAG_ROLLBACK                    = 0x02
	SPLICE_F_GIFT                         = 8
	SPLICE_F_MORE                         = 4
	SPLICE_F_MOVE                         = 1
	SPLICE_F_NONBLOCK                     = 2
	SQLITE3EXT_H                          = 0
	SQLITE3_H                             = 0
	SQLITE3_TEXT                          = 3
	SQLITEINT_H                           = 0
	SQLITE_ABORT                          = 4
	SQLITE_ABORT_ROLLBACK                 = 516
	SQLITE_ACCESS_EXISTS                  = 0
	SQLITE_ACCESS_READ                    = 2
	SQLITE_ACCESS_READWRITE               = 1
	SQLITE_AFF_BLOB                       = 0x41
	SQLITE_AFF_INTEGER                    = 0x44
	SQLITE_AFF_MASK                       = 0x47
	SQLITE_AFF_NONE                       = 0x40
	SQLITE_AFF_NUMERIC                    = 0x43
	SQLITE_AFF_REAL                       = 0x45
	SQLITE_AFF_TEXT                       = 0x42
	SQLITE_ALLOW_COVERING_INDEX_SCAN      = 1
	SQLITE_ALTER_TABLE                    = 26
	SQLITE_AMALGAMATION                   = 1
	SQLITE_ANALYZE                        = 28
	SQLITE_ANY                            = 5
	SQLITE_API                            = 0
	SQLITE_APICALL                        = 0
	SQLITE_ASCII                          = 1
	SQLITE_ATTACH                         = 24
	SQLITE_AUTH                           = 23
	SQLITE_AUTH_USER                      = 279
	SQLITE_AllOpts                        = 0xffffffff
	SQLITE_AutoIndex                      = 0x00008000
	SQLITE_BIGENDIAN                      = 0
	SQLITE_BIG_DBL                        = 0
	SQLITE_BLDF1_INDEXED                  = 0x0001
	SQLITE_BLDF1_UNIQUE                   = 0x0002
	SQLITE_BLDF2_2NDPASS                  = 0x0004
	SQLITE_BLOB                           = 4
	SQLITE_BTREE_H                        = 0
	SQLITE_BUSY                           = 5
	SQLITE_BUSY_RECOVERY                  = 261
	SQLITE_BUSY_SNAPSHOT                  = 517
	SQLITE_BUSY_TIMEOUT                   = 773
	SQLITE_BYTEORDER                      = 1234
	SQLITE_CALLBACK                       = 0
	SQLITE_CANTOPEN                       = 14
	SQLITE_CANTOPEN_CONVPATH              = 1038
	SQLITE_CANTOPEN_DIRTYWAL              = 1294
	SQLITE_CANTOPEN_FULLPATH              = 782
	SQLITE_CANTOPEN_ISDIR                 = 526
	SQLITE_CANTOPEN_NOTEMPDIR             = 270
	SQLITE_CANTOPEN_SYMLINK               = 1550
	SQLITE_CDECL                          = 0
	SQLITE_CHECKPOINT_FULL                = 1
	SQLITE_CHECKPOINT_PASSIVE             = 0
	SQLITE_CHECKPOINT_RESTART             = 2
	SQLITE_CHECKPOINT_TRUNCATE            = 3
	SQLITE_CKSUMVFS_STATIC                = 1
	SQLITE_CONFIG_COVERING_INDEX_SCAN     = 20
	SQLITE_CONFIG_GETMALLOC               = 5
	SQLITE_CONFIG_GETMUTEX                = 11
	SQLITE_CONFIG_GETPCACHE               = 15
	SQLITE_CONFIG_GETPCACHE2              = 19
	SQLITE_CONFIG_HEAP                    = 8
	SQLITE_CONFIG_LOG                     = 16
	SQLITE_CONFIG_LOOKASIDE               = 13
	SQLITE_CONFIG_MALLOC                  = 4
	SQLITE_CONFIG_MEMDB_MAXSIZE           = 29
	SQLITE_CONFIG_MEMSTATUS               = 9
	SQLITE_CONFIG_MMAP_SIZE               = 22
	SQLITE_CONFIG_MULTITHREAD             = 2
	SQLITE_CONFIG_MUTEX                   = 10
	SQLITE_CONFIG_PAGECACHE               = 7
	SQLITE_CONFIG_PCACHE                  = 14
	SQLITE_CONFIG_PCACHE2                 = 18
	SQLITE_CONFIG_PCACHE_HDRSZ            = 24
	SQLITE_CONFIG_PMASZ                   = 25
	SQLITE_CONFIG_SCRATCH                 = 6
	SQLITE_CONFIG_SERIALIZED              = 3
	SQLITE_CONFIG_SINGLETHREAD            = 1
	SQLITE_CONFIG_SMALL_MALLOC            = 27
	SQLITE_CONFIG_SORTERREF_SIZE          = 28
	SQLITE_CONFIG_SQLLOG                  = 21
	SQLITE_CONFIG_STMTJRNL_SPILL          = 26
	SQLITE_CONFIG_URI                     = 17
	SQLITE_CONFIG_WIN32_HEAPSIZE          = 23
	SQLITE_CONSTRAINT                     = 19
	SQLITE_CONSTRAINT_CHECK               = 275
	SQLITE_CONSTRAINT_COMMITHOOK          = 531
	SQLITE_CONSTRAINT_FOREIGNKEY          = 787
	SQLITE_CONSTRAINT_FUNCTION            = 1043
	SQLITE_CONSTRAINT_NOTNULL             = 1299
	SQLITE_CONSTRAINT_PINNED              = 2835
	SQLITE_CONSTRAINT_PRIMARYKEY          = 1555
	SQLITE_CONSTRAINT_ROWID               = 2579
	SQLITE_CONSTRAINT_TRIGGER             = 1811
	SQLITE_CONSTRAINT_UNIQUE              = 2067
	SQLITE_CONSTRAINT_VTAB                = 2323
	SQLITE_COPY                           = 0
	SQLITE_CORE                           = 1
	SQLITE_CORRUPT                        = 11
	SQLITE_CORRUPT_INDEX                  = 779
	SQLITE_CORRUPT_SEQUENCE               = 523
	SQLITE_CORRUPT_VTAB                   = 267
	SQLITE_CREATE_INDEX                   = 1
	SQLITE_CREATE_TABLE                   = 2
	SQLITE_CREATE_TEMP_INDEX              = 3
	SQLITE_CREATE_TEMP_TABLE              = 4
	SQLITE_CREATE_TEMP_TRIGGER            = 5
	SQLITE_CREATE_TEMP_VIEW               = 6
	SQLITE_CREATE_TRIGGER                 = 7
	SQLITE_CREATE_VIEW                    = 8
	SQLITE_CREATE_VTABLE                  = 29
	SQLITE_CacheSpill                     = 0x00000020
	SQLITE_CellSizeCk                     = 0x00200000
	SQLITE_CkptFullFSync                  = 0x00000010
	SQLITE_CountOfView                    = 0x00000200
	SQLITE_CoverIdxScan                   = 0x00000020
	SQLITE_CursorHints                    = 0x00000400
	SQLITE_DBCONFIG_DEFENSIVE             = 1010
	SQLITE_DBCONFIG_DQS_DDL               = 1014
	SQLITE_DBCONFIG_DQS_DML               = 1013
	SQLITE_DBCONFIG_ENABLE_FKEY           = 1002
	SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER = 1004
	SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION = 1005
	SQLITE_DBCONFIG_ENABLE_QPSG           = 1007
	SQLITE_DBCONFIG_ENABLE_TRIGGER        = 1003
	SQLITE_DBCONFIG_ENABLE_VIEW           = 1015
	SQLITE_DBCONFIG_LEGACY_ALTER_TABLE    = 1012
	SQLITE_DBCONFIG_LEGACY_FILE_FORMAT    = 1016
	SQLITE_DBCONFIG_LOOKASIDE             = 1001
	SQLITE_DBCONFIG_MAINDBNAME            = 1000
	SQLITE_DBCONFIG_MAX                   = 1017
	SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE      = 1006
	SQLITE_DBCONFIG_RESET_DATABASE        = 1009
	SQLITE_DBCONFIG_TRIGGER_EQP           = 1008
	SQLITE_DBCONFIG_TRUSTED_SCHEMA        = 1017
	SQLITE_DBCONFIG_WRITABLE_SCHEMA       = 1011
	SQLITE_DBSTATUS_CACHE_HIT             = 7
	SQLITE_DBSTATUS_CACHE_MISS            = 8
	SQLITE_DBSTATUS_CACHE_SPILL           = 12
	SQLITE_DBSTATUS_CACHE_USED            = 1
	SQLITE_DBSTATUS_CACHE_USED_SHARED     = 11
	SQLITE_DBSTATUS_CACHE_WRITE           = 9
	SQLITE_DBSTATUS_DEFERRED_FKS          = 10
	SQLITE_DBSTATUS_LOOKASIDE_HIT         = 4
	SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL   = 6
	SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE   = 5
	SQLITE_DBSTATUS_LOOKASIDE_USED        = 0
	SQLITE_DBSTATUS_MAX                   = 12
	SQLITE_DBSTATUS_SCHEMA_USED           = 2
	SQLITE_DBSTATUS_STMT_USED             = 3
	SQLITE_DEBUG_OS_TRACE                 = 0
	SQLITE_DEFAULT_AUTOVACUUM             = 0
	SQLITE_DEFAULT_CACHE_SIZE             = -2000
	SQLITE_DEFAULT_FILE_FORMAT            = 4
	SQLITE_DEFAULT_FILE_PERMISSIONS       = 0644
	SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT     = -1
	SQLITE_DEFAULT_LOOKASIDE              = 40
	SQLITE_DEFAULT_MEMSTATUS              = 0
	SQLITE_DEFAULT_MMAP_SIZE              = 0
	SQLITE_DEFAULT_PAGE_SIZE              = 1024
	SQLITE_DEFAULT_PCACHE_INITSZ          = 20
	SQLITE_DEFAULT_PROXYDIR_PERMISSIONS   = 0755
	SQLITE_DEFAULT_RECURSIVE_TRIGGERS     = 0
	SQLITE_DEFAULT_SECTOR_SIZE            = 4096
	SQLITE_DEFAULT_SORTERREF_SIZE         = 0x7fffffff
	SQLITE_DEFAULT_SYNCHRONOUS            = 2
	SQLITE_DEFAULT_WAL_AUTOCHECKPOINT     = 1000
	SQLITE_DEFAULT_WAL_SYNCHRONOUS        = 2
	SQLITE_DEFAULT_WORKER_THREADS         = 0
	SQLITE_DELETE                         = 9
	SQLITE_DENY                           = 1
	SQLITE_DEPRECATED                     = 0
	SQLITE_DESERIALIZE_FREEONCLOSE        = 1
	SQLITE_DESERIALIZE_READONLY           = 4
	SQLITE_DESERIALIZE_RESIZEABLE         = 2
	SQLITE_DETACH                         = 25
	SQLITE_DETERMINISTIC                  = 0x000000800
	SQLITE_DIRECTONLY                     = 0x000080000
	SQLITE_DONE                           = 101
	SQLITE_DQS                            = 3
	SQLITE_DROP_INDEX                     = 10
	SQLITE_DROP_TABLE                     = 11
	SQLITE_DROP_TEMP_INDEX                = 12
	SQLITE_DROP_TEMP_TABLE                = 13
	SQLITE_DROP_TEMP_TRIGGER              = 14
	SQLITE_DROP_TEMP_VIEW                 = 15
	SQLITE_DROP_TRIGGER                   = 16
	SQLITE_DROP_VIEW                      = 17
	SQLITE_DROP_VTABLE                    = 30
	SQLITE_Defensive                      = 0x10000000
	SQLITE_DeferFKs                       = 0x00080000
	SQLITE_DistinctOpt                    = 0x00000010
	SQLITE_DqsDDL                         = 0x20000000
	SQLITE_DqsDML                         = 0x40000000
	SQLITE_ECEL_DUP                       = 0x01
	SQLITE_ECEL_FACTOR                    = 0x02
	SQLITE_ECEL_OMITREF                   = 0x08
	SQLITE_ECEL_REF                       = 0x04
	SQLITE_EMPTY                          = 16
	SQLITE_ENABLE_BYTECODE_VTAB           = 1
	SQLITE_ENABLE_COLUMN_METADATA         = 1
	SQLITE_ENABLE_DBPAGE_VTAB             = 1
	SQLITE_ENABLE_DBSTAT_VTAB             = 1
	SQLITE_ENABLE_DESERIALIZE             = 1
	SQLITE_ENABLE_EXPLAIN_COMMENTS        = 1
	SQLITE_ENABLE_FTS5                    = 1
	SQLITE_ENABLE_GEOPOLY                 = 1
	SQLITE_ENABLE_JSON1                   = 1
	SQLITE_ENABLE_LOCKING_STYLE           = 0
	SQLITE_ENABLE_MEMORY_MANAGEMENT       = 1
	SQLITE_ENABLE_OFFSET_SQL_FUNC         = 1
	SQLITE_ENABLE_PREUPDATE_HOOK          = 1
	SQLITE_ENABLE_RBU                     = 1
	SQLITE_ENABLE_RTREE                   = 1
	SQLITE_ENABLE_SNAPSHOT                = 1
	SQLITE_ENABLE_STAT4                   = 1
	SQLITE_ENABLE_STMTVTAB                = 1
	SQLITE_ENABLE_UNLOCK_NOTIFY           = 1
	SQLITE_ERROR                          = 1
	SQLITE_ERROR_MISSING_COLLSEQ          = 257
	SQLITE_ERROR_RETRY                    = 513
	SQLITE_ERROR_SNAPSHOT                 = 769
	SQLITE_EXPERIMENTAL                   = 0
	SQLITE_EXTENSION_INIT1                = 0
	SQLITE_EXTENSION_INIT3                = 0
	SQLITE_EnableQPSG                     = 0x00800000
	SQLITE_EnableTrigger                  = 0x00040000
	SQLITE_EnableView                     = 0x80000000
	SQLITE_FAIL                           = 3
	SQLITE_FAULTINJECTOR_COUNT            = 1
	SQLITE_FAULTINJECTOR_MALLOC           = 0
	SQLITE_FCNTL_BEGIN_ATOMIC_WRITE       = 31
	SQLITE_FCNTL_BUSYHANDLER              = 15
	SQLITE_FCNTL_CHUNK_SIZE               = 6
	SQLITE_FCNTL_CKPT_DONE                = 37
	SQLITE_FCNTL_CKPT_START               = 39
	SQLITE_FCNTL_CKSM_FILE                = 41
	SQLITE_FCNTL_COMMIT_ATOMIC_WRITE      = 32
	SQLITE_FCNTL_COMMIT_PHASETWO          = 22
	SQLITE_FCNTL_DATA_VERSION             = 35
	SQLITE_FCNTL_DB_UNCHANGED             = 0xca093fa0
	SQLITE_FCNTL_EXTERNAL_READER          = 40
	SQLITE_FCNTL_FILE_POINTER             = 7
	SQLITE_FCNTL_GET_LOCKPROXYFILE        = 2
	SQLITE_FCNTL_HAS_MOVED                = 20
	SQLITE_FCNTL_JOURNAL_POINTER          = 28
	SQLITE_FCNTL_LAST_ERRNO               = 4
	SQLITE_FCNTL_LOCKSTATE                = 1
	SQLITE_FCNTL_LOCK_TIMEOUT             = 34
	SQLITE_FCNTL_MMAP_SIZE                = 18
	SQLITE_FCNTL_OVERWRITE                = 11
	SQLITE_FCNTL_PDB                      = 30
	SQLITE_FCNTL_PERSIST_WAL              = 10
	SQLITE_FCNTL_POWERSAFE_OVERWRITE      = 13
	SQLITE_FCNTL_PRAGMA                   = 14
	SQLITE_FCNTL_RBU                      = 26
	SQLITE_FCNTL_RBUCNT                   = 5149216
	SQLITE_FCNTL_RESERVE_BYTES            = 38
	SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE    = 33
	SQLITE_FCNTL_SET_LOCKPROXYFILE        = 3
	SQLITE_FCNTL_SIZE_HINT                = 5
	SQLITE_FCNTL_SIZE_LIMIT               = 36
	SQLITE_FCNTL_SYNC                     = 21
	SQLITE_FCNTL_SYNC_OMITTED             = 8
	SQLITE_FCNTL_TEMPFILENAME             = 16
	SQLITE_FCNTL_TRACE                    = 19
	SQLITE_FCNTL_VFSNAME                  = 12
	SQLITE_FCNTL_VFS_POINTER              = 27
	SQLITE_FCNTL_WAL_BLOCK                = 24
	SQLITE_FCNTL_WIN32_AV_RETRY           = 9
	SQLITE_FCNTL_WIN32_GET_HANDLE         = 29
	SQLITE_FCNTL_WIN32_SET_HANDLE         = 23
	SQLITE_FCNTL_ZIPVFS                   = 25
	SQLITE_FILE_HEADER                    = "SQLite format 3"
	SQLITE_FLOAT                          = 2
	SQLITE_FORMAT                         = 24
	SQLITE_FP_PRECISION_LIMIT             = 100000000
	SQLITE_FRAME_MAGIC                    = 0x879fb71e
	SQLITE_FSFLAGS_IS_MSDOS               = 0x1
	SQLITE_FULL                           = 13
	SQLITE_FUNCTION                       = 31
	SQLITE_FUNC_CASE                      = 0x0008
	SQLITE_FUNC_CONSTANT                  = 0x0800
	SQLITE_FUNC_COUNT                     = 0x0100
	SQLITE_FUNC_DIRECT                    = 0x00080000
	SQLITE_FUNC_ENCMASK                   = 0x0003
	SQLITE_FUNC_EPHEM                     = 0x0010
	SQLITE_FUNC_HASH_SZ                   = 23
	SQLITE_FUNC_INLINE                    = 0x00400000
	SQLITE_FUNC_INTERNAL                  = 0x00040000
	SQLITE_FUNC_LENGTH                    = 0x0040
	SQLITE_FUNC_LIKE                      = 0x0004
	SQLITE_FUNC_MINMAX                    = 0x1000
	SQLITE_FUNC_NEEDCOLL                  = 0x0020
	SQLITE_FUNC_OFFSET                    = 0x8000
	SQLITE_FUNC_SLOCHNG                   = 0x2000
	SQLITE_FUNC_SUBTYPE                   = 0x00100000
	SQLITE_FUNC_TEST                      = 0x4000
	SQLITE_FUNC_TYPEOF                    = 0x0080
	SQLITE_FUNC_UNLIKELY                  = 0x0400
	SQLITE_FUNC_UNSAFE                    = 0x00200000
	SQLITE_FUNC_WINDOW                    = 0x00010000
	SQLITE_FactorOutConst                 = 0x00000008
	SQLITE_ForeignKeys                    = 0x00004000
	SQLITE_Fts3Tokenizer                  = 0x00400000
	SQLITE_FullColNames                   = 0x00000004
	SQLITE_FullFSync                      = 0x00000008
	SQLITE_GET_LOCKPROXYFILE              = 2
	SQLITE_GroupByOrder                   = 0x00000004
	SQLITE_HASH_H                         = 0
	SQLITE_HAVE_C99_MATH_FUNCS            = 1
	SQLITE_HAVE_OS_TRACE                  = 0
	SQLITE_HAVE_ZLIB                      = 1
	SQLITE_IDXTYPE_APPDEF                 = 0
	SQLITE_IDXTYPE_IPK                    = 3
	SQLITE_IDXTYPE_PRIMARYKEY             = 2
	SQLITE_IDXTYPE_UNIQUE                 = 1
	SQLITE_IGNORE                         = 2
	SQLITE_INDEX_CONSTRAINT_EQ            = 2
	SQLITE_INDEX_CONSTRAINT_FUNCTION      = 150
	SQLITE_INDEX_CONSTRAINT_GE            = 32
	SQLITE_INDEX_CONSTRAINT_GLOB          = 66
	SQLITE_INDEX_CONSTRAINT_GT            = 4
	SQLITE_INDEX_CONSTRAINT_IS            = 72
	SQLITE_INDEX_CONSTRAINT_ISNOT         = 69
	SQLITE_INDEX_CONSTRAINT_ISNOTNULL     = 70
	SQLITE_INDEX_CONSTRAINT_ISNULL        = 71
	SQLITE_INDEX_CONSTRAINT_LE            = 8
	SQLITE_INDEX_CONSTRAINT_LIKE          = 65
	SQLITE_INDEX_CONSTRAINT_LT            = 16
	SQLITE_INDEX_CONSTRAINT_MATCH         = 64
	SQLITE_INDEX_CONSTRAINT_NE            = 68
	SQLITE_INDEX_CONSTRAINT_REGEXP        = 67
	SQLITE_INDEX_SCAN_UNIQUE              = 1
	SQLITE_INNOCUOUS                      = 0x000200000
	SQLITE_INSERT                         = 18
	SQLITE_INTEGER                        = 1
	SQLITE_INTEGRITY_CHECK_ERROR_MAX      = 100
	SQLITE_INTERNAL                       = 2
	SQLITE_INTERRUPT                      = 9
	SQLITE_IOCAP_ATOMIC                   = 0x00000001
	SQLITE_IOCAP_ATOMIC16K                = 0x00000040
	SQLITE_IOCAP_ATOMIC1K                 = 0x00000004
	SQLITE_IOCAP_ATOMIC2K                 = 0x00000008
	SQLITE_IOCAP_ATOMIC32K                = 0x00000080
	SQLITE_IOCAP_ATOMIC4K                 = 0x00000010
	SQLITE_IOCAP_ATOMIC512                = 0x00000002
	SQLITE_IOCAP_ATOMIC64K                = 0x00000100
	SQLITE_IOCAP_ATOMIC8K                 = 0x00000020
	SQLITE_IOCAP_BATCH_ATOMIC             = 0x00004000
	SQLITE_IOCAP_IMMUTABLE                = 0x00002000
	SQLITE_IOCAP_POWERSAFE_OVERWRITE      = 0x00001000
	SQLITE_IOCAP_SAFE_APPEND              = 0x00000200
	SQLITE_IOCAP_SEQUENTIAL               = 0x00000400
	SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN    = 0x00000800
	SQLITE_IOERR                          = 10
	SQLITE_IOERR_ACCESS                   = 3338
	SQLITE_IOERR_AUTH                     = 7178
	SQLITE_IOERR_BEGIN_ATOMIC             = 7434
	SQLITE_IOERR_BLOCKED                  = 2826
	SQLITE_IOERR_CHECKRESERVEDLOCK        = 3594
	SQLITE_IOERR_CLOSE                    = 4106
	SQLITE_IOERR_COMMIT_ATOMIC            = 7690
	SQLITE_IOERR_CONVPATH                 = 6666
	SQLITE_IOERR_CORRUPTFS                = 8458
	SQLITE_IOERR_DATA                     = 8202
	SQLITE_IOERR_DELETE                   = 2570
	SQLITE_IOERR_DELETE_NOENT             = 5898
	SQLITE_IOERR_DIR_CLOSE                = 4362
	SQLITE_IOERR_DIR_FSYNC                = 1290
	SQLITE_IOERR_FSTAT                    = 1802
	SQLITE_IOERR_FSYNC                    = 1034
	SQLITE_IOERR_GETTEMPPATH              = 6410
	SQLITE_IOERR_LOCK                     = 3850
	SQLITE_IOERR_MMAP                     = 6154
	SQLITE_IOERR_NOMEM                    = 3082
	SQLITE_IOERR_NOMEM_BKPT               = 3082
	SQLITE_IOERR_RDLOCK                   = 2314
	SQLITE_IOERR_READ                     = 266
	SQLITE_IOERR_ROLLBACK_ATOMIC          = 7946
	SQLITE_IOERR_SEEK                     = 5642
	SQLITE_IOERR_SHMLOCK                  = 5130
	SQLITE_IOERR_SHMMAP                   = 5386
	SQLITE_IOERR_SHMOPEN                  = 4618
	SQLITE_IOERR_SHMSIZE                  = 4874
	SQLITE_IOERR_SHORT_READ               = 522
	SQLITE_IOERR_TRUNCATE                 = 1546
	SQLITE_IOERR_UNLOCK                   = 2058
	SQLITE_IOERR_VNODE                    = 6922
	SQLITE_IOERR_WRITE                    = 778
	SQLITE_IgnoreChecks                   = 0x00000200
	SQLITE_JUMPIFNULL                     = 0x10
	SQLITE_LAST_ERRNO                     = 4
	SQLITE_LIKE_DOESNT_MATCH_BLOBS        = 1
	SQLITE_LIMIT_ATTACHED                 = 7
	SQLITE_LIMIT_COLUMN                   = 2
	SQLITE_LIMIT_COMPOUND_SELECT          = 4
	SQLITE_LIMIT_EXPR_DEPTH               = 3
	SQLITE_LIMIT_FUNCTION_ARG             = 6
	SQLITE_LIMIT_LENGTH                   = 0
	SQLITE_LIMIT_LIKE_PATTERN_LENGTH      = 8
	SQLITE_LIMIT_SQL_LENGTH               = 1
	SQLITE_LIMIT_TRIGGER_DEPTH            = 10
	SQLITE_LIMIT_VARIABLE_NUMBER          = 9
	SQLITE_LIMIT_VDBE_OP                  = 5
	SQLITE_LIMIT_WORKER_THREADS           = 11
	SQLITE_LITTLEENDIAN                   = 1
	SQLITE_LOCKED                         = 6
	SQLITE_LOCKED_SHAREDCACHE             = 262
	SQLITE_LOCKED_VTAB                    = 518
	SQLITE_LOCK_EXCLUSIVE                 = 4
	SQLITE_LOCK_NONE                      = 0
	SQLITE_LOCK_PENDING                   = 3
	SQLITE_LOCK_RESERVED                  = 2
	SQLITE_LOCK_SHARED                    = 1
	SQLITE_LegacyAlter                    = 0x04000000
	SQLITE_LegacyFileFmt                  = 0x00000002
	SQLITE_LoadExtFunc                    = 0x00020000
	SQLITE_LoadExtension                  = 0x00010000
	SQLITE_MAGIC_BUSY                     = 0xf03b7906
	SQLITE_MAGIC_CLOSED                   = 0x9f3c2d33
	SQLITE_MAGIC_ERROR                    = 0xb5357930
	SQLITE_MAGIC_OPEN                     = 0xa029a697
	SQLITE_MAGIC_SICK                     = 0x4b771290
	SQLITE_MAGIC_ZOMBIE                   = 0x64cffc7f
	SQLITE_MALLOC_SOFT_LIMIT              = 1024
	SQLITE_MATCH                          = 0
	SQLITE_MAX_ATTACHED                   = 10
	SQLITE_MAX_COLUMN                     = 2000
	SQLITE_MAX_COMPOUND_SELECT            = 500
	SQLITE_MAX_DB                         = 12
	SQLITE_MAX_DEFAULT_PAGE_SIZE          = 8192
	SQLITE_MAX_EXPR_DEPTH                 = 1000
	SQLITE_MAX_FILE_FORMAT                = 4
	SQLITE_MAX_FUNCTION_ARG               = 127
	SQLITE_MAX_LENGTH                     = 1000000000
	SQLITE_MAX_LIKE_PATTERN_LENGTH        = 50000
	SQLITE_MAX_MEMORY                     = 0
	SQLITE_MAX_MMAP_SIZE                  = 0x7fff0000
	SQLITE_MAX_PAGE_COUNT                 = 1073741823
	SQLITE_MAX_PAGE_SIZE                  = 65536
	SQLITE_MAX_PATHLEN                    = 4096
	SQLITE_MAX_PMASZ                      = 536870912
	SQLITE_MAX_SCHEMA_RETRY               = 50
	SQLITE_MAX_SQL_LENGTH                 = 1000000000
	SQLITE_MAX_SRCLIST                    = 200
	SQLITE_MAX_SYMLINKS                   = 100
	SQLITE_MAX_TRIGGER_DEPTH              = 1000
	SQLITE_MAX_VARIABLE_NUMBER            = 32766
	SQLITE_MAX_VDBE_OP                    = 250000000
	SQLITE_MAX_WORKER_THREADS             = 8
	SQLITE_MEMDB_DEFAULT_MAXSIZE          = 1073741824
	SQLITE_MINIMUM_FILE_DESCRIPTOR        = 3
	SQLITE_MISMATCH                       = 20
	SQLITE_MISUSE                         = 21
	SQLITE_MSVC_H                         = 0
	SQLITE_MUTEX_APPDEF                   = 1
	SQLITE_MUTEX_FAST                     = 0
	SQLITE_MUTEX_NREF                     = 0
	SQLITE_MUTEX_PTHREADS                 = 0
	SQLITE_MUTEX_RECURSIVE                = 1
	SQLITE_MUTEX_STATIC_APP1              = 8
	SQLITE_MUTEX_STATIC_APP2              = 9
	SQLITE_MUTEX_STATIC_APP3              = 10
	SQLITE_MUTEX_STATIC_LRU               = 6
	SQLITE_MUTEX_STATIC_LRU2              = 7
	SQLITE_MUTEX_STATIC_MAIN              = 2
	SQLITE_MUTEX_STATIC_MASTER            = 2
	SQLITE_MUTEX_STATIC_MEM               = 3
	SQLITE_MUTEX_STATIC_MEM2              = 4
	SQLITE_MUTEX_STATIC_OPEN              = 4
	SQLITE_MUTEX_STATIC_PMEM              = 7
	SQLITE_MUTEX_STATIC_PRNG              = 5
	SQLITE_MUTEX_STATIC_VFS1              = 11
	SQLITE_MUTEX_STATIC_VFS2              = 12
	SQLITE_MUTEX_STATIC_VFS3              = 13
	SQLITE_MX_JUMP_OPCODE                 = 62
	SQLITE_MinMaxOpt                      = 0x00010000
	SQLITE_NEED_ERR_NAME                  = 0
	SQLITE_NOLFS                          = 22
	SQLITE_NOMATCH                        = 1
	SQLITE_NOMEM                          = 7
	SQLITE_NOMEM_BKPT                     = 7
	SQLITE_NOTADB                         = 26
	SQLITE_NOTFOUND                       = 12
	SQLITE_NOTICE                         = 27
	SQLITE_NOTICE_RECOVER_ROLLBACK        = 539
	SQLITE_NOTICE_RECOVER_WAL             = 283
	SQLITE_NOTNULL                        = 0x90
	SQLITE_NOWILDCARDMATCH                = 2
	SQLITE_NO_TSAN                        = 0
	SQLITE_NTUNE                          = 6
	SQLITE_NULL                           = 5
	SQLITE_NULLEQ                         = 0x80
	SQLITE_N_BTREE_META                   = 16
	SQLITE_N_KEYWORD                      = 147
	SQLITE_N_LIMIT                        = 12
	SQLITE_NoCkptOnClose                  = 0x00000800
	SQLITE_NoSchemaError                  = 0x08000000
	SQLITE_NullCallback                   = 0x00000100
	SQLITE_OK                             = 0
	SQLITE_OK_LOAD_PERMANENTLY            = 256
	SQLITE_OK_SYMLINK                     = 512
	SQLITE_OPEN_AUTOPROXY                 = 0x00000020
	SQLITE_OPEN_CREATE                    = 0x00000004
	SQLITE_OPEN_DELETEONCLOSE             = 0x00000008
	SQLITE_OPEN_EXCLUSIVE                 = 0x00000010
	SQLITE_OPEN_FULLMUTEX                 = 0x00010000
	SQLITE_OPEN_MAIN_DB                   = 0x00000100
	SQLITE_OPEN_MAIN_JOURNAL              = 0x00000800
	SQLITE_OPEN_MASTER_JOURNAL            = 0x00004000
	SQLITE_OPEN_MEMORY                    = 0x00000080
	SQLITE_OPEN_NOFOLLOW                  = 0x01000000
	SQLITE_OPEN_NOMUTEX                   = 0x00008000
	SQLITE_OPEN_PRIVATECACHE              = 0x00040000
	SQLITE_OPEN_READONLY                  = 0x00000001
	SQLITE_OPEN_READWRITE                 = 0x00000002
	SQLITE_OPEN_SHAREDCACHE               = 0x00020000
	SQLITE_OPEN_SUBJOURNAL                = 0x00002000
	SQLITE_OPEN_SUPER_JOURNAL             = 0x00004000
	SQLITE_OPEN_TEMP_DB                   = 0x00000200
	SQLITE_OPEN_TEMP_JOURNAL              = 0x00001000
	SQLITE_OPEN_TRANSIENT_DB              = 0x00000400
	SQLITE_OPEN_URI                       = 0x00000040
	SQLITE_OPEN_WAL                       = 0x00080000
	SQLITE_OS_OTHER                       = 0
	SQLITE_OS_SETUP_H                     = 0
	SQLITE_OS_UNIX                        = 1
	SQLITE_OS_WIN                         = 0
	SQLITE_OmitNoopJoin                   = 0x00000100
	SQLITE_OrderByIdxJoin                 = 0x00000040
	SQLITE_PAGER_H                        = 0
	SQLITE_PERM                           = 3
	SQLITE_POWERSAFE_OVERWRITE            = 1
	SQLITE_PRAGMA                         = 19
	SQLITE_PREPARE_MASK                   = 0x0f
	SQLITE_PREPARE_NORMALIZE              = 0x02
	SQLITE_PREPARE_NO_VTAB                = 0x04
	SQLITE_PREPARE_PERSISTENT             = 0x01
	SQLITE_PREPARE_SAVESQL                = 0x80
	SQLITE_PRINTF_INTERNAL                = 0x01
	SQLITE_PRINTF_MALLOCED                = 0x04
	SQLITE_PRINTF_SQLFUNC                 = 0x02
	SQLITE_PRINT_BUF_SIZE                 = 70
	SQLITE_PRIVATE                        = 0
	SQLITE_PROTOCOL                       = 15
	SQLITE_PTRSIZE                        = 8
	SQLITE_PropagateConst                 = 0x00008000
	SQLITE_PushDown                       = 0x00001000
	SQLITE_QUERY_PLANNER_LIMIT            = 20000
	SQLITE_QUERY_PLANNER_LIMIT_INCR       = 1000
	SQLITE_QueryFlattener                 = 0x00000001
	SQLITE_QueryOnly                      = 0x00100000
	SQLITE_RANGE                          = 25
	SQLITE_RBU_STATE_CHECKPOINT           = 3
	SQLITE_RBU_STATE_DONE                 = 4
	SQLITE_RBU_STATE_ERROR                = 5
	SQLITE_RBU_STATE_MOVE                 = 2
	SQLITE_RBU_STATE_OAL                  = 1
	SQLITE_RBU_UPDATE_CACHESIZE           = 16
	SQLITE_READ                           = 20
	SQLITE_READONLY                       = 8
	SQLITE_READONLY_CANTINIT              = 1288
	SQLITE_READONLY_CANTLOCK              = 520
	SQLITE_READONLY_DBMOVED               = 1032
	SQLITE_READONLY_DIRECTORY             = 1544
	SQLITE_READONLY_RECOVERY              = 264
	SQLITE_READONLY_ROLLBACK              = 776
	SQLITE_RECURSIVE                      = 33
	SQLITE_REINDEX                        = 27
	SQLITE_REPLACE                        = 5
	SQLITE_ROLLBACK                       = 1
	SQLITE_ROW                            = 100
	SQLITE_ReadUncommit                   = 0x00000400
	SQLITE_RecTriggers                    = 0x00002000
	SQLITE_ResetDatabase                  = 0x02000000
	SQLITE_ReverseOrder                   = 0x00001000
	SQLITE_SAVEPOINT                      = 32
	SQLITE_SCANSTAT_EST                   = 2
	SQLITE_SCANSTAT_EXPLAIN               = 4
	SQLITE_SCANSTAT_NAME                  = 3
	SQLITE_SCANSTAT_NLOOP                 = 0
	SQLITE_SCANSTAT_NVISIT                = 1
	SQLITE_SCANSTAT_SELECTID              = 5
	SQLITE_SCHEMA                         = 17
	SQLITE_SELECT                         = 21
	SQLITE_SERIALIZE_NOCOPY               = 0x001
	SQLITE_SET_LOCKPROXYFILE              = 3
	SQLITE_SHM_EXCLUSIVE                  = 8
	SQLITE_SHM_LOCK                       = 2
	SQLITE_SHM_NLOCK                      = 8
	SQLITE_SHM_SHARED                     = 4
	SQLITE_SHM_UNLOCK                     = 1
	SQLITE_SORTER_PMASZ                   = 250
	SQLITE_SOUNDEX                        = 1
	SQLITE_SOURCE_ID                      = "2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5"
	SQLITE_SO_ASC                         = 0
	SQLITE_SO_DESC                        = 1
	SQLITE_SO_UNDEFINED                   = -1
	SQLITE_STAT4_SAMPLES                  = 24
	SQLITE_STATUS_MALLOC_COUNT            = 9
	SQLITE_STATUS_MALLOC_SIZE             = 5
	SQLITE_STATUS_MEMORY_USED             = 0
	SQLITE_STATUS_PAGECACHE_OVERFLOW      = 2
	SQLITE_STATUS_PAGECACHE_SIZE          = 7
	SQLITE_STATUS_PAGECACHE_USED          = 1
	SQLITE_STATUS_PARSER_STACK            = 6
	SQLITE_STATUS_SCRATCH_OVERFLOW        = 4
	SQLITE_STATUS_SCRATCH_SIZE            = 8
	SQLITE_STATUS_SCRATCH_USED            = 3
	SQLITE_STDCALL                        = 0
	SQLITE_STMTJRNL_SPILL                 = 65536
	SQLITE_STMTSTATUS_AUTOINDEX           = 3
	SQLITE_STMTSTATUS_FULLSCAN_STEP       = 1
	SQLITE_STMTSTATUS_MEMUSED             = 99
	SQLITE_STMTSTATUS_REPREPARE           = 5
	SQLITE_STMTSTATUS_RUN                 = 6
	SQLITE_STMTSTATUS_SORT                = 2
	SQLITE_STMTSTATUS_VM_STEP             = 4
	SQLITE_SUBTYPE                        = 0x000100000
	SQLITE_SYNC_DATAONLY                  = 0x00010
	SQLITE_SYNC_FULL                      = 0x00003
	SQLITE_SYNC_NORMAL                    = 0x00002
	SQLITE_SYSAPI                         = 0
	SQLITE_SYSTEM_MALLOC                  = 1
	SQLITE_SeekScan                       = 0x00020000
	SQLITE_ShortColNames                  = 0x00000040
	SQLITE_SimplifyJoin                   = 0x00002000
	SQLITE_SkipScan                       = 0x00004000
	SQLITE_Stat4                          = 0x00000800
	SQLITE_TCLAPI                         = 0
	SQLITE_TEMP_FILE_PREFIX               = "etilqs_"
	SQLITE_TEMP_STORE                     = 1
	SQLITE_TEST                           = 1
	SQLITE_TESTCTRL_ALWAYS                = 13
	SQLITE_TESTCTRL_ASSERT                = 12
	SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS   = 10
	SQLITE_TESTCTRL_BITVEC_TEST           = 8
	SQLITE_TESTCTRL_BYTEORDER             = 22
	SQLITE_TESTCTRL_EXPLAIN_STMT          = 19
	SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS   = 29
	SQLITE_TESTCTRL_FAULT_INSTALL         = 9
	SQLITE_TESTCTRL_FIRST                 = 5
	SQLITE_TESTCTRL_IMPOSTER              = 25
	SQLITE_TESTCTRL_INTERNAL_FUNCTIONS    = 17
	SQLITE_TESTCTRL_ISINIT                = 23
	SQLITE_TESTCTRL_ISKEYWORD             = 16
	SQLITE_TESTCTRL_LAST                  = 32
	SQLITE_TESTCTRL_LOCALTIME_FAULT       = 18
	SQLITE_TESTCTRL_NEVER_CORRUPT         = 20
	SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD  = 19
	SQLITE_TESTCTRL_OPTIMIZATIONS         = 15
	SQLITE_TESTCTRL_PARSER_COVERAGE       = 26
	SQLITE_TESTCTRL_PENDING_BYTE          = 11
	SQLITE_TESTCTRL_PRNG_RESET            = 7
	SQLITE_TESTCTRL_PRNG_RESTORE          = 6
	SQLITE_TESTCTRL_PRNG_SAVE             = 5
	SQLITE_TESTCTRL_PRNG_SEED             = 28
	SQLITE_TESTCTRL_RESERVE               = 14
	SQLITE_TESTCTRL_RESULT_INTREAL        = 27
	SQLITE_TESTCTRL_SCRATCHMALLOC         = 17
	SQLITE_TESTCTRL_SEEK_COUNT            = 30
	SQLITE_TESTCTRL_SORTER_MMAP           = 24
	SQLITE_TESTCTRL_TRACEFLAGS            = 31
	SQLITE_TESTCTRL_TUNE                  = 32
	SQLITE_TESTCTRL_VDBE_COVERAGE         = 21
	SQLITE_TEXT                           = 3
	SQLITE_THREADSAFE                     = 1
	SQLITE_THREADS_IMPLEMENTED            = 1
	SQLITE_TOKEN_KEYWORD                  = 0x2
	SQLITE_TOKEN_QUOTED                   = 0x1
	SQLITE_TOOBIG                         = 18
	SQLITE_TRACE_CLOSE                    = 0x08
	SQLITE_TRACE_LEGACY                   = 0x40
	SQLITE_TRACE_NONLEGACY_MASK           = 0x0f
	SQLITE_TRACE_PROFILE                  = 0x02
	SQLITE_TRACE_ROW                      = 0x04
	SQLITE_TRACE_STMT                     = 0x01
	SQLITE_TRACE_XPROFILE                 = 0x80
	SQLITE_TRANSACTION                    = 22
	SQLITE_TXN_NONE                       = 0
	SQLITE_TXN_READ                       = 1
	SQLITE_TXN_WRITE                      = 2
	SQLITE_Transitive                     = 0x00000080
	SQLITE_TriggerEQP                     = 0x01000000
	SQLITE_TrustedSchema                  = 0x00000080
	SQLITE_UPDATE                         = 23
	SQLITE_USE_URI                        = 0
	SQLITE_UTF16                          = 4
	SQLITE_UTF16BE                        = 3
	SQLITE_UTF16LE                        = 2
	SQLITE_UTF16NATIVE                    = 2
	SQLITE_UTF16_ALIGNED                  = 8
	SQLITE_UTF8                           = 1
	SQLITE_VDBEINT_H                      = 0
	SQLITE_VDBE_H                         = 0
	SQLITE_VERSION                        = "3.36.0"
	SQLITE_VERSION_NUMBER                 = 3036000
	SQLITE_VTABRISK_High                  = 2
	SQLITE_VTABRISK_Low                   = 0
	SQLITE_VTABRISK_Normal                = 1
	SQLITE_VTAB_CONSTRAINT_SUPPORT        = 1
	SQLITE_VTAB_DIRECTONLY                = 3
	SQLITE_VTAB_INNOCUOUS                 = 2
	SQLITE_WAL_H                          = 0
	SQLITE_WARNING                        = 28
	SQLITE_WARNING_AUTOINDEX              = 284
	SQLITE_WHEREINT_H                     = 0
	SQLITE_WIN32_DATA_DIRECTORY_TYPE      = 1
	SQLITE_WIN32_TEMP_DIRECTORY_TYPE      = 2
	SQLITE_WSD                            = 0
	SQLITE_WindowFunc                     = 0x00000002
	SQLITE_WriteSchema                    = 0x00000001
	SRT_Coroutine                         = 13
	SRT_Discard                           = 4
	SRT_DistFifo                          = 5
	SRT_DistQueue                         = 6
	SRT_EphemTab                          = 12
	SRT_Except                            = 2
	SRT_Exists                            = 3
	SRT_Fifo                              = 8
	SRT_Mem                               = 10
	SRT_Output                            = 9
	SRT_Queue                             = 7
	SRT_Set                               = 11
	SRT_Table                             = 14
	SRT_Union                             = 1
	SRT_Upfrom                            = 15
	STATX_ALL                             = 0x0fff
	STATX_ATIME                           = 0x0020
	STATX_ATTR_APPEND                     = 0x0020
	STATX_ATTR_AUTOMOUNT                  = 0x1000
	STATX_ATTR_COMPRESSED                 = 0x0004
	STATX_ATTR_ENCRYPTED                  = 0x0800
	STATX_ATTR_IMMUTABLE                  = 0x0010
	STATX_ATTR_NODUMP                     = 0x0040
	STATX_BASIC_STATS                     = 0x07ff
	STATX_BLOCKS                          = 0x0400
	STATX_BTIME                           = 0x0800
	STATX_CTIME                           = 0x0080
	STATX_GID                             = 0x0010
	STATX_INO                             = 0x0100
	STATX_MODE                            = 0x0002
	STATX_MTIME                           = 0x0040
	STATX_NLINK                           = 0x0004
	STATX_SIZE                            = 0x0200
	STATX_TYPE                            = 0x0001
	STATX_UID                             = 0x0008
	STATX__RESERVED                       = 0x80000000
	STAT_GET_NDLT                         = 4
	STAT_GET_NEQ                          = 2
	STAT_GET_NLT                          = 3
	STAT_GET_ROWID                        = 1
	STAT_GET_STAT1                        = 0
	STA_CLK                               = 0x8000
	STA_CLOCKERR                          = 0x1000
	STA_DEL                               = 0x0020
	STA_FLL                               = 0x0008
	STA_FREQHOLD                          = 0x0080
	STA_INS                               = 0x0010
	STA_MODE                              = 0x4000
	STA_NANO                              = 0x2000
	STA_PLL                               = 0x0001
	STA_PPSERROR                          = 0x0800
	STA_PPSFREQ                           = 0x0002
	STA_PPSJITTER                         = 0x0200
	STA_PPSSIGNAL                         = 0x0100
	STA_PPSTIME                           = 0x0004
	STA_PPSWANDER                         = 0x0400
	STA_RONLY                             = 65280
	STA_UNSYNC                            = 0x0040
	STDERR_FILENO                         = 2
	STDIN_FILENO                          = 0
	STDOUT_FILENO                         = 1
	STMT_COLUMN_BUSY                      = 3
	STMT_COLUMN_MEM                       = 10
	STMT_COLUMN_NAIDX                     = 6
	STMT_COLUMN_NCOL                      = 1
	STMT_COLUMN_NSCAN                     = 4
	STMT_COLUMN_NSORT                     = 5
	STMT_COLUMN_NSTEP                     = 7
	STMT_COLUMN_REPREP                    = 8
	STMT_COLUMN_RO                        = 2
	STMT_COLUMN_RUN                       = 9
	STMT_COLUMN_SQL                       = 0
	SYNC_FILE_RANGE_WAIT_AFTER            = 4
	SYNC_FILE_RANGE_WAIT_BEFORE           = 1
	SYNC_FILE_RANGE_WRITE                 = 2
	S_BLKSIZE                             = 512
	S_IEXEC                               = 64
	S_IFBLK                               = 24576
	S_IFCHR                               = 8192
	S_IFDIR                               = 16384
	S_IFIFO                               = 4096
	S_IFLNK                               = 40960
	S_IFMT                                = 61440
	S_IFREG                               = 32768
	S_IFSOCK                              = 49152
	S_IREAD                               = 256
	S_IRGRP                               = 32
	S_IROTH                               = 4
	S_IRUSR                               = 256
	S_IRWXG                               = 56
	S_IRWXO                               = 7
	S_IRWXU                               = 448
	S_ISGID                               = 1024
	S_ISUID                               = 2048
	S_ISVTX                               = 512
	S_IWGRP                               = 16
	S_IWOTH                               = 2
	S_IWRITE                              = 128
	S_IWUSR                               = 128
	S_IXGRP                               = 8
	S_IXOTH                               = 1
	S_IXUSR                               = 64
	TCFLSH                                = 0x540B
	TCGETA                                = 0x5405
	TCGETS                                = 0x5401
	TCGETX                                = 0x5432
	TCSBRK                                = 0x5409
	TCSBRKP                               = 0x5425
	TCSETA                                = 0x5406
	TCSETAF                               = 0x5408
	TCSETAW                               = 0x5407
	TCSETS                                = 0x5402
	TCSETSF                               = 0x5404
	TCSETSW                               = 0x5403
	TCSETX                                = 0x5433
	TCSETXF                               = 0x5434
	TCSETXW                               = 0x5435
	TCXONC                                = 0x540A
	TERM_ANDINFO                          = 0x0020
	TERM_CODED                            = 0x0004
	TERM_COPIED                           = 0x0008
	TERM_DYNAMIC                          = 0x0001
	TERM_HEURTRUTH                        = 0x2000
	TERM_HIGHTRUTH                        = 0x4000
	TERM_IS                               = 0x0800
	TERM_LIKE                             = 0x0400
	TERM_LIKECOND                         = 0x0200
	TERM_LIKEOPT                          = 0x0100
	TERM_ORINFO                           = 0x0010
	TERM_OR_OK                            = 0x0040
	TERM_VARSELECT                        = 0x1000
	TERM_VIRTUAL                          = 0x0002
	TERM_VNULL                            = 0x0080
	TF_Autoincrement                      = 0x0008
	TF_Ephemeral                          = 0x4000
	TF_Eponymous                          = 0x8000
	TF_HasGenerated                       = 0x0060
	TF_HasHidden                          = 0x0002
	TF_HasNotNull                         = 0x0800
	TF_HasPrimaryKey                      = 0x0004
	TF_HasStat1                           = 0x0010
	TF_HasStat4                           = 0x2000
	TF_HasStored                          = 0x0040
	TF_HasVirtual                         = 0x0020
	TF_NoVisibleRowid                     = 0x0200
	TF_OOOHidden                          = 0x0400
	TF_Readonly                           = 0x0001
	TF_Shadow                             = 0x1000
	TF_StatsUsed                          = 0x0100
	TF_WithoutRowid                       = 0x0080
	TIMER_ABSTIME                         = 1
	TIMER_END                             = 0
	TIMER_START                           = 0
	TIME_UTC                              = 1
	TIOCCBRK                              = 0x5428
	TIOCCONS                              = 0x541D
	TIOCEXCL                              = 0x540C
	TIOCGETD                              = 0x5424
	TIOCGICOUNT                           = 0x545D
	TIOCGLCKTRMIOS                        = 0x5456
	TIOCGPGRP                             = 0x540F
	TIOCGPTPEER                           = 21569
	TIOCGRS485                            = 0x542E
	TIOCGSERIAL                           = 0x541E
	TIOCGSID                              = 0x5429
	TIOCGSOFTCAR                          = 0x5419
	TIOCGWINSZ                            = 0x5413
	TIOCINQ                               = 21531
	TIOCLINUX                             = 0x541C
	TIOCMBIC                              = 0x5417
	TIOCMBIS                              = 0x5416
	TIOCMGET                              = 0x5415
	TIOCMIWAIT                            = 0x545C
	TIOCMSET                              = 0x5418
	TIOCM_CAR                             = 0x040
	TIOCM_CD                              = 64
	TIOCM_CTS                             = 0x020
	TIOCM_DSR                             = 0x100
	TIOCM_DTR                             = 0x002
	TIOCM_LE                              = 0x001
	TIOCM_RI                              = 128
	TIOCM_RNG                             = 0x080
	TIOCM_RTS                             = 0x004
	TIOCM_SR                              = 0x010
	TIOCM_ST                              = 0x008
	TIOCNOTTY                             = 0x5422
	TIOCNXCL                              = 0x540D
	TIOCOUTQ                              = 0x5411
	TIOCPKT                               = 0x5420
	TIOCPKT_DATA                          = 0
	TIOCPKT_DOSTOP                        = 32
	TIOCPKT_FLUSHREAD                     = 1
	TIOCPKT_FLUSHWRITE                    = 2
	TIOCPKT_IOCTL                         = 64
	TIOCPKT_NOSTOP                        = 16
	TIOCPKT_START                         = 8
	TIOCPKT_STOP                          = 4
	TIOCSBRK                              = 0x5427
	TIOCSCTTY                             = 0x540E
	TIOCSERCONFIG                         = 0x5453
	TIOCSERGETLSR                         = 0x5459
	TIOCSERGETMULTI                       = 0x545A
	TIOCSERGSTRUCT                        = 0x5458
	TIOCSERGWILD                          = 0x5454
	TIOCSERSETMULTI                       = 0x545B
	TIOCSERSWILD                          = 0x5455
	TIOCSER_TEMT                          = 0x01
	TIOCSETD                              = 0x5423
	TIOCSLCKTRMIOS                        = 0x5457
	TIOCSPGRP                             = 0x5410
	TIOCSRS485                            = 0x542F
	TIOCSSERIAL                           = 0x541F
	TIOCSSOFTCAR                          = 0x541A
	TIOCSTI                               = 0x5412
	TIOCSWINSZ                            = 0x5414
	TIOCVHANGUP                           = 0x5437
	TK_ABORT                              = 27
	TK_ACTION                             = 28
	TK_ADD                                = 162
	TK_AFTER                              = 29
	TK_AGG_COLUMN                         = 168
	TK_AGG_FUNCTION                       = 167
	TK_ALL                                = 134
	TK_ALTER                              = 161
	TK_ALWAYS                             = 96
	TK_ANALYZE                            = 30
	TK_AND                                = 44
	TK_ANY                                = 101
	TK_AS                                 = 24
	TK_ASC                                = 31
	TK_ASTERISK                           = 179
	TK_ATTACH                             = 32
	TK_AUTOINCR                           = 125
	TK_BEFORE                             = 33
	TK_BEGIN                              = 5
	TK_BETWEEN                            = 48
	TK_BITAND                             = 102
	TK_BITNOT                             = 113
	TK_BITOR                              = 103
	TK_BLOB                               = 153
	TK_BY                                 = 34
	TK_CASCADE                            = 35
	TK_CASE                               = 156
	TK_CAST                               = 36
	TK_CHECK                              = 123
	TK_COLLATE                            = 112
	TK_COLUMN                             = 166
	TK_COLUMNKW                           = 60
	TK_COMMA                              = 26
	TK_COMMIT                             = 10
	TK_CONCAT                             = 111
	TK_CONFLICT                           = 37
	TK_CONSTRAINT                         = 118
	TK_CREATE                             = 17
	TK_CTIME_KW                           = 100
	TK_CURRENT                            = 85
	TK_DATABASE                           = 38
	TK_DEFAULT                            = 119
	TK_DEFERRABLE                         = 130
	TK_DEFERRED                           = 7
	TK_DELETE                             = 127
	TK_DESC                               = 39
	TK_DETACH                             = 40
	TK_DISTINCT                           = 139
	TK_DO                                 = 61
	TK_DOT                                = 140
	TK_DROP                               = 132
	TK_EACH                               = 41
	TK_ELSE                               = 159
	TK_END                                = 11
	TK_EQ                                 = 53
	TK_ERROR                              = 181
	TK_ESCAPE                             = 58
	TK_EXCEPT                             = 135
	TK_EXCLUDE                            = 91
	TK_EXCLUSIVE                          = 9
	TK_EXISTS                             = 20
	TK_EXPLAIN                            = 2
	TK_FAIL                               = 42
	TK_FILTER                             = 165
	TK_FIRST                              = 83
	TK_FLOAT                              = 152
	TK_FOLLOWING                          = 86
	TK_FOR                                = 62
	TK_FOREIGN                            = 131
	TK_FROM                               = 141
	TK_FUNCTION                           = 171
	TK_GE                                 = 57
	TK_GENERATED                          = 95
	TK_GROUP                              = 145
	TK_GROUPS                             = 92
	TK_GT                                 = 54
	TK_HAVING                             = 146
	TK_ID                                 = 59
	TK_IF                                 = 18
	TK_IF_NULL_ROW                        = 178
	TK_IGNORE                             = 63
	TK_ILLEGAL                            = 183
	TK_IMMEDIATE                          = 8
	TK_IN                                 = 49
	TK_INDEX                              = 160
	TK_INDEXED                            = 115
	TK_INITIALLY                          = 64
	TK_INSERT                             = 126
	TK_INSTEAD                            = 65
	TK_INTEGER                            = 154
	TK_INTERSECT                          = 136
	TK_INTO                               = 150
	TK_IS                                 = 45
	TK_ISNOT                              = 170
	TK_ISNULL                             = 50
	TK_JOIN                               = 142
	TK_JOIN_KW                            = 117
	TK_KEY                                = 67
	TK_LAST                               = 84
	TK_LE                                 = 55
	TK_LIKE_KW                            = 47
	TK_LIMIT                              = 147
	TK_LP                                 = 22
	TK_LSHIFT                             = 104
	TK_LT                                 = 56
	TK_MATCH                              = 46
	TK_MATERIALIZED                       = 97
	TK_MINUS                              = 107
	TK_NE                                 = 52
	TK_NO                                 = 66
	TK_NOT                                = 19
	TK_NOTHING                            = 151
	TK_NOTNULL                            = 51
	TK_NULL                               = 120
	TK_NULLS                              = 82
	TK_OF                                 = 68
	TK_OFFSET                             = 69
	TK_ON                                 = 114
	TK_OR                                 = 43
	TK_ORDER                              = 144
	TK_OTHERS                             = 93
	TK_OVER                               = 164
	TK_PARTITION                          = 87
	TK_PLAN                               = 4
	TK_PLUS                               = 106
	TK_PRAGMA                             = 70
	TK_PRECEDING                          = 88
	TK_PRIMARY                            = 121
	TK_QUERY                              = 3
	TK_RAISE                              = 71
	TK_RANGE                              = 89
	TK_RECURSIVE                          = 72
	TK_REFERENCES                         = 124
	TK_REGISTER                           = 175
	TK_REINDEX                            = 98
	TK_RELEASE                            = 14
	TK_REM                                = 110
	TK_RENAME                             = 99
	TK_REPLACE                            = 73
	TK_RESTRICT                           = 74
	TK_RETURNING                          = 149
	TK_ROLLBACK                           = 12
	TK_ROW                                = 75
	TK_ROWS                               = 76
	TK_RP                                 = 23
	TK_RSHIFT                             = 105
	TK_SAVEPOINT                          = 13
	TK_SELECT                             = 137
	TK_SELECT_COLUMN                      = 177
	TK_SEMI                               = 1
	TK_SET                                = 129
	TK_SLASH                              = 109
	TK_SPACE                              = 182
	TK_SPAN                               = 180
	TK_STAR                               = 108
	TK_STRING                             = 116
	TK_TABLE                              = 16
	TK_TEMP                               = 21
	TK_THEN                               = 158
	TK_TIES                               = 94
	TK_TO                                 = 15
	TK_TRANSACTION                        = 6
	TK_TRIGGER                            = 77
	TK_TRUEFALSE                          = 169
	TK_TRUTH                              = 174
	TK_UMINUS                             = 172
	TK_UNBOUNDED                          = 90
	TK_UNION                              = 133
	TK_UNIQUE                             = 122
	TK_UPDATE                             = 128
	TK_UPLUS                              = 173
	TK_USING                              = 143
	TK_VACUUM                             = 78
	TK_VALUES                             = 138
	TK_VARIABLE                           = 155
	TK_VECTOR                             = 176
	TK_VIEW                               = 79
	TK_VIRTUAL                            = 80
	TK_WHEN                               = 157
	TK_WHERE                              = 148
	TK_WINDOW                             = 163
	TK_WITH                               = 81
	TK_WITHOUT                            = 25
	TMP_MAX                               = 238328
	TRANS_NONE                            = 0
	TRANS_READ                            = 1
	TRANS_WRITE                           = 2
	TRIGGER_AFTER                         = 2
	TRIGGER_BEFORE                        = 1
	UNIXFILE_DELETE                       = 0x20
	UNIXFILE_DIRSYNC                      = 0x08
	UNIXFILE_EXCL                         = 0x01
	UNIXFILE_NOLOCK                       = 0x80
	UNIXFILE_PERSIST_WAL                  = 0x04
	UNIXFILE_PSOW                         = 0x10
	UNIXFILE_RDONLY                       = 0x02
	UNIXFILE_URI                          = 0x40
	UNIX_SHM_BASE                         = 120
	UNIX_SHM_DMS                          = 128
	UNKNOWN_LOCK                          = 5
	UTIME_NOW                             = 1073741823
	UTIME_OMIT                            = 1073741822
	VDBE_DISPLAY_P4                       = 1
	VDBE_MAGIC_DEAD                       = 0x5606c3c8
	VDBE_MAGIC_HALT                       = 0x319c2973
	VDBE_MAGIC_INIT                       = 0x16bceaa5
	VDBE_MAGIC_RESET                      = 0x48fa9f76
	VDBE_MAGIC_RUN                        = 0x2df20da3
	WALINDEX_MAX_VERSION                  = 3007000
	WAL_ALL_BUT_WRITE                     = 1
	WAL_CKPT_LOCK                         = 1
	WAL_EXCLUSIVE_MODE                    = 1
	WAL_FRAME_HDRSIZE                     = 24
	WAL_HDRSIZE                           = 32
	WAL_HEAPMEMORY_MODE                   = 2
	WAL_LOCK_CKPT                         = 1
	WAL_LOCK_READ0                        = 3
	WAL_LOCK_WRITE                        = 0
	WAL_MAGIC                             = 0x377f0682
	WAL_MAX_VERSION                       = 3007000
	WAL_NORMAL_MODE                       = 0
	WAL_NREADER                           = 5
	WAL_RDONLY                            = 1
	WAL_RDWR                              = 0
	WAL_RECOVER_LOCK                      = 2
	WAL_RETRY                             = -1
	WAL_SAVEPOINT_NDATA                   = 4
	WAL_SHM_RDONLY                        = 2
	WAL_WRITE_LOCK                        = 0
	WCONTINUED                            = 8
	WEXITED                               = 4
	WHERE_AGG_DISTINCT                    = 0x0400
	WHERE_AUTO_INDEX                      = 0x00004000
	WHERE_BIGNULL_SORT                    = 0x00080000
	WHERE_BOTH_LIMIT                      = 0x00000030
	WHERE_BTM_LIMIT                       = 0x00000020
	WHERE_COLUMN_EQ                       = 0x00000001
	WHERE_COLUMN_IN                       = 0x00000004
	WHERE_COLUMN_NULL                     = 0x00000008
	WHERE_COLUMN_RANGE                    = 0x00000002
	WHERE_CONSTRAINT                      = 0x0000000f
	WHERE_DISTINCTBY                      = 0x0080
	WHERE_DISTINCT_NOOP                   = 0
	WHERE_DISTINCT_ORDERED                = 2
	WHERE_DISTINCT_UNIQUE                 = 1
	WHERE_DISTINCT_UNORDERED              = 3
	WHERE_DUPLICATES_OK                   = 0x0010
	WHERE_GROUPBY                         = 0x0040
	WHERE_IDX_ONLY                        = 0x00000040
	WHERE_INDEXED                         = 0x00000200
	WHERE_IN_ABLE                         = 0x00000800
	WHERE_IN_EARLYOUT                     = 0x00040000
	WHERE_IN_SEEKSCAN                     = 0x00100000
	WHERE_IPK                             = 0x00000100
	WHERE_MULTI_OR                        = 0x00002000
	WHERE_ONEPASS_DESIRED                 = 0x0004
	WHERE_ONEPASS_MULTIROW                = 0x0008
	WHERE_ONEROW                          = 0x00001000
	WHERE_ORDERBY_LIMIT                   = 0x0800
	WHERE_ORDERBY_MAX                     = 0x0002
	WHERE_ORDERBY_MIN                     = 0x0001
	WHERE_ORDERBY_NORMAL                  = 0x0000
	WHERE_OR_SUBCLAUSE                    = 0x0020
	WHERE_PARTIALIDX                      = 0x00020000
	WHERE_SKIPSCAN                        = 0x00008000
	WHERE_SORTBYGROUP                     = 0x0200
	WHERE_TOP_LIMIT                       = 0x00000010
	WHERE_TRANSCONS                       = 0x00200000
	WHERE_UNQ_WANTED                      = 0x00010000
	WHERE_USE_LIMIT                       = 0x4000
	WHERE_VIRTUALTABLE                    = 0x00000400
	WHERE_WANT_DISTINCT                   = 0x0100
	WINDOW_AGGINVERSE                     = 2
	WINDOW_AGGSTEP                        = 3
	WINDOW_ENDING_INT                     = 1
	WINDOW_ENDING_NUM                     = 4
	WINDOW_NTH_VALUE_INT                  = 2
	WINDOW_RETURN_ROW                     = 1
	WINDOW_STARTING_INT                   = 0
	WINDOW_STARTING_NUM                   = 3
	WNOHANG                               = 1
	WNOWAIT                               = 0x01000000
	WO_ALL                                = 0x1fff
	WO_AND                                = 0x0400
	WO_AUX                                = 0x0040
	WO_EQ                                 = 0x0002
	WO_EQUIV                              = 0x0800
	WO_GE                                 = 32
	WO_GT                                 = 4
	WO_IN                                 = 0x0001
	WO_IS                                 = 0x0080
	WO_ISNULL                             = 0x0100
	WO_LE                                 = 8
	WO_LT                                 = 16
	WO_NOOP                               = 0x1000
	WO_OR                                 = 0x0200
	WO_SINGLE                             = 0x01ff
	WRC_Abort                             = 2
	WRC_Continue                          = 0
	WRC_Prune                             = 1
	WRITE_LOCK                            = 2
	WSTOPPED                              = 2
	WUNTRACED                             = 2
	W_OK                                  = 2
	XN_EXPR                               = -2
	XN_ROWID                              = -1
	X_OK                                  = 1
	YYFALLBACK                            = 1
	YYNOCODE                              = 317
	YYNOERRORRECOVERY                     = 1
	YYNRULE                               = 398
	YYNRULE_WITH_ACTION                   = 337
	YYNSTATE                              = 570
	YYNTOKEN                              = 184
	YYPARSEFREENEVERNULL                  = 1
	YYSTACKDEPTH                          = 100
	YYWILDCARD                            = 101
	YY_ACCEPT_ACTION                      = 1224
	YY_ACTTAB_COUNT                       = 2023
	YY_ERROR_ACTION                       = 1223
	YY_MAX_REDUCE                         = 1623
	YY_MAX_SHIFT                          = 569
	YY_MAX_SHIFTREDUCE                    = 1222
	YY_MIN_REDUCE                         = 1226
	YY_MIN_SHIFTREDUCE                    = 825
	YY_NO_ACTION                          = 1225
	YY_REDUCE_COUNT                       = 405
	YY_REDUCE_MAX                         = 1683
	YY_REDUCE_MIN                         = -266
	YY_SHIFT_COUNT                        = 569
	YY_SHIFT_MAX                          = 2009
	YY_SHIFT_MIN                          = 0
	X_ALLOCA_H                            = 1
	X_ANSI_STDARG_H_                      = 0
	X_ANSI_STDDEF_H                       = 0
	X_ASM_GENERIC_ERRNO_BASE_H            = 0
	X_ASM_GENERIC_ERRNO_H                 = 0
	X_ASM_GENERIC_IOCTL_H                 = 0
	X_ASSERT_H                            = 1
	X_ATFILE_SOURCE                       = 1
	X_BITS_BYTESWAP_H                     = 1
	X_BITS_CPU_SET_H                      = 1
	X_BITS_ERRNO_H                        = 1
	X_BITS_FLOATN_COMMON_H                = 0
	X_BITS_FLOATN_H                       = 0
	X_BITS_LIBM_SIMD_DECL_STUBS_H         = 1
	X_BITS_POSIX_OPT_H                    = 1
	X_BITS_PTHREADTYPES_ARCH_H            = 1
	X_BITS_PTHREADTYPES_COMMON_H          = 1
	X_BITS_SCHED_H                        = 1
	X_BITS_SETJMP_H                       = 1
	X_BITS_STAT_H                         = 1
	X_BITS_STDINT_INTN_H                  = 1
	X_BITS_STDIO_LIM_H                    = 1
	X_BITS_TIMEX_H                        = 1
	X_BITS_TIME_H                         = 1
	X_BITS_TYPESIZES_H                    = 1
	X_BITS_TYPES_H                        = 1
	X_BITS_TYPES_LOCALE_T_H               = 1
	X_BITS_TYPES_STRUCT_SCHED_PARAM       = 1
	X_BITS_TYPES___LOCALE_T_H             = 1
	X_BITS_UINTN_IDENTITY_H               = 1
	X_BSD_PTRDIFF_T_                      = 0
	X_BSD_SIZE_T_                         = 0
	X_BSD_SIZE_T_DEFINED_                 = 0
	X_DEFAULT_SOURCE                      = 1
	X_DLFCN_H                             = 1
	X_ENDIAN_H                            = 1
	X_ERRNO_H                             = 1
	X_FALLOC_H_                           = 0
	X_FCNTL_H                             = 1
	X_FEATURES_H                          = 1
	X_FILE_OFFSET_BITS                    = 64
	X_FTS5INT_H                           = 0
	X_FTS5_H                              = 0
	X_FTSINT_H                            = 0
	X_GCC_MAX_ALIGN_T                     = 0
	X_GCC_PTRDIFF_T                       = 0
	X_GCC_SIZE_T                          = 0
	X_GCC_WCHAR_T                         = 0
	X_GETOPT_CORE_H                       = 1
	X_GETOPT_POSIX_H                      = 1
	X_GNU_SOURCE                          = 0
	X_IOC_DIRBITS                         = 2
	X_IOC_DIRMASK                         = 3
	X_IOC_DIRSHIFT                        = 30
	X_IOC_NONE                            = 0
	X_IOC_NRBITS                          = 8
	X_IOC_NRMASK                          = 255
	X_IOC_NRSHIFT                         = 0
	X_IOC_READ                            = 2
	X_IOC_SIZEBITS                        = 14
	X_IOC_SIZEMASK                        = 16383
	X_IOC_SIZESHIFT                       = 16
	X_IOC_TYPEBITS                        = 8
	X_IOC_TYPEMASK                        = 255
	X_IOC_TYPESHIFT                       = 8
	X_IOC_WRITE                           = 1
	X_IOFBF                               = 0
	X_IOLBF                               = 1
	X_IONBF                               = 2
	X_IO_EOF_SEEN                         = 0x0010
	X_IO_ERR_SEEN                         = 0x0020
	X_IO_USER_LOCK                        = 0x8000
	X_ISOC11_SOURCE                       = 1
	X_ISOC95_SOURCE                       = 1
	X_ISOC99_SOURCE                       = 1
	X_LARGEFILE64_SOURCE                  = 1
	X_LARGEFILE_SOURCE                    = 1
	X_LARGE_FILE                          = 1
	X_LFS64_ASYNCHRONOUS_IO               = 1
	X_LFS64_LARGEFILE                     = 1
	X_LFS64_STDIO                         = 1
	X_LFS_ASYNCHRONOUS_IO                 = 1
	X_LFS_LARGEFILE                       = 1
	X_LINUX_IOCTL_H                       = 0
	X_LP64                                = 1
	X_MATH_H                              = 1
	X_MKNOD_VER                           = 0
	X_MKNOD_VER_LINUX                     = 0
	X_OS_COMMON_H_                        = 0
	X_POSIX2_CHAR_TERM                    = 200809
	X_POSIX2_C_BIND                       = 200809
	X_POSIX2_C_DEV                        = 200809
	X_POSIX2_C_VERSION                    = 200809
	X_POSIX2_LOCALEDEF                    = 200809
	X_POSIX2_SW_DEV                       = 200809
	X_POSIX2_VERSION                      = 200809
	X_POSIX_ADVISORY_INFO                 = 200809
	X_POSIX_ASYNCHRONOUS_IO               = 200809
	X_POSIX_ASYNC_IO                      = 1
	X_POSIX_BARRIERS                      = 200809
	X_POSIX_CHOWN_RESTRICTED              = 0
	X_POSIX_CLOCK_SELECTION               = 200809
	X_POSIX_CPUTIME                       = 0
	X_POSIX_C_SOURCE                      = 200809
	X_POSIX_FSYNC                         = 200809
	X_POSIX_IPV6                          = 200809
	X_POSIX_JOB_CONTROL                   = 1
	X_POSIX_MAPPED_FILES                  = 200809
	X_POSIX_MEMLOCK                       = 200809
	X_POSIX_MEMLOCK_RANGE                 = 200809
	X_POSIX_MEMORY_PROTECTION             = 200809
	X_POSIX_MESSAGE_PASSING               = 200809
	X_POSIX_MONOTONIC_CLOCK               = 0
	X_POSIX_NO_TRUNC                      = 1
	X_POSIX_PRIORITIZED_IO                = 200809
	X_POSIX_PRIORITY_SCHEDULING           = 200809
	X_POSIX_RAW_SOCKETS                   = 200809
	X_POSIX_READER_WRITER_LOCKS           = 200809
	X_POSIX_REALTIME_SIGNALS              = 200809
	X_POSIX_REENTRANT_FUNCTIONS           = 1
	X_POSIX_REGEXP                        = 1
	X_POSIX_SAVED_IDS                     = 1
	X_POSIX_SEMAPHORES                    = 200809
	X_POSIX_SHARED_MEMORY_OBJECTS         = 200809
	X_POSIX_SHELL                         = 1
	X_POSIX_SOURCE                        = 1
	X_POSIX_SPAWN                         = 200809
	X_POSIX_SPIN_LOCKS                    = 200809
	X_POSIX_SPORADIC_SERVER               = -1
	X_POSIX_SYNCHRONIZED_IO               = 200809
	X_POSIX_THREADS                       = 200809
	X_POSIX_THREAD_ATTR_STACKADDR         = 200809
	X_POSIX_THREAD_ATTR_STACKSIZE         = 200809
	X_POSIX_THREAD_CPUTIME                = 0
	X_POSIX_THREAD_PRIORITY_SCHEDULING    = 200809
	X_POSIX_THREAD_PRIO_INHERIT           = 200809
	X_POSIX_THREAD_PRIO_PROTECT           = 200809
	X_POSIX_THREAD_PROCESS_SHARED         = 200809
	X_POSIX_THREAD_ROBUST_PRIO_INHERIT    = 200809
	X_POSIX_THREAD_ROBUST_PRIO_PROTECT    = -1
	X_POSIX_THREAD_SAFE_FUNCTIONS         = 200809
	X_POSIX_THREAD_SPORADIC_SERVER        = -1
	X_POSIX_TIMEOUTS                      = 200809
	X_POSIX_TIMERS                        = 200809
	X_POSIX_TRACE                         = -1
	X_POSIX_TRACE_EVENT_FILTER            = -1
	X_POSIX_TRACE_INHERIT                 = -1
	X_POSIX_TRACE_LOG                     = -1
	X_POSIX_TYPED_MEMORY_OBJECTS          = -1
	X_POSIX_V6_LP64_OFF64                 = 1
	X_POSIX_V6_LPBIG_OFFBIG               = -1
	X_POSIX_V7_LP64_OFF64                 = 1
	X_POSIX_V7_LPBIG_OFFBIG               = -1
	X_POSIX_VDISABLE                      = 0
	X_POSIX_VERSION                       = 200809
	X_PTHREAD_H                           = 1
	X_PTRDIFF_T                           = 0
	X_PTRDIFF_T_                          = 0
	X_PTRDIFF_T_DECLARED                  = 0
	X_SCHED_H                             = 1
	X_SIZET_                              = 0
	X_SIZE_T                              = 0
	X_SIZE_T_                             = 0
	X_SIZE_T_DECLARED                     = 0
	X_SIZE_T_DEFINED                      = 0
	X_SIZE_T_DEFINED_                     = 0
	X_SQLITE3RBU_H                        = 0
	X_SQLITE3RTREE_H_                     = 0
	X_SQLITE_OS_H_                        = 0
	X_STATBUF_ST_BLKSIZE                  = 0
	X_STATBUF_ST_NSEC                     = 0
	X_STATBUF_ST_RDEV                     = 0
	X_STAT_VER                            = 1
	X_STAT_VER_KERNEL                     = 0
	X_STAT_VER_LINUX                      = 1
	X_STDARG_H                            = 0
	X_STDC_PREDEF_H                       = 1
	X_STDDEF_H                            = 0
	X_STDDEF_H_                           = 0
	X_STDIO_H                             = 1
	X_STDLIB_H                            = 1
	X_STRINGS_H                           = 1
	X_STRING_H                            = 1
	X_STRUCT_TIMESPEC                     = 1
	X_SYS_CDEFS_H                         = 1
	X_SYS_IOCTL_H                         = 1
	X_SYS_MMAN_H                          = 1
	X_SYS_SELECT_H                        = 1
	X_SYS_SIZE_T_H                        = 0
	X_SYS_STAT_H                          = 1
	X_SYS_TIME_H                          = 1
	X_SYS_TTYDEFAULTS_H_                  = 0
	X_SYS_TYPES_H                         = 1
	X_THREAD_SHARED_TYPES_H               = 1
	X_TIME_H                              = 1
	X_T_PTRDIFF                           = 0
	X_T_PTRDIFF_                          = 0
	X_T_SIZE                              = 0
	X_T_SIZE_                             = 0
	X_T_WCHAR                             = 0
	X_T_WCHAR_                            = 0
	X_UNISTD_H                            = 1
	X_VA_LIST                             = 0
	X_VA_LIST_                            = 0
	X_VA_LIST_DEFINED                     = 0
	X_VA_LIST_T_H                         = 0
	X_WCHAR_T                             = 0
	X_WCHAR_T_                            = 0
	X_WCHAR_T_DECLARED                    = 0
	X_WCHAR_T_DEFINED                     = 0
	X_WCHAR_T_DEFINED_                    = 0
	X_WCHAR_T_H                           = 0
	X_XBS5_LP64_OFF64                     = 1
	X_XBS5_LPBIG_OFFBIG                   = -1
	X_XOPEN_ENH_I18N                      = 1
	X_XOPEN_LEGACY                        = 1
	X_XOPEN_REALTIME                      = 1
	X_XOPEN_REALTIME_THREADS              = 1
	X_XOPEN_SHM                           = 1
	X_XOPEN_SOURCE                        = 700
	X_XOPEN_SOURCE_EXTENDED               = 1
	X_XOPEN_UNIX                          = 1
	X_XOPEN_VERSION                       = 700
	X_XOPEN_XCU_VERSION                   = 4
	X_XOPEN_XPG2                          = 1
	X_XOPEN_XPG3                          = 1
	X_XOPEN_XPG4                          = 1
	BBatch                                = 0
	EtBUFSIZE                             = 70
	EtCHARX                               = 8
	EtDECIMAL                             = 16
	EtDYNSTRING                           = 6
	EtEXP                                 = 2
	EtFLOAT                               = 1
	EtGENERIC                             = 3
	EtINVALID                             = 17
	EtORDINAL                             = 15
	EtPERCENT                             = 7
	EtPOINTER                             = 13
	EtRADIX                               = 0
	EtSIZE                                = 4
	EtSQLESCAPE                           = 9
	EtSQLESCAPE2                          = 10
	EtSQLESCAPE3                          = 14
	EtSRCITEM                             = 12
	EtSTRING                              = 5
	EtTOKEN                               = 11
	Fts5YYNFTS5TOKEN                      = 16
	Fts5YYNOCODE                          = 27
	Fts5YYNOERRORRECOVERY                 = 1
	Fts5YYNRULE                           = 28
	Fts5YYNRULE_WITH_ACTION               = 28
	Fts5YYNSTATE                          = 35
	Fts5YYPARSEFREENOTNULL                = 1
	Fts5YYSTACKDEPTH                      = 100
	Fts5YY_ACCEPT_ACTION                  = 81
	Fts5YY_ACTTAB_COUNT                   = 105
	Fts5YY_ERROR_ACTION                   = 80
	Fts5YY_MAX_REDUCE                     = 110
	Fts5YY_MAX_SHIFT                      = 34
	Fts5YY_MAX_SHIFTREDUCE                = 79
	Fts5YY_MIN_REDUCE                     = 83
	Fts5YY_MIN_SHIFTREDUCE                = 52
	Fts5YY_NO_ACTION                      = 82
	Fts5YY_REDUCE_COUNT                   = 17
	Fts5YY_REDUCE_MAX                     = 67
	Fts5YY_REDUCE_MIN                     = -17
	Fts5YY_SHIFT_COUNT                    = 34
	Fts5YY_SHIFT_MAX                      = 93
	Fts5YY_SHIFT_MIN                      = 0
	Linux                                 = 1
	Math_errhandling                      = 3
	Sqlite3Fts5ParserCTX_FETCH            = 0
	Sqlite3Fts5ParserCTX_PARAM            = 0
	Sqlite3Fts5ParserCTX_PDECL            = 0
	Sqlite3Fts5ParserCTX_SDECL            = 0
	Sqlite3Fts5ParserCTX_STORE            = 0
	Sqlite3ParserARG_FETCH                = 0
	Sqlite3ParserARG_PARAM                = 0
	Sqlite3ParserARG_PDECL                = 0
	Sqlite3ParserARG_SDECL                = 0
	Sqlite3ParserARG_STORE                = 0
	Sqlite3Parser_ENGINEALWAYSONSTACK     = 1
	TkCREATE                              = 4
	TkEND                                 = 7
	TkEXPLAIN                             = 3
	TkOTHER                               = 2
	TkSEMI                                = 0
	TkTEMP                                = 5
	TkTRIGGER                             = 6
	TkWS                                  = 1
	Unix                                  = 1
	WsdAutoextInit                        = 0
	WsdHooksInit                          = 0
	WsdStatInit                           = 0
)
View Source
const (
	// Matching symbol table entry (const ElfNN_Sym *).
	RTLD_DL_SYMENT = 1

	// The object containing the address (struct link_map *).
	RTLD_DL_LINKMAP = 2
)

These are the possible values for the FLAGS argument to `dladdr1'.

This indicates what extra information is stored at *EXTRA_INFO.
It may also be zero, in which case the EXTRA_INFO argument is not used.
View Source
const (
	// Treat ARG as `lmid_t *'; store namespace ID for HANDLE there.
	RTLD_DI_LMID = 1

	// Treat ARG as `struct link_map **';
	//        store the `struct link_map *' for HANDLE there.
	RTLD_DI_LINKMAP = 2

	RTLD_DI_CONFIGADDR = 3 // Unsupported, defined by Solaris.

	// Treat ARG as `Dl_serinfo *' (see below), and fill in to describe the
	//        directories that will be searched for dependencies of this object.
	//        RTLD_DI_SERINFOSIZE fills in just the `dls_cnt' and `dls_size'
	//        entries to indicate the size of the buffer that must be passed to
	//        RTLD_DI_SERINFO to fill in the full information.
	RTLD_DI_SERINFO     = 4
	RTLD_DI_SERINFOSIZE = 5

	// Treat ARG as `char *', and store there the directory name used to
	//        expand $ORIGIN in this shared object's dependency file names.
	RTLD_DI_ORIGIN = 6

	RTLD_DI_PROFILENAME = 7 // Unsupported, defined by Solaris.
	RTLD_DI_PROFILEOUT  = 8 // Unsupported, defined by Solaris.

	// Treat ARG as `size_t *', and store there the TLS module ID
	//        of this object's PT_TLS segment, as used in TLS relocations;
	//        store zero if this object does not define a PT_TLS segment.
	RTLD_DI_TLS_MODID = 9

	// Treat ARG as `void **', and store there a pointer to the calling
	//        thread's TLS block corresponding to this object's PT_TLS segment.
	//        Store a null pointer if this object does not define a PT_TLS
	//        segment, or if the calling thread has not allocated a block for it.
	RTLD_DI_TLS_DATA = 10

	RTLD_DI_MAX = 10
)

These are the possible values for the REQUEST argument to `dlinfo'.

View Source
const (
	FP_INT_UPWARD            = 0
	FP_INT_DOWNWARD          = 1
	FP_INT_TOWARDZERO        = 2
	FP_INT_TONEARESTFROMZERO = 3
	FP_INT_TONEAREST         = 4
)

Rounding direction macros for fromfp functions.

View Source
const (
	FP_NAN       = 0
	FP_INFINITE  = 1
	FP_ZERO      = 2
	FP_SUBNORMAL = 3
	FP_NORMAL    = 4
)

All floating-point numbers can be put in one of these categories.

View Source
const (
	PTHREAD_RWLOCK_PREFER_READER_NP              = 0
	PTHREAD_RWLOCK_PREFER_WRITER_NP              = 1
	PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP = 2
	PTHREAD_RWLOCK_DEFAULT_NP                    = 0
)

Read-write lock types.

View Source
const (
	PTHREAD_INHERIT_SCHED  = 0
	PTHREAD_EXPLICIT_SCHED = 1
)

Scheduler inheritance.

View Source
const (
	PTHREAD_SCOPE_SYSTEM  = 0
	PTHREAD_SCOPE_PROCESS = 1
)

Scope handling.

View Source
const (
	PTHREAD_PROCESS_PRIVATE = 0
	PTHREAD_PROCESS_SHARED  = 1
)

Process shared or private flag.

View Source
const (
	PTHREAD_CANCEL_ENABLE  = 0
	PTHREAD_CANCEL_DISABLE = 1
)

Cancellation

View Source
const (
	PTHREAD_CANCEL_DEFERRED     = 0
	PTHREAD_CANCEL_ASYNCHRONOUS = 1
)
View Source
const (
	PTHREAD_CREATE_JOINABLE = 0
	PTHREAD_CREATE_DETACHED = 1
)

Detach state.

View Source
const (
	PTHREAD_MUTEX_TIMED_NP      = 0
	PTHREAD_MUTEX_RECURSIVE_NP  = 1
	PTHREAD_MUTEX_ERRORCHECK_NP = 2
	PTHREAD_MUTEX_ADAPTIVE_NP   = 3
	PTHREAD_MUTEX_NORMAL        = 0
	PTHREAD_MUTEX_RECURSIVE     = 1
	PTHREAD_MUTEX_ERRORCHECK    = 2
	PTHREAD_MUTEX_DEFAULT       = 0
	PTHREAD_MUTEX_FAST_NP       = 0
)

Mutex types.

View Source
const (
	PTHREAD_MUTEX_STALLED    = 0
	PTHREAD_MUTEX_STALLED_NP = 0
	PTHREAD_MUTEX_ROBUST     = 1
	PTHREAD_MUTEX_ROBUST_NP  = 1
)

Robust mutex or not flags.

View Source
const (
	PTHREAD_PRIO_NONE    = 0
	PTHREAD_PRIO_INHERIT = 1
	PTHREAD_PRIO_PROTECT = 2
)

Mutex protocols.

View Source
const (
	X_PC_LINK_MAX           = 0
	X_PC_MAX_CANON          = 1
	X_PC_MAX_INPUT          = 2
	X_PC_NAME_MAX           = 3
	X_PC_PATH_MAX           = 4
	X_PC_PIPE_BUF           = 5
	X_PC_CHOWN_RESTRICTED   = 6
	X_PC_NO_TRUNC           = 7
	X_PC_VDISABLE           = 8
	X_PC_SYNC_IO            = 9
	X_PC_ASYNC_IO           = 10
	X_PC_PRIO_IO            = 11
	X_PC_SOCK_MAXBUF        = 12
	X_PC_FILESIZEBITS       = 13
	X_PC_REC_INCR_XFER_SIZE = 14
	X_PC_REC_MAX_XFER_SIZE  = 15
	X_PC_REC_MIN_XFER_SIZE  = 16
	X_PC_REC_XFER_ALIGN     = 17
	X_PC_ALLOC_SIZE_MIN     = 18
	X_PC_SYMLINK_MAX        = 19
	X_PC_2_SYMLINKS         = 20
)

Values for the NAME argument to `pathconf' and `fpathconf'.

View Source
const (
	X_CS_PATH = 0 // The default search path.

	X_CS_V6_WIDTH_RESTRICTED_ENVS = 1

	X_CS_GNU_LIBC_VERSION       = 2
	X_CS_GNU_LIBPTHREAD_VERSION = 3

	X_CS_V5_WIDTH_RESTRICTED_ENVS = 4

	X_CS_V7_WIDTH_RESTRICTED_ENVS = 5

	X_CS_LFS_CFLAGS      = 1000
	X_CS_LFS_LDFLAGS     = 1001
	X_CS_LFS_LIBS        = 1002
	X_CS_LFS_LINTFLAGS   = 1003
	X_CS_LFS64_CFLAGS    = 1004
	X_CS_LFS64_LDFLAGS   = 1005
	X_CS_LFS64_LIBS      = 1006
	X_CS_LFS64_LINTFLAGS = 1007

	X_CS_XBS5_ILP32_OFF32_CFLAGS     = 1100
	X_CS_XBS5_ILP32_OFF32_LDFLAGS    = 1101
	X_CS_XBS5_ILP32_OFF32_LIBS       = 1102
	X_CS_XBS5_ILP32_OFF32_LINTFLAGS  = 1103
	X_CS_XBS5_ILP32_OFFBIG_CFLAGS    = 1104
	X_CS_XBS5_ILP32_OFFBIG_LDFLAGS   = 1105
	X_CS_XBS5_ILP32_OFFBIG_LIBS      = 1106
	X_CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107
	X_CS_XBS5_LP64_OFF64_CFLAGS      = 1108
	X_CS_XBS5_LP64_OFF64_LDFLAGS     = 1109
	X_CS_XBS5_LP64_OFF64_LIBS        = 1110
	X_CS_XBS5_LP64_OFF64_LINTFLAGS   = 1111
	X_CS_XBS5_LPBIG_OFFBIG_CFLAGS    = 1112
	X_CS_XBS5_LPBIG_OFFBIG_LDFLAGS   = 1113
	X_CS_XBS5_LPBIG_OFFBIG_LIBS      = 1114
	X_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115

	X_CS_POSIX_V6_ILP32_OFF32_CFLAGS     = 1116
	X_CS_POSIX_V6_ILP32_OFF32_LDFLAGS    = 1117
	X_CS_POSIX_V6_ILP32_OFF32_LIBS       = 1118
	X_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS  = 1119
	X_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS    = 1120
	X_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS   = 1121
	X_CS_POSIX_V6_ILP32_OFFBIG_LIBS      = 1122
	X_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123
	X_CS_POSIX_V6_LP64_OFF64_CFLAGS      = 1124
	X_CS_POSIX_V6_LP64_OFF64_LDFLAGS     = 1125
	X_CS_POSIX_V6_LP64_OFF64_LIBS        = 1126
	X_CS_POSIX_V6_LP64_OFF64_LINTFLAGS   = 1127
	X_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS    = 1128
	X_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS   = 1129
	X_CS_POSIX_V6_LPBIG_OFFBIG_LIBS      = 1130
	X_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131

	X_CS_POSIX_V7_ILP32_OFF32_CFLAGS     = 1132
	X_CS_POSIX_V7_ILP32_OFF32_LDFLAGS    = 1133
	X_CS_POSIX_V7_ILP32_OFF32_LIBS       = 1134
	X_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS  = 1135
	X_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS    = 1136
	X_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS   = 1137
	X_CS_POSIX_V7_ILP32_OFFBIG_LIBS      = 1138
	X_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139
	X_CS_POSIX_V7_LP64_OFF64_CFLAGS      = 1140
	X_CS_POSIX_V7_LP64_OFF64_LDFLAGS     = 1141
	X_CS_POSIX_V7_LP64_OFF64_LIBS        = 1142
	X_CS_POSIX_V7_LP64_OFF64_LINTFLAGS   = 1143
	X_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS    = 1144
	X_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS   = 1145
	X_CS_POSIX_V7_LPBIG_OFFBIG_LIBS      = 1146
	X_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147

	X_CS_V6_ENV = 1148
	X_CS_V7_ENV = 1149
)

Values for the NAME argument to `confstr'.

View Source
const (
	X_SC_ARG_MAX               = 0
	X_SC_CHILD_MAX             = 1
	X_SC_CLK_TCK               = 2
	X_SC_NGROUPS_MAX           = 3
	X_SC_OPEN_MAX              = 4
	X_SC_STREAM_MAX            = 5
	X_SC_TZNAME_MAX            = 6
	X_SC_JOB_CONTROL           = 7
	X_SC_SAVED_IDS             = 8
	X_SC_REALTIME_SIGNALS      = 9
	X_SC_PRIORITY_SCHEDULING   = 10
	X_SC_TIMERS                = 11
	X_SC_ASYNCHRONOUS_IO       = 12
	X_SC_PRIORITIZED_IO        = 13
	X_SC_SYNCHRONIZED_IO       = 14
	X_SC_FSYNC                 = 15
	X_SC_MAPPED_FILES          = 16
	X_SC_MEMLOCK               = 17
	X_SC_MEMLOCK_RANGE         = 18
	X_SC_MEMORY_PROTECTION     = 19
	X_SC_MESSAGE_PASSING       = 20
	X_SC_SEMAPHORES            = 21
	X_SC_SHARED_MEMORY_OBJECTS = 22
	X_SC_AIO_LISTIO_MAX        = 23
	X_SC_AIO_MAX               = 24
	X_SC_AIO_PRIO_DELTA_MAX    = 25
	X_SC_DELAYTIMER_MAX        = 26
	X_SC_MQ_OPEN_MAX           = 27
	X_SC_MQ_PRIO_MAX           = 28
	X_SC_VERSION               = 29
	X_SC_PAGESIZE              = 30
	X_SC_RTSIG_MAX             = 31
	X_SC_SEM_NSEMS_MAX         = 32
	X_SC_SEM_VALUE_MAX         = 33
	X_SC_SIGQUEUE_MAX          = 34
	X_SC_TIMER_MAX             = 35

	// Values for the argument to `sysconf'
	//        corresponding to _POSIX2_* symbols.
	X_SC_BC_BASE_MAX        = 36
	X_SC_BC_DIM_MAX         = 37
	X_SC_BC_SCALE_MAX       = 38
	X_SC_BC_STRING_MAX      = 39
	X_SC_COLL_WEIGHTS_MAX   = 40
	X_SC_EQUIV_CLASS_MAX    = 41
	X_SC_EXPR_NEST_MAX      = 42
	X_SC_LINE_MAX           = 43
	X_SC_RE_DUP_MAX         = 44
	X_SC_CHARCLASS_NAME_MAX = 45

	X_SC_2_VERSION   = 46
	X_SC_2_C_BIND    = 47
	X_SC_2_C_DEV     = 48
	X_SC_2_FORT_DEV  = 49
	X_SC_2_FORT_RUN  = 50
	X_SC_2_SW_DEV    = 51
	X_SC_2_LOCALEDEF = 52

	X_SC_PII                 = 53
	X_SC_PII_XTI             = 54
	X_SC_PII_SOCKET          = 55
	X_SC_PII_INTERNET        = 56
	X_SC_PII_OSI             = 57
	X_SC_POLL                = 58
	X_SC_SELECT              = 59
	X_SC_UIO_MAXIOV          = 60
	X_SC_IOV_MAX             = 60
	X_SC_PII_INTERNET_STREAM = 61
	X_SC_PII_INTERNET_DGRAM  = 62
	X_SC_PII_OSI_COTS        = 63
	X_SC_PII_OSI_CLTS        = 64
	X_SC_PII_OSI_M           = 65
	X_SC_T_IOV_MAX           = 66

	// Values according to POSIX 1003.1c (POSIX threads).
	X_SC_THREADS                      = 67
	X_SC_THREAD_SAFE_FUNCTIONS        = 68
	X_SC_GETGR_R_SIZE_MAX             = 69
	X_SC_GETPW_R_SIZE_MAX             = 70
	X_SC_LOGIN_NAME_MAX               = 71
	X_SC_TTY_NAME_MAX                 = 72
	X_SC_THREAD_DESTRUCTOR_ITERATIONS = 73
	X_SC_THREAD_KEYS_MAX              = 74
	X_SC_THREAD_STACK_MIN             = 75
	X_SC_THREAD_THREADS_MAX           = 76
	X_SC_THREAD_ATTR_STACKADDR        = 77
	X_SC_THREAD_ATTR_STACKSIZE        = 78
	X_SC_THREAD_PRIORITY_SCHEDULING   = 79
	X_SC_THREAD_PRIO_INHERIT          = 80
	X_SC_THREAD_PRIO_PROTECT          = 81
	X_SC_THREAD_PROCESS_SHARED        = 82

	X_SC_NPROCESSORS_CONF = 83
	X_SC_NPROCESSORS_ONLN = 84
	X_SC_PHYS_PAGES       = 85
	X_SC_AVPHYS_PAGES     = 86
	X_SC_ATEXIT_MAX       = 87
	X_SC_PASS_MAX         = 88

	X_SC_XOPEN_VERSION     = 89
	X_SC_XOPEN_XCU_VERSION = 90
	X_SC_XOPEN_UNIX        = 91
	X_SC_XOPEN_CRYPT       = 92
	X_SC_XOPEN_ENH_I18N    = 93
	X_SC_XOPEN_SHM         = 94

	X_SC_2_CHAR_TERM = 95
	X_SC_2_C_VERSION = 96
	X_SC_2_UPE       = 97

	X_SC_XOPEN_XPG2 = 98
	X_SC_XOPEN_XPG3 = 99
	X_SC_XOPEN_XPG4 = 100

	X_SC_CHAR_BIT   = 101
	X_SC_CHAR_MAX   = 102
	X_SC_CHAR_MIN   = 103
	X_SC_INT_MAX    = 104
	X_SC_INT_MIN    = 105
	X_SC_LONG_BIT   = 106
	X_SC_WORD_BIT   = 107
	X_SC_MB_LEN_MAX = 108
	X_SC_NZERO      = 109
	X_SC_SSIZE_MAX  = 110
	X_SC_SCHAR_MAX  = 111
	X_SC_SCHAR_MIN  = 112
	X_SC_SHRT_MAX   = 113
	X_SC_SHRT_MIN   = 114
	X_SC_UCHAR_MAX  = 115
	X_SC_UINT_MAX   = 116
	X_SC_ULONG_MAX  = 117
	X_SC_USHRT_MAX  = 118

	X_SC_NL_ARGMAX  = 119
	X_SC_NL_LANGMAX = 120
	X_SC_NL_MSGMAX  = 121
	X_SC_NL_NMAX    = 122
	X_SC_NL_SETMAX  = 123
	X_SC_NL_TEXTMAX = 124

	X_SC_XBS5_ILP32_OFF32  = 125
	X_SC_XBS5_ILP32_OFFBIG = 126
	X_SC_XBS5_LP64_OFF64   = 127
	X_SC_XBS5_LPBIG_OFFBIG = 128

	X_SC_XOPEN_LEGACY           = 129
	X_SC_XOPEN_REALTIME         = 130
	X_SC_XOPEN_REALTIME_THREADS = 131

	X_SC_ADVISORY_INFO          = 132
	X_SC_BARRIERS               = 133
	X_SC_BASE                   = 134
	X_SC_C_LANG_SUPPORT         = 135
	X_SC_C_LANG_SUPPORT_R       = 136
	X_SC_CLOCK_SELECTION        = 137
	X_SC_CPUTIME                = 138
	X_SC_THREAD_CPUTIME         = 139
	X_SC_DEVICE_IO              = 140
	X_SC_DEVICE_SPECIFIC        = 141
	X_SC_DEVICE_SPECIFIC_R      = 142
	X_SC_FD_MGMT                = 143
	X_SC_FIFO                   = 144
	X_SC_PIPE                   = 145
	X_SC_FILE_ATTRIBUTES        = 146
	X_SC_FILE_LOCKING           = 147
	X_SC_FILE_SYSTEM            = 148
	X_SC_MONOTONIC_CLOCK        = 149
	X_SC_MULTI_PROCESS          = 150
	X_SC_SINGLE_PROCESS         = 151
	X_SC_NETWORKING             = 152
	X_SC_READER_WRITER_LOCKS    = 153
	X_SC_SPIN_LOCKS             = 154
	X_SC_REGEXP                 = 155
	X_SC_REGEX_VERSION          = 156
	X_SC_SHELL                  = 157
	X_SC_SIGNALS                = 158
	X_SC_SPAWN                  = 159
	X_SC_SPORADIC_SERVER        = 160
	X_SC_THREAD_SPORADIC_SERVER = 161
	X_SC_SYSTEM_DATABASE        = 162
	X_SC_SYSTEM_DATABASE_R      = 163
	X_SC_TIMEOUTS               = 164
	X_SC_TYPED_MEMORY_OBJECTS   = 165
	X_SC_USER_GROUPS            = 166
	X_SC_USER_GROUPS_R          = 167
	X_SC_2_PBS                  = 168
	X_SC_2_PBS_ACCOUNTING       = 169
	X_SC_2_PBS_LOCATE           = 170
	X_SC_2_PBS_MESSAGE          = 171
	X_SC_2_PBS_TRACK            = 172
	X_SC_SYMLOOP_MAX            = 173
	X_SC_STREAMS                = 174
	X_SC_2_PBS_CHECKPOINT       = 175

	X_SC_V6_ILP32_OFF32  = 176
	X_SC_V6_ILP32_OFFBIG = 177
	X_SC_V6_LP64_OFF64   = 178
	X_SC_V6_LPBIG_OFFBIG = 179

	X_SC_HOST_NAME_MAX      = 180
	X_SC_TRACE              = 181
	X_SC_TRACE_EVENT_FILTER = 182
	X_SC_TRACE_INHERIT      = 183
	X_SC_TRACE_LOG          = 184

	X_SC_LEVEL1_ICACHE_SIZE     = 185
	X_SC_LEVEL1_ICACHE_ASSOC    = 186
	X_SC_LEVEL1_ICACHE_LINESIZE = 187
	X_SC_LEVEL1_DCACHE_SIZE     = 188
	X_SC_LEVEL1_DCACHE_ASSOC    = 189
	X_SC_LEVEL1_DCACHE_LINESIZE = 190
	X_SC_LEVEL2_CACHE_SIZE      = 191
	X_SC_LEVEL2_CACHE_ASSOC     = 192
	X_SC_LEVEL2_CACHE_LINESIZE  = 193
	X_SC_LEVEL3_CACHE_SIZE      = 194
	X_SC_LEVEL3_CACHE_ASSOC     = 195
	X_SC_LEVEL3_CACHE_LINESIZE  = 196
	X_SC_LEVEL4_CACHE_SIZE      = 197
	X_SC_LEVEL4_CACHE_ASSOC     = 198
	X_SC_LEVEL4_CACHE_LINESIZE  = 199

	X_SC_IPV6        = 235
	X_SC_RAW_SOCKETS = 236

	X_SC_V7_ILP32_OFF32  = 237
	X_SC_V7_ILP32_OFFBIG = 238
	X_SC_V7_LP64_OFF64   = 239
	X_SC_V7_LPBIG_OFFBIG = 240

	X_SC_SS_REPL_MAX = 241

	X_SC_TRACE_EVENT_NAME_MAX = 242
	X_SC_TRACE_NAME_MAX       = 243
	X_SC_TRACE_SYS_MAX        = 244
	X_SC_TRACE_USER_EVENT_MAX = 245

	X_SC_XOPEN_STREAMS = 246

	X_SC_THREAD_ROBUST_PRIO_INHERIT = 247
	X_SC_THREAD_ROBUST_PRIO_PROTECT = 248
)

Values for the argument to `sysconf'.

View Source
const (
	F_OWNER_TID  = 0 // Kernel thread.
	F_OWNER_PID  = 1 // Process.
	F_OWNER_PGRP = 2 // Process group.
	F_OWNER_GID  = 2
)

Owner types.

View Source
const (
	P_ALL  = 0 // Wait for any child.
	P_PID  = 1 // Wait for specified process.
	P_PGID = 2
)
View Source
const (
	// Timers run in real time.
	ITIMER_REAL = 0
	// Timers run only when the process is executing.
	ITIMER_VIRTUAL = 1
	// Timers run when the process is executing and when
	//        the system is executing on behalf of the process.
	ITIMER_PROF = 2
)

Values for the first argument to `getitimer' and `setitimer'.

Variables

View Source
var CAPI = map[string]struct{}{}/* 1294 elements not displayed */
View Source
var Xsqlite3Config = Sqlite3Config{
	FbCoreMutex:         U8(1),
	FbFullMutex:         (U8(libc.Bool32(SQLITE_THREADSAFE == 1))),
	FbUseCis:            U8(SQLITE_ALLOW_COVERING_INDEX_SCAN),
	FbExtraSchemaChecks: U8(1),
	FmxStrlen:           0x7ffffffe,
	FszLookaside:        1200, FnLookaside: 40,
	FnStmtSpill:          (64 * 1024),
	FmxMmap:              int64(SQLITE_MAX_MMAP_SIZE),
	FnPage:               SQLITE_DEFAULT_PCACHE_INITSZ,
	FszPma:               U32(SQLITE_SORTER_PMASZ),
	FmxMemdbSize:         int64(SQLITE_MEMDB_DEFAULT_MAXSIZE),
	FiOnceResetThreshold: 0x7ffffffe,
	FszSorterRef:         U32(SQLITE_DEFAULT_SORTERREF_SIZE),

} /* sqlite3.c:21032:48 */

The following singleton contains the global configuration for the SQLite library.

View Source
var Xsqlite3CtypeMap = [256]uint8{} /* sqlite3.c:20912:36 *//* 256 elements not displayed */

The following 256 byte lookup table is used to support SQLites built-in equivalents to the following standard library functions:

isspace()                        0x01
isalpha()                        0x02
isdigit()                        0x04
isalnum()                        0x06
isxdigit()                       0x08
toupper()                        0x20
SQLite identifier character      0x40
Quote character                  0x80

Bit 0x20 is set if the mapped character requires translation to upper case. i.e. if the character is a lower-case ASCII character. If x is a lower-case ASCII character, then its upper-case equivalent is (x - 0x20). Therefore toupper() can be implemented as:

(x & ~(map[x]&0x20))

The equivalent of tolower() is implemented using the sqlite3UpperToLower[] array. tolower() is used more often than toupper() by SQLite.

Bit 0x40 is set if the character is non-alphanumeric and can be used in an SQLite identifier. Identifiers are alphanumerics, "_", "$", and any non-ASCII UTF character. Hence the test for whether or not a character is part of an identifier is 0x46.

View Source
var Xsqlite3OSTrace int32 = SQLITE_DEBUG_OS_TRACE /* sqlite3.c:165220:7 */

When compiling the test fixture or with debugging enabled (on Win32), this variable being set to non-zero will cause OSTRACE macros to emit extra diagnostic information.

View Source
var Xsqlite3OpcodeProperty = [180]uint8{} /* sqlite3.c:21138:36 */ /* 180 elements not displayed */

#include "opcodes.h" Properties of opcodes. The OPFLG_INITIALIZER macro is created by mkopcodeh.awk during compilation. Data is obtained from the comments following the "case OP_xxxx:" statements in the vdbe.c file.

View Source
var Xsqlite3PendingByte int32 = 0x40000000 /* sqlite3.c:21122:20 */

The value of the "pending" byte must be 0x40000000 (1 byte past the 1-gibabyte boundary) in a compatible database. SQLite never uses the database page that contains the pending byte. It never attempts to read or write that page. The pending byte page is set aside for use by the VFS layers as space for managing file locks.

During testing, it is often desirable to move the pending byte to a different position in the file. This allows code that has to deal with the pending byte to run on files that are much smaller than 1 GiB. The sqlite3_test_control() interface can be used to move the pending byte.

IMPORTANT: Changing the pending byte to any value other than 0x40000000 results in an incompatible database file format! Changing the pending byte during operation will result in undefined and incorrect behavior.

View Source
var Xsqlite3SharedCacheList uintptr = uintptr(0) /* sqlite3.c:65527:25 */

A list of BtShared objects that are eligible for participation in shared cache. This variable has file scope during normal builds, but the test harness needs to access it so we make it global for test builds.

Access to this variable is protected by SQLITE_MUTEX_STATIC_MAIN.

View Source
var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 452)) /* sqlite3.c:21143:27 */

Name of the default collating sequence

View Source
var Xsqlite3UpperToLower = [274]uint8{} /* sqlite3.c:20818:36 *//* 274 elements not displayed */

An array to map all upper-case characters into their corresponding lower-case character.

SQLite only considers US-ASCII (or EBCDIC) characters. We do not handle case conversions for the UTF character set since the tables involved are nearly as big or bigger than SQLite itself.

View Source
var Xsqlite3_current_time int32 = 0 /* sqlite3.c:40770:16 */

The following variable, if set to a non-zero value, is interpreted as the number of seconds since 1970 and is used to set the result of sqlite3OsCurrentTime() during testing.

View Source
var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:165249:17 */

If the following global variable points to a string which is the name of a directory, then that directory will be used to store all database files specified with a relative pathname.

See also the "PRAGMA data_store_directory" SQL command.

View Source
var Xsqlite3_diskfull int32 = 0 /* sqlite3.c:23455:16 */
View Source
var Xsqlite3_diskfull_pending int32 = 0 /* sqlite3.c:23454:16 */
View Source
var Xsqlite3_found_count int32 = 0 /* sqlite3.c:86518:16 */

The next global variable is incremented each time the OP_Found opcode is executed. This is used to test whether or not the foreign key operation implemented using OP_FkIsZero is working. This variable has no function other than to help verify the correct operation of the library.

View Source
var Xsqlite3_fullsync_count int32 = 0 /* sqlite3.c:37611:16 */
View Source
var Xsqlite3_interrupt_count int32 = 0 /* sqlite3.c:86470:16 */

When this global variable is positive, it gets decremented once before each instruction in the VDBE. When it reaches zero, the u1.isInterrupted field of the sqlite3 structure is set in order to simulate an interrupt.

This facility is used for testing purposes only. It does not function in an ordinary build.

View Source
var Xsqlite3_io_error_benign int32 = 0 /* sqlite3.c:23453:16 */ // True if errors are benign
View Source
var Xsqlite3_io_error_hardhit int32 = 0 /* sqlite3.c:23450:16 */ // Number of non-benign errors
View Source
var Xsqlite3_io_error_hit int32 = 0 /* sqlite3.c:23449:16 */ // Total number of I/O Errors

If we compile with the SQLITE_TEST macro set, then the following block of code will give us the ability to simulate a disk I/O error. This is used for testing the I/O recovery logic.

View Source
var Xsqlite3_io_error_pending int32 = 0 /* sqlite3.c:23451:16 */ // Count down to first I/O error
View Source
var Xsqlite3_io_error_persist int32 = 0 /* sqlite3.c:23452:16 */ // True if I/O errors persist
View Source
var Xsqlite3_like_count int32 = 0 /* sqlite3.c:120145:16 */

Count the number of times that the LIKE operator (or GLOB which is just a variation of LIKE) gets called. This is used for testing only.

View Source
var Xsqlite3_max_blobsize int32 = 0 /* sqlite3.c:86492:16 */

The next global variable records the size of the largest MEM_Blob or MEM_Str that has been used by a VDBE opcode. The test procedures use this information to make sure that the zero-blob functionality is working correctly. This variable has no function other than to help verify the correct operation of the library.

View Source
var Xsqlite3_memdebug_vfs_oom_test int32 = 1 /* sqlite3.c:23490:16 */

The default SQLite sqlite3_vfs implementations do not allocate memory (actually, os_unix.c allocates a small amount of memory from within OsOpen()), but some third-party implementations may. So we test the effects of a malloc() failing and the sqlite3OsXXX() function returning SQLITE_IOERR_NOMEM using the DO_OS_MALLOC_TEST macro.

The following functions are instrumented for malloc() failure testing:

sqlite3OsRead()
sqlite3OsWrite()
sqlite3OsSync()
sqlite3OsFileSize()
sqlite3OsLock()
sqlite3OsCheckReservedLock()
sqlite3OsFileControl()
sqlite3OsShmMap()
sqlite3OsOpen()
sqlite3OsDelete()
sqlite3OsAccess()
sqlite3OsFullPathname()
View Source
var Xsqlite3_open_file_count int32 = 0 /* sqlite3.c:23462:16 */

When testing, also keep a count of the number of open files.

View Source
var Xsqlite3_opentemp_count int32 = 0 /* sqlite3.c:56238:16 */

The following global variable is incremented whenever the library attempts to open a temporary file. This information is used for testing and analysis only.

View Source
var Xsqlite3_pager_readdb_count int32 = 0 /* sqlite3.c:53362:16 */ // Number of full pages read from DB

The following global variables hold counters used for testing purposes only. These variables do not exist in a non-testing build. These variables are not thread-safe.

View Source
var Xsqlite3_pager_writedb_count int32 = 0 /* sqlite3.c:53363:16 */ // Number of full pages written to DB
View Source
var Xsqlite3_pager_writej_count int32 = 0 /* sqlite3.c:53364:16 */ // Number of pages written to journal
View Source
var Xsqlite3_search_count int32 = 0 /* sqlite3.c:86458:16 */

The following global variable is incremented every time a cursor moves, either by the OP_SeekXX, OP_Next, or OP_Prev opcodes. The test procedures use this information to make sure that indices are working correctly. This variable has no function other than to help verify the correct operation of the library.

View Source
var Xsqlite3_sort_count int32 = 0 /* sqlite3.c:86481:16 */

The next global variable is incremented each type the OP_Sort opcode is executed. The test procedures use this information to make sure that sorting is occurring or not occurring at appropriate times. This variable has no function other than to help verify the correct operation of the library.

View Source
var Xsqlite3_sync_count int32 = 0 /* sqlite3.c:37610:16 */

Count the number of fullsyncs and normal syncs. This is used to test that syncs and fullsyncs are occurring at the right times.

View Source
var Xsqlite3_temp_directory uintptr = uintptr(0) /* sqlite3.c:165240:17 */

If the following global variable points to a string which is the name of a directory, then that directory will be used to store temporary files.

See also the "PRAGMA temp_store_directory" SQL command.

View Source
var Xsqlite3_version = *(*[7]int8)(unsafe.Pointer(ts + 445)) /* sqlite3.c:1244:23 */

CAPI3REF: Run-Time Library Version Numbers KEYWORDS: sqlite3_version sqlite3_sourceid

These interfaces provide the same information as the SQLITE_VERSION, SQLITE_VERSION_NUMBER, and SQLITE_SOURCE_ID C preprocessor macros but are associated with the library instead of the header file. ^(Cautious programmers might include assert() statements in their application to verify that values returned by these interfaces match the macros in the header, and thus ensure that the application is compiled with matching library and header files.

assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );

^The sqlite3_version[] string constant contains the text of SQLITE_VERSION macro. ^The sqlite3_libversion() function returns a pointer to the to the sqlite3_version[] string constant. The sqlite3_libversion() function is provided for use in DLLs since DLL users usually do not have direct access to string constants within the DLL. ^The sqlite3_libversion_number() function returns an integer equal to SQLITE_VERSION_NUMBER. ^(The sqlite3_sourceid() function returns a pointer to a string constant whose value is the same as the SQLITE_SOURCE_ID C preprocessor macro. Except if SQLite is built using an edited copy of [the amalgamation], then the last four characters of the hash might be different from SQLITE_SOURCE_ID.)^

See also: [sqlite_version()] and [sqlite_source_id()].

View Source
var Xsqlite3_xferopt_count int32 /* sqlite3.c:125666:16: */

The following global variable is incremented whenever the transfer optimization is used. This is used for testing purposes only - to make sure the transfer optimization really is happening when it is supposed to.

View Source
var Xsqlite3aEQb uintptr = 0 /* sqlite3.c:20881:36 */
View Source
var Xsqlite3aGTb uintptr = 0 /* sqlite3.c:20882:36 */
View Source
var Xsqlite3aLTb uintptr = 0 /* sqlite3.c:20880:36 */

Functions

func Xdisable_simulated_io_errors

func Xdisable_simulated_io_errors(tls *libc.TLS)

func Xenable_simulated_io_errors

func Xenable_simulated_io_errors(tls *libc.TLS)

func XrbuVacuumIndexStart

func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr

This function is called as part of restating an RBU vacuum when the current operation is writing content to an index. If possible, it queries the target index b-tree for the largest key already written to it, then composes and returns an expression that can be used in a WHERE clause to select the remaining required rows from the source table. It is only possible to return such an expression if:

  • The index contains no DESC columns, and
  • The last key written to the index before the operation was suspended does not contain any NULL values.

The expression is of the form:

(index-field1, index-field2, ...) > (?, ?, ...)

except that the "?" placeholders are replaced with literal values.

If the expression cannot be created, NULL is returned. In this case, the caller has to use an OFFSET clause to extract only the required rows from the sourct table, just as it does for an RBU update operation.

func Xsqlite3AbsInt32

func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32

Compute the absolute value of a 32-bit signed integer, of possible. Or if the integer has a value of -2147483648, return +2147483647

func Xsqlite3AddCheckConstraint

func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintptr, zStart uintptr, zEnd uintptr)

Add a new CHECK constraint to the table currently under construction.

func Xsqlite3AddCollateType

func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr)

Set the collation function of the most recently parsed table column to the CollSeq given.

func Xsqlite3AddColumn

func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintptr)

Add a new column to the table currently being constructed.

The parser calls this routine once for each column declaration in a CREATE TABLE statement. sqlite3StartTable() gets called first to get things going. Then this routine is called for each column.

func Xsqlite3AddDefaultValue

func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStart uintptr, zEnd uintptr)

The expression is the default value for the most recently added column of the table currently under construction.

Default value expressions must be constant. Raise an exception if this is not the case.

This routine is called by the parser while in the middle of parsing a CREATE TABLE statement.

func Xsqlite3AddGenerated

func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType uintptr)

Change the most recently parsed column to be a GENERATED ALWAYS AS column.

func Xsqlite3AddInt64

func Xsqlite3AddInt64(tls *libc.TLS, pA uintptr, iB I64) int32

Attempt to add, substract, or multiply the 64-bit signed value iB against the other 64-bit signed integer at *pA and store the result in *pA. Return 0 on success. Or if the operation would have resulted in an overflow, leave *pA unchanged and return 1.

func Xsqlite3AddNotNull

func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32)

This routine is called by the parser while in the middle of parsing a CREATE TABLE statement. A "NOT NULL" constraint has been seen on a column. This routine sets the notNull flag on the column currently under construction.

func Xsqlite3AddPrimaryKey

func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError int32, autoInc int32, sortOrder int32)

Designate the PRIMARY KEY for the table. pList is a list of names of columns that form the primary key. If pList is NULL, then the most recently added column of the table is the primary key.

A table can have at most one primary key. If the table already has a primary key (and this is the second primary key) then create an error.

If the PRIMARY KEY is on a single column whose datatype is INTEGER, then we will try to use that column as the rowid. Set the Table.iPKey field of the table under construction to be the index of the INTEGER PRIMARY KEY column. Table.iPKey is set to -1 if there is no INTEGER PRIMARY KEY.

If the key is not an INTEGER PRIMARY KEY, then create a unique index for the key. No index is created for INTEGER PRIMARY KEYs.

func Xsqlite3AddReturning

func Xsqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr)

Add the RETURNING clause to the parse currently underway.

This routine creates a special TEMP trigger that will fire for each row of the DML statement. That TEMP trigger contains a single SELECT statement with a result set that is the argument of the RETURNING clause. The trigger has the Trigger.bReturning flag and an opcode of TK_RETURNING instead of TK_SELECT, so that the trigger code generator knows to handle it specially. The TEMP trigger is automatically removed at the end of the parse.

When this routine is called, we do not yet know if the RETURNING clause is attached to a DELETE, INSERT, or UPDATE, so construct it as a RETURNING trigger instead. It will then be converted into the appropriate type on the first call to sqlite3TriggersExist().

func Xsqlite3AffinityType

func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8

Scan the column type name zType (length nType) and return the associated affinity type.

This routine does a case-independent search of zType for the substrings in the following table. If one of the substrings is found, the corresponding affinity is returned. If zType contains more than one of the substrings, entries toward the top of the table take priority. For example, if zType is 'BLOBINT', SQLITE_AFF_INTEGER is returned.

Substring | Affinity -------------------------------- 'INT' | SQLITE_AFF_INTEGER 'CHAR' | SQLITE_AFF_TEXT 'CLOB' | SQLITE_AFF_TEXT 'TEXT' | SQLITE_AFF_TEXT 'BLOB' | SQLITE_AFF_BLOB 'REAL' | SQLITE_AFF_REAL 'FLOA' | SQLITE_AFF_REAL 'DOUB' | SQLITE_AFF_REAL

If none of the substrings in the above table are found, SQLITE_AFF_NUMERIC is returned.

func Xsqlite3AggInfoPersistWalkerInit

func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uintptr)

Initialize a Walker object so that will persist AggInfo entries referenced by the tree that is walked.

func Xsqlite3AllocateIndexObject

func Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int32, ppExtra uintptr) uintptr

Allocate heap space to hold an Index object with nCol columns.

Increase the allocation size to provide an extra nExtra bytes of 8-byte aligned space after the Index object and return a pointer to this extra space in *ppExtra.

func Xsqlite3AlterBeginAddColumn

func Xsqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr)

This function is called by the parser after the table-name in an "ALTER TABLE <table-name> ADD" statement is parsed. Argument pSrc is the full-name of the table being altered.

This routine makes a (partial) copy of the Table structure for the table being altered and sets Parse.pNewTable to point to it. Routines called by the parser as the column definition is parsed (i.e. sqlite3AddColumn()) add the new Column data to the copy. The copy of the Table structure is deleted by tokenize.c after parsing is finished.

Routine sqlite3AlterFinishAddColumn() will be called to complete coding the "ALTER TABLE ... ADD" statement.

func Xsqlite3AlterDropColumn

func Xsqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr)

This function is called by the parser upon parsing an

ALTER TABLE pSrc DROP COLUMN pName

statement. Argument pSrc contains the possibly qualified name of the table being edited, and token pName the name of the column to drop.

func Xsqlite3AlterFinishAddColumn

func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr)

This function is called after an "ALTER TABLE ... ADD" statement has been parsed. Argument pColDef contains the text of the new column definition.

The Table structure pParse->pNewTable was extended to include the new column during parsing.

func Xsqlite3AlterFunctions

func Xsqlite3AlterFunctions(tls *libc.TLS)

Register built-in functions used to help implement ALTER TABLE

func Xsqlite3AlterRenameColumn

func Xsqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld uintptr, pNew uintptr)

Handles the following parser reduction:

cmd ::= ALTER TABLE pSrc RENAME COLUMN pOld TO pNew

func Xsqlite3AlterRenameTable

func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr)

Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" command.

func Xsqlite3AnalysisLoad

func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32

Load the content of the sqlite_stat1 and sqlite_stat4 tables. The contents of sqlite_stat1 are used to populate the Index.aiRowEst[] arrays. The contents of sqlite_stat4 are used to populate the Index.aSample[] arrays.

If the sqlite_stat1 table is not present in the database, SQLITE_ERROR is returned. In this case, even if SQLITE_ENABLE_STAT4 was defined during compilation and the sqlite_stat4 table is present, no data is read from it.

If SQLITE_ENABLE_STAT4 was defined during compilation and the sqlite_stat4 table is not present in the database, SQLITE_ERROR is returned. However, in this case, data is read from the sqlite_stat1 table (if it is present) before returning.

If an OOM error occurs, this function always sets db->mallocFailed. This means if the caller does not care about other errors, the return code may be ignored.

func Xsqlite3Analyze

func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr)

Generate code for the ANALYZE command. The parser calls this routine when it recognizes an ANALYZE command.

ANALYZE                            -- 1
ANALYZE  <database>                -- 2
ANALYZE  ?<database>.?<tablename>  -- 3

Form 1 causes all indices in all attached databases to be analyzed. Form 2 analyzes all indices the single database named. Form 3 analyzes all indices associated with the named table.

func Xsqlite3ApiExit

func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32

This function must be called before exiting any API function (i.e. returning control to the user) that has called sqlite3_malloc or sqlite3_realloc.

The returned value is normally a copy of the second argument to this function. However, if a malloc() failure has occurred since the previous invocation SQLITE_NOMEM is returned instead.

If an OOM as occurred, then the connection error-code (the value returned by sqlite3_errcode()) is set to SQLITE_NOMEM.

func Xsqlite3ArrayAllocate

func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry int32, pnEntry uintptr, pIdx uintptr) uintptr

pArray is a pointer to an array of objects. Each object in the array is szEntry bytes in size. This routine uses sqlite3DbRealloc() to extend the array so that there is space for a new object at the end.

When this function is called, *pnEntry contains the current size of the array (in entries - so the allocation is ((*pnEntry) * szEntry) bytes in total).

If the realloc() is successful (i.e. if no OOM condition occurs), the space allocated for the new object is zeroed, *pnEntry updated to reflect the new size of the array and a pointer to the new allocation returned. *pIdx is set to the index of the new array entry in this case.

Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains unchanged and a copy of pArray returned.

func Xsqlite3AtoF

func Xsqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc U8) int32

The string z[] is an text representation of a real number. Convert this string to a double and write it into *pResult.

The string z[] is length bytes in length (bytes, not characters) and uses the encoding enc. The string is not necessarily zero-terminated.

Return TRUE if the result is a valid real number (or integer) and FALSE if the string is empty or contains extraneous text. More specifically return

 1          =>  The input string is a pure integer
 2 or more  =>  The input has a decimal point or eNNN clause
 0 or less  =>  The input string is not a valid number
-1          =>  Not a valid number, but has a valid prefix which
                includes a decimal point and/or an eNNN clause

Valid numbers are in one of these formats:

[+-]digits[E[+-]digits]
[+-]digits.[digits][E[+-]digits]
[+-].digits[E[+-]digits]

Leading and trailing whitespace is ignored for the purpose of determining validity.

If some prefix of the input string is a valid number, this routine returns FALSE but it still converts the prefix and writes the result into *pResult.

func Xsqlite3Atoi

func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32

Return a 32-bit integer value extracted from a string. If the string is not an integer, just return 0.

func Xsqlite3Atoi64

func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc U8) int32

Convert zNum to a 64-bit signed integer. zNum must be decimal. This routine does *not* accept hexadecimal notation.

Returns:

-1    Not even a prefix of the input text looks like an integer
 0    Successful transformation.  Fits in a 64-bit signed integer.
 1    Excess non-space text after the integer value
 2    Integer too large for a 64-bit signed integer or is malformed
 3    Special case of 9223372036854775808

length is the number of bytes in the string (bytes, not characters). The string is not necessarily zero-terminated. The encoding is given by enc.

func Xsqlite3Attach

func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, pKey uintptr)

Called by the parser to compile an ATTACH statement.

ATTACH p AS pDbname KEY pKey

func Xsqlite3AuthCheck

func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr) int32

Do an authorization check using the code and arguments given. Return either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY is returned, then the error count and error message in pParse are modified appropriately.

func Xsqlite3AuthContextPop

func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr)

Pop an authorization context that was previously pushed by sqlite3AuthContextPush

func Xsqlite3AuthContextPush

func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zContext uintptr)

Push an authorization context. After this routine is called, the zArg3 argument to authorization callbacks will be zContext until popped. Or if pParse==0, this routine is a no-op.

func Xsqlite3AuthRead

func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uintptr, pTabList uintptr)

The pExpr should be a TK_COLUMN expression. The table referred to is in pTabList or else it is the NEW or OLD table of a trigger. Check to see if it is OK to read this particular column.

If the auth function returns SQLITE_IGNORE, change the TK_COLUMN instruction into a TK_NULL. If the auth function returns SQLITE_DENY, then generate an error.

func Xsqlite3AuthReadCol

func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintptr, iDb int32) int32

Invoke the authorization callback for permission to read column zCol from table zTab in database zDb. This function assumes that an authorization callback has been registered (i.e. that sqlite3.xAuth is not NULL).

If SQLITE_IGNORE is returned and pExpr is not NULL, then pExpr is changed to an SQL NULL expression. Otherwise, if pExpr is NULL, then SQLITE_IGNORE is treated as SQLITE_DENY. In this case an error is left in pParse.

func Xsqlite3AutoLoadExtensions

func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr)

Load all automatic extensions.

If anything goes wrong, set an error in the database connection.

func Xsqlite3AutoincrementBegin

func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr)

This routine generates code that will initialize all of the register used by the autoincrement tracker.

func Xsqlite3AutoincrementEnd

func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr)

func Xsqlite3BackupRestart

func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr)

Restart the backup process. This is called when the pager layer detects that the database has been modified by an external database connection. In this case there is no way of knowing which of the pages that have been copied into the destination database are still valid and which are not, so the entire process needs to be restarted.

It is assumed that the mutex associated with the BtShared object corresponding to the source database is held when this function is called.

func Xsqlite3BackupUpdate

func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uintptr)

func Xsqlite3BeginBenignMalloc

func Xsqlite3BeginBenignMalloc(tls *libc.TLS)

This (sqlite3EndBenignMalloc()) is called by SQLite code to indicate that subsequent malloc failures are benign. A call to sqlite3EndBenignMalloc() indicates that subsequent malloc failures are non-benign.

func Xsqlite3BeginTransaction

func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32)

Generate VDBE code for a BEGIN statement.

func Xsqlite3BeginTrigger

func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, tr_tm int32, op int32, pColumns uintptr, pTableName uintptr, pWhen uintptr, isTemp int32, noErr int32)

This is called by the parser when it sees a CREATE TRIGGER statement up to the point of the BEGIN before the trigger actions. A Trigger structure is generated based on the information available and stored in pParse->pNewTrigger. After the trigger actions have been parsed, the sqlite3FinishTrigger() function is called to complete the trigger construction process.

func Xsqlite3BeginWriteOperation

func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int32, iDb int32)

Generate VDBE code that prepares for doing an operation that might change the database.

This routine starts a new transaction if we are not already within a transaction. If we are already within a transaction, then a checkpoint is set if the setStatement parameter is true. A checkpoint should be set for operations that might fail (due to a constraint) part of the way through and which will need to undo some writes without having to rollback the whole transaction. For operations where all constraints can be checked before any changes are made to the database, it is never necessary to undo a write and the checkpoint should not be set.

func Xsqlite3BenignMallocHooks

func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr)

Register hooks to call when sqlite3BeginBenignMalloc() and sqlite3EndBenignMalloc() are called, respectively.

func Xsqlite3BinaryCompareCollSeq

func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr

Return a pointer to the collation sequence that should be used by a binary comparison operator comparing pLeft and pRight.

If the left hand expression has a collating sequence type, then it is used. Otherwise the collation sequence for the right hand expression is used, or the default (BINARY) if neither expression has a collating type.

Argument pRight (but not pLeft) may be a null pointer. In this case, it is not considered.

func Xsqlite3BitvecBuiltinTest

func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32

This routine runs an extensive test of the Bitvec code.

The input is an array of integers that acts as a program to test the Bitvec. The integers are opcodes followed by 0, 1, or 3 operands, depending on the opcode. Another opcode follows immediately after the last operand.

There are 6 opcodes numbered from 0 through 5. 0 is the "halt" opcode and causes the test to end.

0          Halt and return the number of errors
1 N S X    Set N bits beginning with S and incrementing by X
2 N S X    Clear N bits beginning with S and incrementing by X
3 N        Set N randomly chosen bits
4 N        Clear N randomly chosen bits
5 N S X    Set N bits from S increment X in array only, not in bitvec

The opcodes 1 through 4 perform set and clear operations are performed on both a Bitvec object and on a linear array of bits obtained from malloc. Opcode 5 works on the linear array only, not on the Bitvec. Opcode 5 is used to deliberately induce a fault in order to confirm that error detection works.

At the conclusion of the test the linear array is compared against the Bitvec object. If there are any differences, an error is returned. If they are the same, zero is returned.

If a memory allocation error occurs, return -1.

func Xsqlite3BitvecClear

func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr)

Clear the i-th bit.

pBuf must be a pointer to at least BITVEC_SZ bytes of temporary storage that BitvecClear can use to rebuilt its hash table.

func Xsqlite3BitvecCreate

func Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr

Create a new bitmap object able to handle bits between 0 and iSize, inclusive. Return a pointer to the new object. Return NULL if malloc fails.

func Xsqlite3BitvecDestroy

func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr)

Destroy a bitmap object. Reclaim all memory used.

func Xsqlite3BitvecSet

func Xsqlite3BitvecSet(tls *libc.TLS, p uintptr, i U32) int32

Set the i-th bit. Return 0 on success and an error code if anything goes wrong.

This routine might cause sub-bitmaps to be allocated. Failing to get the memory needed to hold the sub-bitmap is the only that can go wrong with an insert, assuming p and i are valid.

The calling function must ensure that p is a valid Bitvec object and that the value for "i" is within range of the Bitvec object. Otherwise the behavior is undefined.

func Xsqlite3BitvecTest

func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32

func Xsqlite3BitvecTestNotNull

func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32

Check to see if the i-th bit is set. Return true or false. If p is NULL (if the bitmap has not been created) or if i is out of range, then return false.

func Xsqlite3BlobCompare

func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32

Compare two blobs. Return negative, zero, or positive if the first is less than, equal to, or greater than the second, respectively. If one blob is a prefix of the other, then the shorter is the lessor.

func Xsqlite3BtreeBeginStmt

func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32

Start a statement subtransaction. The subtransaction can be rolled back independently of the main transaction. You must start a transaction before starting a subtransaction. The subtransaction is ended automatically if the main transaction commits or rolls back.

Statement subtransactions are used around individual SQL statements that are contained within a BEGIN...COMMIT block. If a constraint error occurs within the statement, the effect of that one statement can be rolled back without having to rollback the entire transaction.

A statement sub-transaction is implemented as an anonymous savepoint. The value passed as the second parameter is the total number of savepoints, including the new anonymous savepoint, open on the B-Tree. i.e. if there are no active savepoints and no other statement-transactions open, iStatement is 1. This anonymous savepoint can be released or rolled back using the sqlite3BtreeSavepoint() function.

func Xsqlite3BtreeBeginTrans

func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) int32

Attempt to start a new transaction. A write-transaction is started if the second argument is nonzero, otherwise a read- transaction. If the second argument is 2 or more and exclusive transaction is started, meaning that no other process is allowed to access the database. A preexisting transaction may not be upgraded to exclusive by calling this routine a second time - the exclusivity flag only works for a new transaction.

A write-transaction must be started before attempting any changes to the database. None of the following routines will work unless a transaction is started first:

sqlite3BtreeCreateTable()
sqlite3BtreeCreateIndex()
sqlite3BtreeClearTable()
sqlite3BtreeDropTable()
sqlite3BtreeInsert()
sqlite3BtreeDelete()
sqlite3BtreeUpdateMeta()

If an initial attempt to acquire the lock fails because of lock contention and the database was previously unlocked, then invoke the busy handler if there is one. But if there was previously a read-lock, do not invoke the busy handler - just return SQLITE_BUSY. SQLITE_BUSY is returned when there is already a read-lock in order to avoid a deadlock.

Suppose there are two processes A and B. A has a read lock and B has a reserved lock. B tries to promote to exclusive but is blocked because of A's read lock. A tries to promote to reserved but is blocked by B. One or the other of the two processes must give way or there can be no progress. By returning SQLITE_BUSY and not invoking the busy callback when A already has a read lock, we encourage A to give up and let B proceed.

func Xsqlite3BtreeCheckpoint

func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32

Run a checkpoint on the Btree passed as the first argument.

Return SQLITE_LOCKED if this or any other connection has an open transaction on the shared-cache the argument Btree is connected to.

Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.

func Xsqlite3BtreeClearCursor

func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr)

Clear the current cursor position.

func Xsqlite3BtreeClearTable

func Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange uintptr) int32

Delete all information from a single table in the database. iTable is the page number of the root of the table. After this routine returns, the root page is empty, but still exists.

This routine will fail with SQLITE_LOCKED if there are any open read cursors on the table. Open write cursors are moved to the root of the table.

If pnChange is not NULL, then the integer value pointed to by pnChange is incremented by the number of entries in the table.

func Xsqlite3BtreeClearTableOfCursor

func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32

Delete all information from the single table that pCur is open on.

This routine only work for pCur on an ephemeral table.

func Xsqlite3BtreeClose

func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32

Close an open database and invalidate all cursors.

func Xsqlite3BtreeCloseCursor

func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32

Close a cursor. The read lock on the database file is released when the last cursor is closed.

func Xsqlite3BtreeCommit

func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32

Do both phases of a commit.

func Xsqlite3BtreeCommitPhaseOne

func Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) int32

This routine does the first phase of a two-phase commit. This routine causes a rollback journal to be created (if it does not already exist) and populated with enough information so that if a power loss occurs the database can be restored to its original state by playing back the journal. Then the contents of the journal are flushed out to the disk. After the journal is safely on oxide, the changes to the database are written into the database file and flushed to oxide. At the end of this call, the rollback journal still exists on the disk and we are still holding all locks, so the transaction has not committed. See sqlite3BtreeCommitPhaseTwo() for the second phase of the commit process.

This call is a no-op if no write-transaction is currently active on pBt.

Otherwise, sync the database file for the btree pBt. zSuperJrnl points to the name of a super-journal file that should be written into the individual journal file, or is NULL, indicating no super-journal file (single database transaction).

When this is called, the super-journal should already have been created, populated with this journal pointer and synced to disk.

Once this is routine has returned, the only thing required to commit the write-transaction for this database file is to delete the journal.

func Xsqlite3BtreeCommitPhaseTwo

func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32

Commit the transaction currently in progress.

This routine implements the second phase of a 2-phase commit. The sqlite3BtreeCommitPhaseOne() routine does the first phase and should be invoked prior to calling this routine. The sqlite3BtreeCommitPhaseOne() routine did all the work of writing information out to disk and flushing the contents so that they are written onto the disk platter. All this routine has to do is delete or truncate or zero the header in the the rollback journal (which causes the transaction to commit) and drop locks.

Normally, if an error occurs while the pager layer is attempting to finalize the underlying journal file, this function returns an error and the upper layer will attempt a rollback. However, if the second argument is non-zero then this b-tree transaction is part of a multi-file transaction. In this case, the transaction has already been committed (by deleting a super-journal file) and the caller will ignore this functions return code. So, even if an error occurs in the pager layer, reset the b-tree objects internal state to indicate that the write transaction has been closed. This is quite safe, as the pager will have transitioned to the error state.

This will release the write lock on the database file. If there are no active cursors, it also releases the read lock.

func Xsqlite3BtreeConnectionCount

func Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32

Return the number of connections to the BtShared object accessed by the Btree handle passed as the only argument. For private caches this is always 1. For shared caches it may be 1 or greater.

func Xsqlite3BtreeCopyFile

func Xsqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32

Copy the complete content of pBtFrom into pBtTo. A transaction must be active for both files.

The size of file pTo may be reduced by this operation. If anything goes wrong, the transaction on pTo is rolled back. If successful, the transaction is committed before returning.

func Xsqlite3BtreeCount

func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr) int32

The first argument, pCur, is a cursor opened on some b-tree. Count the number of entries in the b-tree and write the result to *pnEntry.

SQLITE_OK is returned if the operation is successfully executed. Otherwise, if an error is encountered (i.e. an IO error or database corruption) an SQLite error code is returned.

func Xsqlite3BtreeCreateTable

func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags int32) int32

func Xsqlite3BtreeCursor

func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32

func Xsqlite3BtreeCursorHasHint

func Xsqlite3BtreeCursorHasHint(tls *libc.TLS, pCsr uintptr, mask uint32) int32

Return true if the cursor has a hint specified. This routine is only used from within assert() statements

func Xsqlite3BtreeCursorHasMoved

func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32

Determine whether or not a cursor has moved from the position where it was last placed, or has been invalidated for any other reason. Cursors can move when the row they are pointing at is deleted out from under them, for example. Cursor might also move if a btree is rebalanced.

Calling this routine with a NULL cursor pointer returns false.

Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor back to where it ought to be if this routine returns true.

func Xsqlite3BtreeCursorHintFlags

func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32)

Provide flag hints to the cursor.

func Xsqlite3BtreeCursorIsValidNN

func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32

func Xsqlite3BtreeCursorPin

func Xsqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr)

Pin or unpin a cursor.

func Xsqlite3BtreeCursorRestore

func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintptr) int32

This routine restores a cursor back to its original position after it has been moved by some outside activity (such as a btree rebalance or a row having been deleted out from under the cursor).

On success, the *pDifferentRow parameter is false if the cursor is left pointing at exactly the same row. *pDifferntRow is the row the cursor was pointing to has been deleted, forcing the cursor to point to some nearby row.

This routine should only be called for a cursor that just returned TRUE from sqlite3BtreeCursorHasMoved().

func Xsqlite3BtreeCursorSize

func Xsqlite3BtreeCursorSize(tls *libc.TLS) int32

Return the size of a BtCursor object in bytes.

This interfaces is needed so that users of cursors can preallocate sufficient storage to hold a cursor. The BtCursor object is opaque to users so they cannot do the sizeof() themselves - they must call this routine.

func Xsqlite3BtreeCursorUnpin

func Xsqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr)

func Xsqlite3BtreeCursorZero

func Xsqlite3BtreeCursorZero(tls *libc.TLS, p uintptr)

Initialize memory that will be converted into a BtCursor object.

The simple approach here would be to memset() the entire object to zero. But it turns out that the apPage[] and aiIdx[] arrays do not need to be zeroed and they are large, so we can save a lot of run-time by skipping the initialization of those elements.

func Xsqlite3BtreeDelete

func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32

Delete the entry that the cursor is pointing to.

If the BTREE_SAVEPOSITION bit of the flags parameter is zero, then the cursor is left pointing at an arbitrary location after the delete. But if that bit is set, then the cursor is left in a state such that the next call to BtreeNext() or BtreePrev() moves it to the same row as it would have been on if the call to BtreeDelete() had been omitted.

The BTREE_AUXDELETE bit of flags indicates that is one of several deletes associated with a single table entry and its indexes. Only one of those deletes is considered the "primary" delete. The primary delete occurs on a cursor that is not a BTREE_FORDELETE cursor. All but one delete operation on non-FORDELETE cursors is tagged with the AUXDELETE flag. The BTREE_AUXDELETE bit is a hint that is not used by this implementation, but which might be used by alternative storage engines.

func Xsqlite3BtreeDropTable

func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uintptr) int32

func Xsqlite3BtreeEnter

func Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr)

Enter a mutex on the given BTree object.

If the object is not sharable, then no mutex is ever required and this routine is a no-op. The underlying mutex is non-recursive. But we keep a reference count in Btree.wantToLock so the behavior of this interface is recursive.

To avoid deadlocks, multiple Btrees are locked in the same order by all database connections. The p->pNext is a list of other Btrees belonging to the same database connection as the p Btree which need to be locked after p. If we cannot get a lock on p, then first unlock all of the others on p->pNext, then wait for the lock to become available on p, then relock all of the subsequent Btrees that desire a lock.

func Xsqlite3BtreeEnterAll

func Xsqlite3BtreeEnterAll(tls *libc.TLS, db uintptr)

func Xsqlite3BtreeEnterCursor

func Xsqlite3BtreeEnterCursor(tls *libc.TLS, pCur uintptr)

Enter a mutex on a Btree given a cursor owned by that Btree.

These entry points are used by incremental I/O only. Enter() is required any time OMIT_SHARED_CACHE is not defined, regardless of whether or not the build is threadsafe. Leave() is only required by threadsafe builds.

func Xsqlite3BtreeEof

func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32

Return TRUE if the cursor is not pointing at an entry of the table.

TRUE will be returned after a call to sqlite3BtreeNext() moves past the last entry in the table or sqlite3BtreePrev() moves past the first entry. TRUE is also returned if the table is empty.

func Xsqlite3BtreeFakeValidCursor

func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr

Return a pointer to a fake BtCursor object that will always answer false to the sqlite3BtreeCursorHasMoved() routine above. The fake cursor returned must not be used with any other Btree interface.

func Xsqlite3BtreeFirst

func Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32

Move the cursor to the first entry in the table. Return SQLITE_OK on success. Set *pRes to 0 if the cursor actually points to something or set *pRes to 1 if the table is empty.

func Xsqlite3BtreeGetAutoVacuum

func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32

Return the value of the 'auto-vacuum' property. If auto-vacuum is enabled 1 is returned. Otherwise 0.

func Xsqlite3BtreeGetFilename

func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr

Return the full pathname of the underlying database file. Return an empty string if the database is in-memory or a TEMP database.

The pager filename is invariant as long as the pager is open so it is safe to access without the BtShared mutex.

func Xsqlite3BtreeGetJournalname

func Xsqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) uintptr

Return the pathname of the journal file for this database. The return value of this routine is the same regardless of whether the journal file has been created or not.

The pager journal filename is invariant as long as the pager is open so it is safe to access without the BtShared mutex.

func Xsqlite3BtreeGetMeta

func Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr)

This function may only be called if the b-tree connection already has a read or write transaction open on the database.

Read the meta-information out of a database file. Meta[0] is the number of free pages currently in the database. Meta[1] through meta[15] are available for use by higher layers. Meta[0] is read-only, the others are read/write.

The schema layer numbers meta values differently. At the schema layer (and the SetCookie and ReadCookie opcodes) the number of free pages is not visible. So Cookie[0] is the same as Meta[1].

This routine treats Meta[BTREE_DATA_VERSION] as a special case. Instead of reading the value out of the header, it instead loads the "DataVersion" from the pager. The BTREE_DATA_VERSION value is not actually stored in the database file. It is a number computed by the pager. But its access pattern is the same as header meta values, and so it is convenient to read it from this routine.

func Xsqlite3BtreeGetPageSize

func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32

Return the currently defined page size

func Xsqlite3BtreeGetRequestedReserve

func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32

Return the number of bytes of space at the end of every page that are intentually left unused. This is the "reserved" space that is sometimes used by extensions.

The value returned is the larger of the current reserve size and the latest reserve size requested by SQLITE_FILECTRL_RESERVE_BYTES. The amount of reserve can only grow - never shrink.

func Xsqlite3BtreeGetReserveNoMutex

func Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32

This function is similar to sqlite3BtreeGetReserve(), except that it may only be called if it is guaranteed that the b-tree mutex is already held.

This is useful in one special case in the backup API code where it is known that the shared b-tree mutex is held, but the mutex on the database handle that owns *p is not. In this case if sqlite3BtreeEnter() were to be called, it might collide with some other operation on the database handle that owns *p, causing undefined behavior.

func Xsqlite3BtreeIncrVacuum

func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32

A write-transaction must be opened before calling this function. It performs a single unit of work towards an incremental vacuum.

If the incremental vacuum is finished after this function has run, SQLITE_DONE is returned. If it is not finished, but no error occurred, SQLITE_OK is returned. Otherwise an SQLite error code.

func Xsqlite3BtreeIncrblobCursor

func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr)

Mark this cursor as an incremental blob cursor.

func Xsqlite3BtreeInsert

func Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, seekResult int32) int32

Insert a new record into the BTree. The content of the new record is described by the pX object. The pCur cursor is used only to define what table the record should be inserted into, and is left pointing at a random location.

For a table btree (used for rowid tables), only the pX.nKey value of the key is used. The pX.pKey value must be NULL. The pX.nKey is the rowid or INTEGER PRIMARY KEY of the row. The pX.nData,pData,nZero fields hold the content of the row.

For an index btree (used for indexes and WITHOUT ROWID tables), the key is an arbitrary byte sequence stored in pX.pKey,nKey. The pX.pData,nData,nZero fields must be zero.

If the seekResult parameter is non-zero, then a successful call to MovetoUnpacked() to seek cursor pCur to (pKey,nKey) has already been performed. In other words, if seekResult!=0 then the cursor is currently pointing to a cell that will be adjacent to the cell to be inserted. If seekResult<0 then pCur points to a cell that is smaller then (pKey,nKey). If seekResult>0 then pCur points to a cell that is larger than (pKey,nKey).

If seekResult==0, that means pCur is pointing at some unknown location. In that case, this routine must seek the cursor to the correct insertion point for (pKey,nKey) before doing the insertion. For index btrees, if pX->nMem is non-zero, then pX->aMem contains pointers to the unpacked key values and pX->aMem can be used instead of pX->pKey to avoid having to decode the key.

func Xsqlite3BtreeIntegrityCheck

func Xsqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uintptr, nRoot int32, mxErr int32, pnErr uintptr) uintptr

This routine does a complete check of the given BTree file. aRoot[] is an array of pages numbers were each page number is the root page of a table. nRoot is the number of entries in aRoot.

A read-only or read-write transaction must be opened before calling this function.

Write the number of error seen in *pnErr. Except for some memory allocation errors, an error message held in memory obtained from malloc is returned if *pnErr is non-zero. If *pnErr==0 then NULL is returned. If a memory allocation error occurs, NULL is returned.

If the first entry in aRoot[] is 0, that indicates that the list of root pages is incomplete. This is a "partial integrity-check". This happens when performing an integrity check on a single table. The zero is skipped, of course. But in addition, the freelist checks and the checks to make sure every page is referenced are also skipped, since obviously it is not possible to know which pages are covered by the unverified btrees. Except, if aRoot[1] is 1, then the freelist checks are still performed.

func Xsqlite3BtreeIsInBackup

func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32

Return true if there is currently a backup running on Btree p.

func Xsqlite3BtreeIsReadonly

func Xsqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) int32

Return true if the given Btree is read-only.

func Xsqlite3BtreeLast

func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32

Move the cursor to the last entry in the table. Return SQLITE_OK on success. Set *pRes to 0 if the cursor actually points to something or set *pRes to 1 if the table is empty.

func Xsqlite3BtreeLeave

func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr)

Exit the recursive mutex on a Btree.

func Xsqlite3BtreeLeaveAll

func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr)

func Xsqlite3BtreeLeaveCursor

func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr)

func Xsqlite3BtreeLockTable

func Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8) int32

Obtain a lock on the table whose root page is iTab. The lock is a write lock if isWritelock is true or a read lock if it is false.

func Xsqlite3BtreeMovetoUnpacked

func Xsqlite3BtreeMovetoUnpacked(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, intKey I64, biasRight int32, pRes uintptr) int32

Move the cursor so that it points to an entry near the key specified by pIdxKey or intKey. Return a success code.

For INTKEY tables, the intKey parameter is used. pIdxKey must be NULL. For index tables, pIdxKey is used and intKey is ignored.

If an exact match is not found, then the cursor is always left pointing at a leaf page which would hold the entry if it were present. The cursor might point to an entry that comes before or after the key.

An integer is written into *pRes which is the result of comparing the key with the entry to which the cursor is pointing. The meaning of the integer written into *pRes is as follows:

*pRes<0      The cursor is left pointing at an entry that
             is smaller than intKey/pIdxKey or if the table is empty
             and the cursor is therefore left point to nothing.

*pRes==0     The cursor is left pointing at an entry that
             exactly matches intKey/pIdxKey.

*pRes>0      The cursor is left pointing at an entry that
             is larger than intKey/pIdxKey.

For index tables, the pIdxKey->eqSeen field is set to 1 if there exists an entry in the table that exactly matches pIdxKey.

func Xsqlite3BtreeNewDb

func Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32

Initialize the first page of the database file (creating a database consisting of a single page and no schema objects). Return SQLITE_OK if successful, or an SQLite error code otherwise.

func Xsqlite3BtreeNext

func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32

func Xsqlite3BtreeOpen

func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintptr, ppBtree uintptr, flags int32, vfsFlags int32) int32

Open a database file.

zFilename is the name of the database file. If zFilename is NULL then an ephemeral database is created. The ephemeral database might be exclusively in memory, or it might use a disk-based memory cache. Either way, the ephemeral database will be automatically deleted when sqlite3BtreeClose() is called.

If zFilename is ":memory:" then an in-memory database is created that is automatically destroyed when it is closed.

The "flags" parameter is a bitmask that might contain bits like BTREE_OMIT_JOURNAL and/or BTREE_MEMORY.

If the database is already opened in the same database connection and we are in shared cache mode, then the open will fail with an SQLITE_CONSTRAINT error. We cannot allow two or more BtShared objects in the same database connection since doing so will lead to problems with locking.

func Xsqlite3BtreePager

func Xsqlite3BtreePager(tls *libc.TLS, p uintptr) uintptr

Return the pager associated with a BTree. This routine is used for testing and debugging only.

func Xsqlite3BtreePayload

func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32

Read part of the payload for the row at which that cursor pCur is currently pointing. "amt" bytes will be transferred into pBuf[]. The transfer begins at "offset".

pCur can be pointing to either a table or an index b-tree. If pointing to a table btree, then the content section is read. If pCur is pointing to an index b-tree then the key section is read.

For sqlite3BtreePayload(), the caller must ensure that pCur is pointing to a valid row in the table. For sqlite3BtreePayloadChecked(), the cursor might be invalid or might need to be restored before being read.

Return SQLITE_OK on success or an error code if anything goes wrong. An error is returned if "offset+amt" is larger than the available payload.

func Xsqlite3BtreePayloadChecked

func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32

func Xsqlite3BtreePayloadFetch

func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr

For the entry that cursor pCur is point to, return as many bytes of the key or data as are available on the local b-tree page. Write the number of available bytes into *pAmt.

The pointer returned is ephemeral. The key/data may move or be destroyed on the next call to any Btree routine, including calls from other threads against the same cache. Hence, a mutex on the BtShared should be held prior to calling this routine.

These routines is used to get quick access to key and data in the common case where no overflow pages are used.

func Xsqlite3BtreePrevious

func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32

func Xsqlite3BtreePutData

func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z uintptr) int32

Argument pCsr must be a cursor opened for writing on an INTKEY table currently pointing at a valid table entry. This function modifies the data stored as part of that entry.

Only the data content may only be modified, it is not possible to change the length of the data stored. If this function is called with parameters that attempt to write past the end of the existing data, no modifications are made and SQLITE_CORRUPT is returned.

func Xsqlite3BtreeRollback

func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly int32) int32

Rollback the transaction in progress.

If tripCode is not SQLITE_OK then cursors will be invalidated (tripped). Only write cursors are tripped if writeOnly is true but all cursors are tripped if writeOnly is false. Any attempt to use a tripped cursor will result in an error.

This will release the write lock on the database file. If there are no active cursors, it also releases the read lock.

func Xsqlite3BtreeSavepoint

func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32) int32

The second argument to this function, op, is always SAVEPOINT_ROLLBACK or SAVEPOINT_RELEASE. This function either releases or rolls back the savepoint identified by parameter iSavepoint, depending on the value of op.

Normally, iSavepoint is greater than or equal to zero. However, if op is SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the contents of the entire transaction are rolled back. This is different from a normal transaction rollback, as no locks are released and the transaction remains open.

func Xsqlite3BtreeSchema

func Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) uintptr

This function returns a pointer to a blob of memory associated with a single shared-btree. The memory is used by client code for its own purposes (for example, to store a high-level schema associated with the shared-btree). The btree layer manages reference counting issues.

The first time this is called on a shared-btree, nBytes bytes of memory are allocated, zeroed, and returned to the caller. For each subsequent call the nBytes parameter is ignored and a pointer to the same blob of memory returned.

If the nBytes parameter is 0 and the blob of memory has not yet been allocated, a null pointer is returned. If the blob has already been allocated, it is returned as normal.

Just before the shared-btree is closed, the function passed as the xFree argument when the memory allocation was made is invoked on the blob of allocated memory. The xFree function should not call sqlite3_free() on the memory, the btree layer does that.

func Xsqlite3BtreeSchemaLocked

func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32

Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared btree as the argument handle holds an exclusive lock on the sqlite_schema table. Otherwise SQLITE_OK.

func Xsqlite3BtreeSecureDelete

func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32

Change the values for the BTS_SECURE_DELETE and BTS_OVERWRITE flags:

newFlag==0       Both BTS_SECURE_DELETE and BTS_OVERWRITE are cleared
newFlag==1       BTS_SECURE_DELETE set and BTS_OVERWRITE is cleared
newFlag==2       BTS_SECURE_DELETE cleared and BTS_OVERWRITE is set
newFlag==(-1)    No changes

This routine acts as a query if newFlag is less than zero

With BTS_OVERWRITE set, deleted content is overwritten by zeros, but freelist leaf pages are not written back to the database. Thus in-page deleted content is cleared, but freelist deleted content is not.

With BTS_SECURE_DELETE, operation is like BTS_OVERWRITE with the addition that freelist leaf pages are written back into the database, increasing the amount of disk I/O.

func Xsqlite3BtreeSetAutoVacuum

func Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int32

Change the 'auto-vacuum' property of the database. If the 'autoVacuum' parameter is non-zero, then auto-vacuum mode is enabled. If zero, it is disabled. The default value for the auto-vacuum property is determined by the SQLITE_DEFAULT_AUTOVACUUM macro.

func Xsqlite3BtreeSetCacheSize

func Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32

Change the "soft" limit on the number of pages in the cache. Unused and unmodified pages will be recycled when the number of pages in the cache exceeds this soft limit. But the size of the cache is allowed to grow larger than this limit if it contains dirty pages or pages still in active use.

func Xsqlite3BtreeSetMmapLimit

func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) int32

Change the limit on the amount of the database file that may be memory mapped.

func Xsqlite3BtreeSetPageSize

func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve int32, iFix int32) int32

Change the default pages size and the number of reserved bytes per page. Or, if the page size has already been fixed, return SQLITE_READONLY without changing anything.

The page size must be a power of 2 between 512 and 65536. If the page size supplied does not meet this constraint then the page size is not changed.

Page sizes are constrained to be a power of two so that the region of the database file used for locking (beginning at PENDING_BYTE, the first byte past the 1GB boundary, 0x40000000) needs to occur at the beginning of a page.

If parameter nReserve is less than zero, then the number of reserved bytes per page is left unchanged.

If the iFix!=0 then the BTS_PAGESIZE_FIXED flag is set so that the page size and autovacuum mode can no longer be changed.

func Xsqlite3BtreeSetPagerFlags

func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32

Change the way data is synced to disk in order to increase or decrease how well the database resists damage due to OS crashes and power failures. Level 1 is the same as asynchronous (no syncs() occur and there is a high probability of damage) Level 2 is the default. There is a very low but non-zero probability of damage. Level 3 reduces the probability of damage to near zero but with a write performance reduction.

func Xsqlite3BtreeSetSpillSize

func Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32

Change the "spill" limit on the number of pages in the cache. If the number of pages exceeds this limit during a write transaction, the pager might attempt to "spill" pages to the journal early in order to free up memory.

The value returned is the current spill size. If zero is passed as an argument, no changes are made to the spill size setting, so using mxPage of 0 is a way to query the current spill size.

func Xsqlite3BtreeSetVersion

func Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int32

Set both the "read version" (single byte at byte offset 18) and "write version" (single byte at byte offset 19) fields in the database header to iVersion.

func Xsqlite3BtreeSharable

func Xsqlite3BtreeSharable(tls *libc.TLS, p uintptr) int32

Return true if the Btree passed as the only argument is sharable.

func Xsqlite3BtreeTransferRow

func Xsqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey I64) int32

This function is used as part of copying the current row from cursor pSrc into cursor pDest. If the cursors are open on intkey tables, then parameter iKey is used as the rowid value when the record is copied into pDest. Otherwise, the record is copied verbatim.

This function does not actually write the new value to cursor pDest. Instead, it creates and populates any required overflow pages and writes the data for the new cell into the BtShared.pTmpSpace buffer for the destination database. The size of the cell, in bytes, is left in BtShared.nPreformatSize. The caller completes the insertion by calling sqlite3BtreeInsert() with the BTREE_PREFORMAT flag specified.

SQLITE_OK is returned if successful, or an SQLite error code otherwise.

func Xsqlite3BtreeTripAllCursors

func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, writeOnly int32) int32

This routine sets the state to CURSOR_FAULT and the error code to errCode for every cursor on any BtShared that pBtree references. Or if the writeOnly flag is set to 1, then only trip write cursors and leave read cursors unchanged.

Every cursor is a candidate to be tripped, including cursors that belong to other database connections that happen to be sharing the cache with pBtree.

This routine gets called when a rollback occurs. If the writeOnly flag is true, then only write-cursors need be tripped - read-only cursors save their current positions so that they may continue following the rollback. Or, if writeOnly is false, all cursors are tripped. In general, writeOnly is false if the transaction being rolled back modified the database schema. In this case b-tree root pages may be moved or deleted from the database altogether, making it unsafe for read cursors to continue.

If the writeOnly flag is true and an error is encountered while saving the current position of a read-only cursor, all cursors, including all read-cursors are tripped.

SQLITE_OK is returned if successful, or if an error occurs while saving a cursor position, an SQLite error code.

func Xsqlite3BtreeTxnState

func Xsqlite3BtreeTxnState(tls *libc.TLS, p uintptr) int32

Return one of SQLITE_TXN_NONE, SQLITE_TXN_READ, or SQLITE_TXN_WRITE to describe the current transaction state of Btree p.

func Xsqlite3BtreeUpdateMeta

func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int32

Write meta-information back into the database. Meta[0] is read-only and may not be written.

func Xsqlite3CantopenError

func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32

func Xsqlite3ChangeCookie

func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32)

Generate code that will increment the schema cookie.

The schema cookie is used to determine when the schema for the database changes. After each schema change, the cookie value changes. When a process first reads the schema it records the cookie. Thereafter, whenever it goes to access the database, it checks the cookie to make sure the schema has not changed since it was last read.

This plan is not completely bullet-proof. It is possible for the schema to change multiple times and for the cookie to be set back to prior value. But schema changes are infrequent and the probability of hitting the same cookie value is only 1 chance in 2^32. So we're safe enough.

IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments the schema-version whenever the schema changes.

func Xsqlite3CheckCollSeq

func Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32

This routine is called on a collation sequence before it is used to check that it is defined. An undefined collation sequence exists when a database is loaded that contains references to collation sequences that have not been defined by sqlite3_create_collation() etc.

If required, this routine calls the 'collation needed' callback to request a definition of the collating sequence. If this doesn't work, an equivalent collating sequence that uses a text encoding different from the main database is substituted, if one is available.

func Xsqlite3CheckObjectName

func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType uintptr, zTblName uintptr) int32

This routine is used to check if the UTF-8 string zName is a legal unqualified name for a new schema object (table, index, view or trigger). All names are legal except those that begin with the string "sqlite_" (in upper, lower or mixed case). This portion of the namespace is reserved for internal use.

When parsing the sqlite_schema table, this routine also checks to make sure the "type", "name", and "tbl_name" columns are consistent with the SQL.

func Xsqlite3Checkpoint

func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog uintptr, pnCkpt uintptr) int32

Run a checkpoint on database iDb. This is a no-op if database iDb is not currently open in WAL mode.

If a transaction is open on the database being checkpointed, this function returns SQLITE_LOCKED and a checkpoint is not attempted. If an error occurs while running the checkpoint, an SQLite error code is returned (i.e. SQLITE_IOERR). Otherwise, SQLITE_OK.

The mutex on database handle db should be held by the caller. The mutex associated with the specific b-tree being checkpointed is taken by this function while the checkpoint is running.

If iDb is passed SQLITE_MAX_DB then all attached databases are checkpointed. If an error is encountered it is returned immediately - no attempt is made to checkpoint any remaining databases.

Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL, RESTART or TRUNCATE.

func Xsqlite3ClearTempRegCache

func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr)

Mark all temporary registers as being unavailable for reuse.

Always invoke this procedure after coding a subroutine or co-routine that might be invoked from other parts of the code, to ensure that the sub/co-routine does not use registers in common with the code that invokes the sub/co-routine.

func Xsqlite3CloseExtensions

func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr)

Call this routine when the database connection is closing in order to clean up loaded extensions

func Xsqlite3CloseSavepoints

func Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr)

Close all open savepoints. This function only manipulates fields of the database handle object, it does not close any savepoints that may be open at the b-tree/pager level.

func Xsqlite3CodeDropTable

func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int32, isView int32)

Generate code to drop a table.

func Xsqlite3CodeRhsOfIN

func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int32)

Generate code that will construct an ephemeral table containing all terms in the RHS of an IN operator. The IN operator can be in either of two forms:

x IN (4,5,11)              -- IN operator with list on right-hand side
x IN (SELECT a FROM b)     -- IN operator with subquery on the right

The pExpr parameter is the IN operator. The cursor number for the constructed ephermeral table is returned. The first time the ephemeral table is computed, the cursor number is also stored in pExpr->iTable, however the cursor number returned might not be the same, as it might have been duplicated using OP_OpenDup.

If the LHS expression ("x" in the examples) is a column value, or the SELECT statement returns a column value, then the affinity of that column is used to build the index keys. If both 'x' and the SELECT... statement are columns, then numeric affinity is used if either column has NUMERIC or INTEGER affinity. If neither 'x' nor the SELECT... statement are columns, then numeric affinity is used.

func Xsqlite3CodeRowTrigger

func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32)

This is called to code the required FOR EACH ROW triggers for an operation on table pTab. The operation to code triggers for (INSERT, UPDATE or DELETE) is given by the op parameter. The tr_tm parameter determines whether the BEFORE or AFTER triggers are coded. If the operation is an UPDATE, then parameter pChanges is passed the list of columns being modified.

If there are no triggers that fire at the specified time for the specified operation on pTab, this function is a no-op.

The reg argument is the address of the first in an array of registers that contain the values substituted for the new.* and old.* references in the trigger program. If N is the number of columns in table pTab (a copy of pTab->nCol), then registers are populated as follows:

Register       Contains
------------------------------------------------------
reg+0          OLD.rowid
reg+1          OLD.* value of left-most column of pTab
...            ...
reg+N          OLD.* value of right-most column of pTab
reg+N+1        NEW.rowid
reg+N+2        NEW.* value of left-most column of pTab
...            ...
reg+N+N+1      NEW.* value of right-most column of pTab

For ON DELETE triggers, the registers containing the NEW.* values will never be accessed by the trigger program, so they are not allocated or populated by the caller (there is no data to populate them with anyway). Similarly, for ON INSERT triggers the values stored in the OLD.* registers are never accessed, and so are not allocated by the caller. So, for an ON INSERT trigger, the value passed to this function as parameter reg is not a readable register, although registers (reg+N) through (reg+N+N+1) are.

Parameter orconf is the default conflict resolution algorithm for the trigger program to use (REPLACE, IGNORE etc.). Parameter ignoreJump is the instruction that control should jump to if a trigger program raises an IGNORE exception.

func Xsqlite3CodeRowTriggerDirect

func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab uintptr, reg int32, orconf int32, ignoreJump int32)

Generate code for the trigger program associated with trigger p on table pTab. The reg, orconf and ignoreJump parameters passed to this function are the same as those described in the header function for sqlite3CodeRowTrigger()

func Xsqlite3CodeSubselect

func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32

Generate code for scalar subqueries used as a subquery expression or EXISTS operator:

(SELECT a FROM b)          -- subquery
EXISTS (SELECT a FROM b)   -- EXISTS subquery

The pExpr parameter is the SELECT or EXISTS operator to be coded.

Return the register that holds the result. For a multi-column SELECT, the result is stored in a contiguous array of registers and the return value is the register of the left-most result column. Return 0 if an error occurs.

func Xsqlite3CodeVerifyNamedSchema

func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr)

If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each attached database. Otherwise, invoke it for the database named zDb only.

func Xsqlite3CodeVerifySchema

func Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32)

func Xsqlite3CollapseDatabaseArray

func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr)

Look through the list of open database files in db->aDb[] and if any have been closed, remove them from the list. Reallocate the db->aDb[] structure to a smaller size, if possible.

Entry 0 (the "main" database) and entry 1 (the "temp" database) are never candidates for being collapsed.

func Xsqlite3ColumnDefault

func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg int32)

The most recently coded instruction was an OP_Column to retrieve the i-th column of table pTab. This routine sets the P4 parameter of the OP_Column to the default value, if any.

The default value of a column is specified by a DEFAULT clause in the column definition. This was either supplied by the user when the table was created, or added later to the table definition by an ALTER TABLE command. If the latter, then the row-records in the table btree on disk may not contain a value for the column and the default value, taken from the P4 parameter of the OP_Column instruction, is returned instead. If the former, then all row-records are guaranteed to include a value for the column and the P4 value is not required.

Column definitions created by an ALTER TABLE command may only have literal default values specified: a number, null or a string. (If a more complicated default expression value was provided, it is evaluated when the ALTER TABLE is executed and one of the literal values written into the sqlite_schema table.)

Therefore, the P4 parameter is only required if the default value for the column is a literal number, string or null. The sqlite3ValueFromExpr() function is capable of transforming these types of expressions into sqlite3_value objects.

If column as REAL affinity and the table is an ordinary b-tree table (not a virtual table) then the value might have been stored as an integer. In that case, add an OP_RealAffinity opcode to make sure it has been converted into REAL.

func Xsqlite3ColumnIndex

func Xsqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) int32

Return the index of a column in a table. Return -1 if the column is not contained in the table.

func Xsqlite3ColumnType

func Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr

Return the declared type of a column. Or return zDflt if the column has no declared type.

The column type is an extra string stored after the zero-terminator on the column name if and only if the COLFLAG_HASTYPE flag is set.

func Xsqlite3ColumnsFromExprList

func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, pnCol uintptr, paCol uintptr) int32

Given an expression list (which is really the list of expressions that form the result set of a SELECT statement) compute appropriate column names for a table that would hold the expression list.

All column names will be unique.

Only the column names are computed. Column.zType, Column.zColl, and other fields of Column are zeroed.

Return SQLITE_OK on success. If a memory allocation error occurs, store NULL in *paCol and 0 in *pnCol and return SQLITE_NOMEM.

The only guarantee that SQLite makes about column names is that if the column has an AS clause assigning it a name, that will be the name used. That is the only documented guarantee. However, countless applications developed over the years have made baseless assumptions about column names and will break if those assumptions changes. Hence, use extreme caution when modifying this routine to avoid breaking legacy.

See Also: sqlite3GenerateColumnNames()

func Xsqlite3CommitInternalChanges

func Xsqlite3CommitInternalChanges(tls *libc.TLS, db uintptr)

This routine is called when a commit occurs.

func Xsqlite3CompareAffinity

func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8

pExpr is an operand of a comparison operator. aff2 is the type affinity of the other operand. This routine returns the type affinity that should be used for the comparison operator.

func Xsqlite3CompileOptions

func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr

func Xsqlite3CompleteInsertion

func Xsqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, regNewData int32, aRegIdx uintptr, update_flags int32, appendBias int32, useSeekResult int32)

This routine generates code to finish the INSERT or UPDATE operation that was started by a prior call to sqlite3GenerateConstraintChecks. A consecutive range of registers starting at regNewData contains the rowid and the content to be inserted.

The arguments to this routine should be the same as the first six arguments to sqlite3GenerateConstraintChecks.

func Xsqlite3ComputeGeneratedColumns

func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore int32, pTab uintptr)

All regular columns for table pTab have been puts into registers starting with iRegStore. The registers that correspond to STORED or VIRTUAL columns have not yet been initialized. This routine goes back and computes the values for those columns based on the previously computed normal columns.

func Xsqlite3ConnectionBlocked

func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr)

This function is called while stepping or preparing a statement associated with connection db. The operation will return SQLITE_LOCKED to the user because it requires a lock that will not be available until connection pBlocker concludes its current transaction.

func Xsqlite3ConnectionClosed

func Xsqlite3ConnectionClosed(tls *libc.TLS, db uintptr)

This is called when the database connection passed as an argument is being closed. The connection is removed from the blocked list.

func Xsqlite3ConnectionUnlocked

func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr)

This function is called when the transaction opened by database db has just finished. Locks held by database connection db have been released.

This function loops through each entry in the blocked connections list and does the following:

  1. If the sqlite3.pBlockingConnection member of a list entry is set to db, then set pBlockingConnection=0.

  2. If the sqlite3.pUnlockConnection member of a list entry is set to db, then invoke the configured unlock-notify callback and set pUnlockConnection=0.

  3. If the two steps above mean that pBlockingConnection==0 and pUnlockConnection==0, remove the entry from the blocked connections list.

func Xsqlite3CorruptError

func Xsqlite3CorruptError(tls *libc.TLS, lineno int32) int32

func Xsqlite3CreateColumnExpr

func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int32, iCol int32) uintptr

Allocate and return a pointer to an expression to load the column iCol from datasource iSrc in SrcList pSrc.

func Xsqlite3CreateForeignKey

func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, pTo uintptr, pToCol uintptr, flags int32)

This routine is called to create a new foreign key on the table currently under construction. pFromCol determines which columns in the current table point to the foreign key. If pFromCol==0 then connect the key to the last column inserted. pTo is the name of the table referred to (a.k.a the "parent" table). pToCol is a list of tables in the parent pTo table. flags contains all information about the conflict resolution algorithms specified in the ON DELETE, ON UPDATE and ON INSERT clauses.

An FKey structure is created and added to the table currently under construction in the pParse->pNewTable field.

The foreign key is set for IMMEDIATE processing. A subsequent call to sqlite3DeferForeignKey() might change this to DEFERRED.

func Xsqlite3CreateFunc

func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) int32

This function is exactly the same as sqlite3_create_function(), except that it is designed to be called by internal code. The difference is that if a malloc() fails in sqlite3_create_function(), an error code is returned and the mallocFailed flag cleared.

func Xsqlite3CreateIndex

func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pTblName uintptr, pList uintptr, onError int32, pStart uintptr, pPIWhere uintptr, sortOrder int32, ifNotExist int32, idxType U8)

Create a new index for an SQL table. pName1.pName2 is the name of the index and pTblList is the name of the table that is to be indexed. Both will be NULL for a primary key or an index that is created to satisfy a UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable as the table to be indexed. pParse->pNewTable is a table that is currently being constructed by a CREATE TABLE statement.

pList is a list of columns to be indexed. pList will be NULL if this is a primary key or unique-constraint on the most recent column added to the table currently under construction.

func Xsqlite3CreateView

func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 uintptr, pName2 uintptr, pCNames uintptr, pSelect uintptr, isTemp int32, noErr int32)

The parser calls this routine in order to create a new VIEW

func Xsqlite3CteDelete

func Xsqlite3CteDelete(tls *libc.TLS, db uintptr, pCte uintptr)

Free the contents of the CTE object passed as the second argument.

func Xsqlite3CteNew

func Xsqlite3CteNew(tls *libc.TLS, pParse uintptr, pName uintptr, pArglist uintptr, pQuery uintptr, eM10d U8) uintptr

Create a new CTE object

func Xsqlite3DbFree

func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr)

func Xsqlite3DbFreeNN

func Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr)

Free memory that might be associated with a particular database connection. Calling sqlite3DbFree(D,X) for X==0 is a harmless no-op. The sqlite3DbFreeNN(D,X) version requires that X be non-NULL.

func Xsqlite3DbIsNamed

func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int32

Return true if zName points to a name that may be used to refer to database iDb attached to handle db.

func Xsqlite3DbMallocRaw

func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr

Allocate memory, either lookaside (if possible) or heap. If the allocation fails, set the mallocFailed flag in the connection pointer.

If db!=0 and db->mallocFailed is true (indicating a prior malloc failure on the same database connection) then always return 0. Hence for a particular database connection, once malloc starts failing, it fails consistently until mallocFailed is reset. This is an important assumption. There are many places in the code that do things like this:

int *a = (int*)sqlite3DbMallocRaw(db, 100);
int *b = (int*)sqlite3DbMallocRaw(db, 200);
if( b ) a[10] = 9;

In other words, if a subsequent malloc (ex: "b") worked, it is assumed that all prior mallocs (ex: "a") worked too.

The sqlite3MallocRawNN() variant guarantees that the "db" parameter is not a NULL pointer.

func Xsqlite3DbMallocRawNN

func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr

func Xsqlite3DbMallocSize

func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32

func Xsqlite3DbMallocZero

func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr

Allocate and zero memory. If the allocation fails, make the mallocFailed flag in the connection pointer.

func Xsqlite3DbNameToBtree

func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr

Return the Btree pointer identified by zDbName. Return NULL if not found.

func Xsqlite3DbRealloc

func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr

Resize the block of memory pointed to by p to n bytes. If the resize fails, set the mallocFailed flag in the connection object.

func Xsqlite3DbReallocOrFree

func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr

Attempt to reallocate p. If the reallocation fails, then free p and set the mallocFailed flag in the database connection.

func Xsqlite3DbSpanDup

func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr

The text between zStart and zEnd represents a phrase within a larger SQL statement. Make a copy of this phrase in space obtained form sqlite3DbMalloc(). Omit leading and trailing whitespace.

func Xsqlite3DbStrDup

func Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr

Make a copy of a string in memory obtained from sqliteMalloc(). These functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This is because when memory debugging is turned on, these two functions are called via macros that record the current file and line number in the ThreadData structure.

func Xsqlite3DbStrNDup

func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr

func Xsqlite3DbpageRegister

func Xsqlite3DbpageRegister(tls *libc.TLS, db uintptr) int32

Invoke this routine to register the "dbpage" virtual table module

func Xsqlite3DbstatRegister

func Xsqlite3DbstatRegister(tls *libc.TLS, db uintptr) int32

Invoke this routine to register the "dbstat" virtual table module

func Xsqlite3DebugPrintf

func Xsqlite3DebugPrintf(tls *libc.TLS, zFormat uintptr, va uintptr)

A version of printf() that understands %lld. Used for debugging. The printf() built into some versions of windows does not understand %lld and segfaults if you give it a long long int.

func Xsqlite3DecOrHexToI64

func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32

Transform a UTF-8 integer literal, in either decimal or hexadecimal, into a 64-bit signed integer. This routine accepts hexadecimal literals, whereas sqlite3Atoi64() does not.

Returns:

0    Successful transformation.  Fits in a 64-bit signed integer.
1    Excess text after the integer value
2    Integer too large for a 64-bit signed integer or is malformed
3    Special case of 9223372036854775808

func Xsqlite3DefaultMutex

func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr

func Xsqlite3DefaultRowEst

func Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr)

Fill the Index.aiRowEst[] array with default information - information to be used when we have not run the ANALYZE command.

aiRowEst[0] is supposed to contain the number of elements in the index. Since we do not know, guess 1 million. aiRowEst[1] is an estimate of the number of rows in the table that match any particular value of the first column of the index. aiRowEst[2] is an estimate of the number of rows that match any particular combination of the first 2 columns of the index. And so forth. It must always be the case that

aiRowEst[N]<=aiRowEst[N-1]
aiRowEst[N]>=1

Apart from that, we have little to go on besides intuition as to how aiRowEst[] should be initialized. The numbers generated here are based on typical values found in actual indices.

func Xsqlite3DeferForeignKey

func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32)

This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED clause is seen as part of a foreign key definition. The isDeferred parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE. The behavior of the most recently created foreign key is adjusted accordingly.

func Xsqlite3DeleteColumnNames

func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr)

Delete memory allocated for the column names of a table or view (the Table.aCol[] array).

func Xsqlite3DeleteFrom

func Xsqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr)

Generate code for a DELETE FROM statement.

DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL;
            \________/       \________________/
             pTabList              pWhere

func Xsqlite3DeleteIndexSamples

func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr)

If the Index.aSample variable is not NULL, delete the aSample[] array and its contents.

func Xsqlite3DeleteTable

func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr)

func Xsqlite3DeleteTrigger

func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr)

Recursively delete a Trigger structure

func Xsqlite3DeleteTriggerStep

func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr)

Delete a linked list of TriggerStep structures.

func Xsqlite3Dequote

func Xsqlite3Dequote(tls *libc.TLS, z uintptr)

Convert an SQL-style quoted string into a normal string by removing the quote characters. The conversion is done in-place. If the input does not begin with a quote character, then this routine is a no-op.

The input string must be zero-terminated. A new zero-terminator is added to the dequoted string.

The return value is -1 if no dequoting occurs or the length of the dequoted string, exclusive of the zero terminator, if dequoting does occur.

2002-02-14: This routine is extended to remove MS-Access style brackets from around identifiers. For example: "[a-b-c]" becomes "a-b-c".

func Xsqlite3DequoteExpr

func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr)

func Xsqlite3Detach

func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr)

Called by the parser to compile a DETACH statement.

DETACH pDbname

func Xsqlite3DropIndex

func Xsqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists int32)

This routine will drop an existing named index. This routine implements the DROP INDEX statement.

func Xsqlite3DropTable

func Xsqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int32, noErr int32)

This routine is called to do the work of a DROP TABLE statement. pName is the name of the table to be dropped.

func Xsqlite3DropTrigger

func Xsqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int32)

This function is called to drop a trigger from the database schema.

This may be called directly from the parser and therefore identifies the trigger by name. The sqlite3DropTriggerPtr() routine does the same job as this routine except it takes a pointer to the trigger instead of the trigger name.

func Xsqlite3DropTriggerPtr

func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr)

Drop a trigger given a pointer to that trigger.

func Xsqlite3EndBenignMalloc

func Xsqlite3EndBenignMalloc(tls *libc.TLS)

func Xsqlite3EndTable

func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr, tabOpts U8, pSelect uintptr)

This routine is called to report the final ")" that terminates a CREATE TABLE statement.

The table structure that other action routines have been building is added to the internal hash tables, assuming no errors have occurred.

An entry for the table is made in the schema table on disk, unless this is a temporary table or db->init.busy==1. When db->init.busy==1 it means we are reading the sqlite_schema table because we just connected to the database or because the sqlite_schema table has recently changed, so the entry for this table already exists in the sqlite_schema table. We do not want to create it again.

If the pSelect argument is not NULL, it means that this routine was called to create a table generated from a "CREATE TABLE ... AS SELECT ..." statement. The column names of the new table will match the result set of the SELECT.

func Xsqlite3EndTransaction

func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32)

Generate VDBE code for a COMMIT or ROLLBACK statement. Code for ROLLBACK is generated if eType==TK_ROLLBACK. Otherwise code is generated for a COMMIT.

func Xsqlite3ErrName

func Xsqlite3ErrName(tls *libc.TLS, rc int32) uintptr

Return a static string containing the name corresponding to the error code specified in the argument.

func Xsqlite3ErrStr

func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr

Return a static string that describes the kind of error specified in the argument.

func Xsqlite3Error

func Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32)

Set the current error code to err_code and clear any prior error message. Also set iSysErrno (by calling sqlite3System) if the err_code indicates that would be appropriate.

func Xsqlite3ErrorClear

func Xsqlite3ErrorClear(tls *libc.TLS, db uintptr)

The equivalent of sqlite3Error(db, SQLITE_OK). Clear the error state and error message.

func Xsqlite3ErrorMsg

func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr)

Add an error message to pParse->zErrMsg and increment pParse->nErr. The following formatting characters are allowed:

%s      Insert a string
%z      A string that should be freed after use
%d      Insert an integer
%T      Insert a token
%S      Insert the first element of a SrcList

This function should be used to report any error that occurs while compiling an SQL statement (i.e. within sqlite3_prepare()). The last thing the sqlite3_prepare() function does is copy the error stored by this function into the database handle using sqlite3Error(). Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used during statement execution (sqlite3_step() etc.).

func Xsqlite3ErrorToParser

func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32

If database connection db is currently parsing SQL, then transfer error code errCode to that parser if the parser has not already encountered some other kind of error.

func Xsqlite3ErrorWithMsg

func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uintptr, va uintptr)

Set the most recent error code and error string for the sqlite handle "db". The error code is set to "err_code".

If it is not NULL, string zFormat specifies the format of the error string in the style of the printf functions: The following format characters are allowed:

%s      Insert a string
%z      A string that should be freed after use
%d      Insert an integer
%T      Insert a token
%S      Insert the first element of a SrcList

zFormat and any string tokens that follow it are assumed to be encoded in UTF-8.

To clear the most recent error for sqlite handle "db", sqlite3Error should be called with err_code set to SQLITE_OK and zFormat set to NULL.

func Xsqlite3ExpandSubquery

func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32

The SrcList_item structure passed as the second argument represents a sub-query in the FROM clause of a SELECT statement. This function allocates and populates the SrcList_item.pTab object. If successful, SQLITE_OK is returned. Otherwise, if an OOM error is encountered, SQLITE_NOMEM.

func Xsqlite3ExpirePreparedStatements

func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32)

Mark every prepared statement associated with a database connection as expired.

An expired statement means that recompilation of the statement is recommend. Statements expire when things happen that make their programs obsolete. Removing user-defined functions or collating sequences, or changing an authorization function are the types of things that make prepared statements obsolete.

If iCode is 1, then expiration is advisory. The statement should be reprepared before being restarted, but if it is already running it is allowed to run to completion.

Internally, this function just sets the Vdbe.expired flag on all prepared statements. The flag is set to 1 for an immediate expiration and set to 2 for an advisory expiration.

func Xsqlite3Expr

func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr

Allocate a new expression node from a zero-terminated token that has already been dequoted.

func Xsqlite3ExprAddCollateString

func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, zC uintptr) uintptr

func Xsqlite3ExprAddCollateToken

func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCollName uintptr, dequote int32) uintptr

Set the collating sequence for expression pExpr to be the collating sequence named by pToken. Return a pointer to a new Expr node that implements the COLLATE operator.

If a memory allocation error occurs, that fact is recorded in pParse->db and the pExpr parameter is returned unchanged.

func Xsqlite3ExprAffinity

func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8

Return the 'affinity' of the expression pExpr if any.

If pExpr is a column, a reference to a column via an 'AS' alias, or a sub-select with a column as the return value, then the affinity of that column is returned. Otherwise, 0x00 is returned, indicating no affinity for the expression.

i.e. the WHERE clause expressions in the following statements all have an affinity:

CREATE TABLE t1(a); SELECT * FROM t1 WHERE a; SELECT a AS b FROM t1 WHERE b; SELECT * FROM t1 WHERE (select a from t1);

func Xsqlite3ExprAlloc

func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequote int32) uintptr

This routine is the core allocator for Expr nodes.

Construct a new expression node and return a pointer to it. Memory for this node and for the pToken argument is a single allocation obtained from sqlite3DbMalloc(). The calling function is responsible for making sure the node eventually gets freed.

If dequote is true, then the token (if it exists) is dequoted. If dequote is false, no dequoting is performed. The deQuote parameter is ignored if pToken is NULL or if the token does not appear to be quoted. If the quotes were of the form "..." (double-quotes) then the EP_DblQuoted flag is set on the expression node.

Special case: If op==TK_INTEGER and pToken points to a string that can be translated into a 32-bit integer, then the token is not stored in u.zToken. Instead, the integer values is written into u.iValue and the EP_IntValue flag is set. No extra storage is allocated to hold the integer text and the dequote flag is ignored.

func Xsqlite3ExprAnalyzeAggList

func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr)

Call sqlite3ExprAnalyzeAggregates() for every expression in an expression list. Return the number of errors.

If an error is found, the analysis is cut short.

func Xsqlite3ExprAnalyzeAggregates

func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr)

Analyze the pExpr expression looking for aggregate functions and for variables that need to be added to AggInfo object that pNC->pAggInfo points to. Additional entries are made on the AggInfo object as necessary.

This routine should only be called after the expression has been analyzed by sqlite3ResolveExprNames().

func Xsqlite3ExprAnd

func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr

Join two expressions using an AND operator. If either expression is NULL, then just return the other expression.

If one side or the other of the AND is known to be false, then instead of returning an AND expression, just return a constant expression with a value of false.

func Xsqlite3ExprAssignVarNumber

func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n U32)

Assign a variable number to an expression that encodes a wildcard in the original SQL statement.

Wildcards consisting of a single "?" are assigned the next sequential variable number.

Wildcards of the form "?nnn" are assigned the number "nnn". We make sure "nnn" is not too big to avoid a denial of service attack when the SQL statement comes from an external source.

Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number as the previous instance of the same wildcard. Or if this is the first instance of the wildcard, the next sequential variable number is assigned.

func Xsqlite3ExprAttachSubtrees

func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr)

Attach subtrees pLeft and pRight to the Expr node pRoot.

If pRoot==NULL that means that a memory allocation error has occurred. In that case, delete the subtrees pLeft and pRight.

func Xsqlite3ExprCanBeNull

func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32

Return FALSE if there is no chance that the expression can be NULL.

If the expression might be NULL or if the expression is too complex to tell return TRUE.

This routine is used as an optimization, to skip OP_IsNull opcodes when we know that a value cannot be NULL. Hence, a false positive (returning TRUE when in fact the expression can never be NULL) might be a small performance hit but is otherwise harmless. On the other hand, a false negative (returning FALSE when the result could be NULL) will likely result in an incorrect answer. So when in doubt, return TRUE.

func Xsqlite3ExprCheckHeight

func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32

Check that argument nHeight is less than or equal to the maximum expression depth allowed. If it is not, leave an error message in pParse.

func Xsqlite3ExprCheckIN

func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32

Expr pIn is an IN(...) expression. This function checks that the sub-select on the RHS of the IN() operator has the same number of columns as the vector on the LHS. Or, if the RHS of the IN() is not a sub-query, that the LHS is a vector of size 1.

func Xsqlite3ExprCode

func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32)

Generate code that will evaluate expression pExpr and store the results in register target. The results are guaranteed to appear in register target.

func Xsqlite3ExprCodeCopy

func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32)

Make a transient copy of expression pExpr and then code it using sqlite3ExprCode(). This routine works just like sqlite3ExprCode() except that the input expression is guaranteed to be unchanged.

func Xsqlite3ExprCodeExprList

func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, target int32, srcReg int32, flags U8) int32

Generate code that pushes the value of every element of the given expression list into a sequence of registers beginning at target.

Return the number of elements evaluated. The number returned will usually be pList->nExpr but might be reduced if SQLITE_ECEL_OMITREF is defined.

The SQLITE_ECEL_DUP flag prevents the arguments from being filled using OP_SCopy. OP_Copy must be used instead.

The SQLITE_ECEL_FACTOR argument allows constant arguments to be factored out into initialization code.

The SQLITE_ECEL_REF flag means that expressions in the list with ExprList.a[].u.x.iOrderByCol>0 have already been evaluated and stored in registers at srcReg, and so the value can be copied from there. If SQLITE_ECEL_OMITREF is also set, then the values with u.x.iOrderByCol>0 are simply omitted rather than being copied from srcReg.

func Xsqlite3ExprCodeFactorable

func Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32)

Generate code that will evaluate expression pExpr and store the results in register target. The results are guaranteed to appear in register target. If the expression is constant, then this routine might choose to code the expression at initialization time.

func Xsqlite3ExprCodeGeneratedColumn

func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pCol uintptr, regOut int32)

Generate code that will compute the value of generated column pCol and store the result in register regOut

func Xsqlite3ExprCodeGetColumn

func Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 U8) int32

Generate code that will extract the iColumn-th column from table pTab and store the column value in register iReg.

There must be an open cursor to pTab in iTable when this routine is called. If iColumn<0 then code is generated that extracts the rowid.

func Xsqlite3ExprCodeGetColumnOfTable

func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iTabCur int32, iCol int32, regOut int32)

Generate code to extract the value of the iCol-th column of a table.

func Xsqlite3ExprCodeLoadIndexColumn

func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr, iTabCur int32, iIdxCol int32, regOut int32)

Generate code that will load into register regOut a value that is appropriate for the iIdxCol-th column of index pIdx.

func Xsqlite3ExprCodeMove

func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, nReg int32)

Generate code to move content from registers iFrom...iFrom+nReg-1 over to iTo..iTo+nReg-1.

func Xsqlite3ExprCodeRunJustOnce

func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, regDest int32) int32

Generate code that will evaluate expression pExpr just one time per prepared statement execution.

If the expression uses functions (that might throw an exception) then guard them with an OP_Once opcode to ensure that the code is only executed once. If no functions are involved, then factor the code out and put it at the end of the prepared statement in the initialization section.

If regDest>=0 then the result is always stored in that register and the result is not reusable. If regDest<0 then this routine is free to store the value whereever it wants. The register where the expression is stored is returned. When regDest<0, two identical expressions might code to the same register, if they do not contain function calls and hence are factored out into the initialization section at the end of the prepared statement.

func Xsqlite3ExprCodeTarget

func Xsqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) int32

Generate code into the current Vdbe to evaluate the given expression. Attempt to store the results in register "target". Return the register where results are stored.

With this routine, there is no guarantee that results will be stored in target. The result might be stored in some other register if it is convenient to do so. The calling function must check the return code and move the results to the desired register.

func Xsqlite3ExprCodeTemp

func Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uintptr) int32

Generate code to evaluate an expression and store the results into a register. Return the register number where the results are stored.

If the register is a temporary register that can be deallocated, then write its number into *pReg. If the result register is not a temporary, then set *pReg to zero.

If pExpr is a constant, then this routine might generate this code to fill the register in the initialization section of the VDBE program, in order to factor it out of the evaluation loop.

func Xsqlite3ExprCollSeq

func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr

Return the collation sequence for the expression pExpr. If there is no defined collating sequence, return NULL.

See also: sqlite3ExprNNCollSeq()

The sqlite3ExprNNCollSeq() works the same exact that it returns the default collation if pExpr has no defined collation.

The collating sequence might be determined by a COLLATE operator or by the presence of a column with a defined collating sequence. COLLATE operators take first precedence. Left operands take precedence over right operands.

func Xsqlite3ExprCollSeqMatch

func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr) int32

Return TRUE if the two expressions have equivalent collating sequences.

func Xsqlite3ExprCompare

func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) int32

Do a deep comparison of two expression trees. Return 0 if the two expressions are completely identical. Return 1 if they differ only by a COLLATE operator at the top level. Return 2 if there are differences other than the top-level COLLATE operator.

If any subelement of pB has Expr.iTable==(-1) then it is allowed to compare equal to an equivalent element in pA with Expr.iTable==iTab.

The pA side might be using TK_REGISTER. If that is the case and pB is not using TK_REGISTER but is otherwise equivalent, then still return 0.

Sometimes this routine will return 2 even if the two expressions really are equivalent. If we cannot prove that the expressions are identical, we return 2 just to be safe. So if this routine returns 2, then you do not really know for certain if the two expressions are the same. But if you get a 0 or 1 return, then you can be sure the expressions are the same. In the places where this routine is used, it does not hurt to get an extra 2 - that just might result in some slightly slower code. But returning an incorrect 0 or 1 could lead to a malfunction.

If pParse is not NULL then TK_VARIABLE terms in pA with bindings in pParse->pReprepare can be matched against literals in pB. The pParse->pVdbe->expmask bitmask is updated for each variable referenced. If pParse is NULL (the normal case) then any TK_VARIABLE term in Argument pParse should normally be NULL. If it is not NULL and pA or pB causes a return value of 2.

func Xsqlite3ExprCompareCollSeq

func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr

Expresssion p is a comparison operator. Return a collation sequence appropriate for the comparison operator.

This is normally just a wrapper around sqlite3BinaryCompareCollSeq(). However, if the OP_Commuted flag is set, then the order of the operands is reversed in the sqlite3BinaryCompareCollSeq() call so that the correct collating sequence is found.

func Xsqlite3ExprCompareSkip

func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32

Like sqlite3ExprCompare() except COLLATE operators at the top-level are ignored.

func Xsqlite3ExprCoveredByIndex

func Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx uintptr) int32

Determine if an index pIdx on table with cursor iCur contains will the expression pExpr. Return true if the index does cover the expression and false if the pExpr expression references table columns that are not found in the index pIdx.

An index covering an expression means that the expression can be evaluated using only the index and without having to lookup the corresponding table entry.

func Xsqlite3ExprDeferredDelete

func Xsqlite3ExprDeferredDelete(tls *libc.TLS, pParse uintptr, pExpr uintptr)

Arrange to cause pExpr to be deleted when the pParse is deleted. This is similar to sqlite3ExprDelete() except that the delete is deferred untilthe pParse is deleted.

The pExpr might be deleted immediately on an OOM error.

The deferred delete is (currently) implemented by adding the pExpr to the pParse->pConstExpr list with a register number of 0.

func Xsqlite3ExprDelete

func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr)

func Xsqlite3ExprDup

func Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr

The following group of routines make deep copies of expressions, expression lists, ID lists, and select statements. The copies can be deleted (by being passed to their respective ...Delete() routines) without effecting the originals.

The expression list, ID, and source lists return by sqlite3ExprListDup(), sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded by subsequent calls to sqlite*ListAppend() routines.

Any tables that the SrcList might point to are not duplicated.

The flags parameter contains a combination of the EXPRDUP_XXX flags. If the EXPRDUP_REDUCE flag is set, then the structure returned is a truncated version of the usual Expr structure that will be stored as part of the in-memory representation of the database schema.

func Xsqlite3ExprForVectorField

func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32) uintptr

Compute and return a new Expr object which when passed to sqlite3ExprCode() will generate all necessary code to compute the iField-th column of the vector expression pVector.

It is ok for pVector to be a scalar (as long as iField==0). In that case, this routine works like sqlite3ExprDup().

The caller owns the returned Expr object and is responsible for ensuring that the returned value eventually gets freed.

The caller retains ownership of pVector. If pVector is a TK_SELECT, then the returned object will reference pVector and so pVector must remain valid for the life of the returned object. If pVector is a TK_VECTOR or a scalar expression, then it can be deleted as soon as this routine returns.

A trick to cause a TK_SELECT pVector to be deleted together with the returned Expr object is to attach the pVector to the pRight field of the returned TK_SELECT_COLUMN Expr object.

func Xsqlite3ExprFunction

func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr, eDistinct int32) uintptr

Construct a new expression node for a function with multiple arguments.

func Xsqlite3ExprFunctionUsable

func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pDef uintptr)

Check to see if a function is usable according to current access rules:

SQLITE_FUNC_DIRECT    -     Only usable from top-level SQL

SQLITE_FUNC_UNSAFE    -     Usable if TRUSTED_SCHEMA or from
                            top-level SQL

If the function is not usable, create an error.

func Xsqlite3ExprIdToTrueFalse

func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32

If the input expression is an ID with the name "true" or "false" then convert it into an TK_TRUEFALSE term. Return non-zero if the conversion happened, and zero if the expression is unaltered.

func Xsqlite3ExprIfFalse

func Xsqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32)

Generate code for a boolean expression such that a jump is made to the label "dest" if the expression is false but execution continues straight thru if the expression is true.

If the expression evaluates to NULL (neither true nor false) then jump if jumpIfNull is SQLITE_JUMPIFNULL or fall through if jumpIfNull is 0.

func Xsqlite3ExprIfFalseDup

func Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32)

Like sqlite3ExprIfFalse() except that a copy is made of pExpr before code generation, and that copy is deleted after code generation. This ensures that the original pExpr is unchanged.

func Xsqlite3ExprIfTrue

func Xsqlite3ExprIfTrue(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32)

Generate code for a boolean expression such that a jump is made to the label "dest" if the expression is true but execution continues straight thru if the expression is false.

If the expression evaluates to NULL (neither true nor false), then take the jump if the jumpIfNull flag is SQLITE_JUMPIFNULL.

This code depends on the fact that certain token values (ex: TK_EQ) are the same as opcode values (ex: OP_Eq) that implement the corresponding operation. Special comments in vdbe.c and the mkopcodeh.awk script in the make process cause these values to align. Assert()s in the code below verify that the numbers are aligned correctly.

func Xsqlite3ExprImpliesExpr

func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr, iTab int32) int32

Return true if we can prove the pE2 will always be true if pE1 is true. Return false if we cannot complete the proof or if pE2 might be false. Examples:

pE1: x==5       pE2: x==5             Result: true
pE1: x>0        pE2: x==5             Result: false
pE1: x=21       pE2: x=21 OR y=43     Result: true
pE1: x!=123     pE2: x IS NOT NULL    Result: true
pE1: x!=?1      pE2: x IS NOT NULL    Result: true
pE1: x IS NULL  pE2: x IS NOT NULL    Result: false
pE1: x IS ?2    pE2: x IS NOT NULL    Reuslt: false

When comparing TK_COLUMN nodes between pE1 and pE2, if pE2 has Expr.iTable<0 then assume a table number given by iTab.

If pParse is not NULL, then the values of bound variables in pE1 are compared against literal values in pE2 and pParse->pVdbe->expmask is modified to record which bound variables are referenced. If pParse is NULL, then false will be returned if pE1 contains any bound variables.

When in doubt, return false. Returning true might give a performance improvement. Returning false might cause a performance reduction, but it will always give the correct answer and is hence always safe.

func Xsqlite3ExprImpliesNonNullRow

func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32

Return true (non-zero) if expression p can only be true if at least one column of table iTab is non-null. In other words, return true if expression p will always be NULL or false if every column of iTab is NULL.

False negatives are acceptable. In other words, it is ok to return zero even if expression p will never be true of every column of iTab is NULL. A false negative is merely a missed optimization opportunity.

False positives are not allowed, however. A false positive may result in an incorrect answer.

Terms of p that are marked with EP_FromJoin (and hence that come from the ON or USING clauses of LEFT JOINS) are excluded from the analysis.

This routine is used to check if a LEFT JOIN can be converted into an ordinary JOIN. The p argument is the WHERE clause. If the WHERE clause requires that some column of the right table of the LEFT JOIN be non-NULL, then the LEFT JOIN can be safely converted into an ordinary join.

func Xsqlite3ExprIsConstant

func Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32

Walk an expression tree. Return non-zero if the expression is constant and 0 if it involves variables or function calls.

For the purposes of this function, a double-quoted string (ex: "abc") is considered a variable but a single-quoted string (ex: 'abc') is a constant.

func Xsqlite3ExprIsConstantNotJoin

func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32

Walk an expression tree. Return non-zero if

(1) the expression is constant, and
(2) the expression does originate in the ON or USING clause
    of a LEFT JOIN, and
(3) the expression does not contain any EP_FixedCol TK_COLUMN
    operands created by the constant propagation optimization.

When this routine returns true, it indicates that the expression can be added to the pParse->pConstExpr list and evaluated once when the prepared statement starts up. See sqlite3ExprCodeRunJustOnce().

func Xsqlite3ExprIsConstantOrFunction

func Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32

Walk an expression tree for the DEFAULT field of a column definition in a CREATE TABLE statement. Return non-zero if the expression is acceptable for use as a DEFAULT. That is to say, return non-zero if the expression is constant or a function call with constant arguments. Return and 0 if there are any variables.

isInit is true when parsing from sqlite_schema. isInit is false when processing a new CREATE TABLE statement. When isInit is true, parameters (such as ? or $abc) in the expression are converted into NULL. When isInit is false, parameters raise an error. Parameters should not be allowed in a CREATE TABLE statement, but some legacy versions of SQLite allowed it, so we need to support it when reading sqlite_schema for backwards compatibility.

If isInit is true, set EP_FromDDL on every TK_FUNCTION node.

For the purposes of this function, a double-quoted string (ex: "abc") is considered a variable but a single-quoted string (ex: 'abc') is a constant.

func Xsqlite3ExprIsConstantOrGroupBy

func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, pGroupBy uintptr) int32

Walk the expression tree passed as the first argument. Return non-zero if the expression consists entirely of constants or copies of terms in pGroupBy that sort with the BINARY collation sequence.

This routine is used to determine if a term of the HAVING clause can be promoted into the WHERE clause. In order for such a promotion to work, the value of the HAVING clause term must be the same for all members of a "group". The requirement that the GROUP BY term must be BINARY assumes that no other collating sequence will have a finer-grained grouping than binary. In other words (A=B COLLATE binary) implies A=B in every other collating sequence. The requirement that the GROUP BY be BINARY is stricter than necessary. It would also work to promote HAVING clauses that use the same alternative collating sequence as the GROUP BY term, but that is much harder to check, alternative collating sequences are uncommon, and this is only an optimization, so we take the easy way out and simply require the GROUP BY to use the BINARY collating sequence.

func Xsqlite3ExprIsInteger

func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32

If the expression p codes a constant integer that is small enough to fit in a 32-bit integer, return 1 and put the value of the integer in *pValue. If the expression is not an integer or if it is too big to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged.

func Xsqlite3ExprIsTableConstant

func Xsqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32) int32

Walk an expression tree. Return non-zero if the expression is constant for any single row of the table with cursor iCur. In other words, the expression must not refer to any non-deterministic function nor any table other than iCur.

func Xsqlite3ExprIsVector

func Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32

Return true if expression pExpr is a vector, or false otherwise.

A vector is defined as any expression that results in two or more columns of result. Every TK_VECTOR node is an vector because the parser will not generate a TK_VECTOR with fewer than two entries. But a TK_SELECT might be either a vector or a scalar. It is only considered a vector if it has two or more result columns.

func Xsqlite3ExprListAppend

func Xsqlite3ExprListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pExpr uintptr) uintptr

func Xsqlite3ExprListAppendGrow

func Xsqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr uintptr) uintptr

func Xsqlite3ExprListAppendNew

func Xsqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) uintptr

func Xsqlite3ExprListAppendVector

func Xsqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, pColumns uintptr, pExpr uintptr) uintptr

pColumns and pExpr form a vector assignment which is part of the SET clause of an UPDATE statement. Like this:

(a,b,c) = (expr1,expr2,expr3)

Or: (a,b,c) = (SELECT x,y,z FROM ....)

For each term of the vector assignment, append new entries to the expression list pList. In the case of a subquery on the RHS, append TK_SELECT_COLUMN expressions.

func Xsqlite3ExprListCheckLength

func Xsqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, zObject uintptr)

If the expression list pEList contains more than iLimit elements, leave an error message in pParse.

func Xsqlite3ExprListCompare

func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32

Compare two ExprList objects. Return 0 if they are identical, 1 if they are certainly different, or 2 if it is not possible to determine if they are identical or not.

If any subelement of pB has Expr.iTable==(-1) then it is allowed to compare equal to an equivalent element in pA with Expr.iTable==iTab.

This routine might return non-zero for equivalent ExprLists. The only consequence will be disabled optimizations. But this routine must never return 0 if the two ExprList objects are different, or a malfunction will result.

Two NULL pointers are considered to be the same. But a NULL pointer always differs from a non-NULL pointer.

func Xsqlite3ExprListDelete

func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr)

func Xsqlite3ExprListDup

func Xsqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr

func Xsqlite3ExprListSetName

func Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32)

Set the ExprList.a[].zEName element of the most recently added item on the expression list.

pList might be NULL following an OOM error. But pName should never be NULL. If a memory allocation fails, the pParse->db->mallocFailed flag is set.

func Xsqlite3ExprListSetSortOrder

func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eNulls int32)

Set the sort order for the last element on the given ExprList.

func Xsqlite3ExprListSetSpan

func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStart uintptr, zEnd uintptr)

Set the ExprList.a[].zSpan element of the most recently added item on the expression list.

pList might be NULL following an OOM error. But pSpan should never be NULL. If a memory allocation fails, the pParse->db->mallocFailed flag is set.

func Xsqlite3ExprNNCollSeq

func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr

Return the collation sequence for the expression pExpr. If there is no defined collating sequence, return a pointer to the defautl collation sequence.

See also: sqlite3ExprCollSeq()

The sqlite3ExprCollSeq() routine works the same except that it returns NULL if there is no defined collation.

func Xsqlite3ExprNeedsNoAffinityChange

func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) int32

Return TRUE if the given expression is a constant which would be unchanged by OP_Affinity with the affinity given in the second argument.

This routine is used to determine if the OP_Affinity operation can be omitted. When in doubt return FALSE. A false negative is harmless. A false positive, however, can result in the wrong answer.

func Xsqlite3ExprReferencesUpdatedColumn

func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng uintptr, chngRowid int32) int32

pExpr is a CHECK constraint on a row that is being UPDATE-ed. The only columns that are modified by the UPDATE are those for which aiChng[i]>=0, and also the ROWID is modified if chngRowid is true.

Return true if CHECK constraint pExpr uses any of the changing columns (or the rowid if it is changing). In other words, return true if this CHECK constraint must be validated for the new row in the UPDATE statement.

2018-09-15: pExpr might also be an expression for an index-on-expressions. The operation of this routine is the same - return true if an only if the expression uses one or more of columns identified by the second and third arguments.

func Xsqlite3ExprSetHeightAndFlags

func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr)

Set the Expr.nHeight variable using the exprSetHeight() function. If the height is greater than the maximum allowed expression depth, leave an error in pParse.

Also propagate all EP_Propagate flags from the Expr.x.pList into Expr.flags.

func Xsqlite3ExprSimplifiedAndOr

func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr

If pExpr is an AND or OR expression, try to simplify it by eliminating terms that are always true or false. Return the simplified expression. Or return the original expression if no simplification is possible.

Examples:

(x<10) AND true                =>   (x<10)
(x<10) AND false               =>   false
(x<10) AND (y=22 OR false)     =>   (x<10) AND (y=22)
(x<10) AND (y=22 OR true)      =>   (x<10)
(y=22) OR true                 =>   true

func Xsqlite3ExprSkipCollate

func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr

Skip over any TK_COLLATE operators.

func Xsqlite3ExprSkipCollateAndLikely

func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr

Skip over any TK_COLLATE operators and/or any unlikely() or likelihood() or likely() functions at the root of an expression.

func Xsqlite3ExprTruthValue

func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32

The argument must be a TK_TRUEFALSE Expr node. Return 1 if it is TRUE and 0 if it is FALSE.

func Xsqlite3ExprUnmapAndDelete

func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr)

Invoke sqlite3RenameExprUnmap() and sqlite3ExprDelete() on the expression.

func Xsqlite3ExprVectorSize

func Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32

If the expression passed as the only argument is of type TK_VECTOR return the number of expressions in the vector. Or, if the expression is a sub-select, return the number of columns in the sub-select. For any other type of expression, return 1.

func Xsqlite3ExprWalkNoop

func Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32

No-op routine for the parse-tree walker.

When this routine is the Walker.xExprCallback then expression trees are walked without any actions being taken at each node. Presumably, when this routine is used for Walker.xExprCallback then Walker.xSelectCallback is set to do something useful for every subquery in the parser tree.

func Xsqlite3FaultSim

func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32

Calls to sqlite3FaultSim() are used to simulate a failure during testing, or to bypass normal error detection during testing in order to let execute proceed futher downstream.

In deployment, sqlite3FaultSim() *always* return SQLITE_OK (0). The sqlite3FaultSim() function only returns non-zero during testing.

During testing, if the test harness has set a fault-sim callback using a call to sqlite3_test_control(SQLITE_TESTCTRL_FAULT_INSTALL), then each call to sqlite3FaultSim() is relayed to that application-supplied callback and the integer return value form the application-supplied callback is returned by sqlite3FaultSim().

The integer argument to sqlite3FaultSim() is a code to identify which sqlite3FaultSim() instance is being invoked. Each call to sqlite3FaultSim() should have a unique code. To prevent legacy testing applications from breaking, the codes should not be changed or reused.

func Xsqlite3FindCollSeq

func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, create int32) uintptr

Parameter zName points to a UTF-8 encoded string nName bytes long. Return the CollSeq* pointer for the collation sequence named zName for the encoding 'enc' from the database 'db'.

If the entry specified is not found and 'create' is true, then create a new entry. Otherwise return NULL.

A separate function sqlite3LocateCollSeq() is a wrapper around this routine. sqlite3LocateCollSeq() invokes the collation factory if necessary and generates an error message if the collating sequence cannot be found.

See also: sqlite3LocateCollSeq(), sqlite3GetCollSeq()

func Xsqlite3FindDb

func Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32

The token *pName contains the name of a database (either "main" or "temp" or the name of an attached db). This routine returns the index of the named database in db->aDb[], or -1 if the named db does not exist.

func Xsqlite3FindDbName

func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32

Parameter zName points to a nul-terminated buffer containing the name of a database ("main", "temp" or the name of an attached db). This function returns the index of the named database in db->aDb[], or -1 if the named db cannot be found.

func Xsqlite3FindFunction

func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, enc U8, createFlag U8) uintptr

Locate a user function given a name, a number of arguments and a flag indicating whether the function prefers UTF-16 over UTF-8. Return a pointer to the FuncDef structure that defines that function, or return NULL if the function does not exist.

If the createFlag argument is true, then a new (blank) FuncDef structure is created and liked into the "db" structure if a no matching function previously existed.

If nArg is -2, then the first valid function found is returned. A function is valid if xSFunc is non-zero. The nArg==(-2) case is used to see if zName is a valid function name for some number of arguments. If nArg is -2, then createFlag must be 0.

If createFlag is false, then a function with the required name and number of arguments may be returned even if the eTextRep flag does not match that requested.

func Xsqlite3FindInIndex

func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, prRhsHasNull uintptr, aiMap uintptr, piTab uintptr) int32

This function is used by the implementation of the IN (...) operator. The pX parameter is the expression on the RHS of the IN operator, which might be either a list of expressions or a subquery.

The job of this routine is to find or create a b-tree object that can be used either to test for membership in the RHS set or to iterate through all members of the RHS set, skipping duplicates.

A cursor is opened on the b-tree object that is the RHS of the IN operator and pX->iTable is set to the index of that cursor.

The returned value of this function indicates the b-tree type, as follows:

IN_INDEX_ROWID      - The cursor was opened on a database table.
IN_INDEX_INDEX_ASC  - The cursor was opened on an ascending index.
IN_INDEX_INDEX_DESC - The cursor was opened on a descending index.
IN_INDEX_EPH        - The cursor was opened on a specially created and
                      populated epheremal table.
IN_INDEX_NOOP       - No cursor was allocated.  The IN operator must be
                      implemented as a sequence of comparisons.

An existing b-tree might be used if the RHS expression pX is a simple subquery such as:

SELECT <column1>, <column2>... FROM <table>

If the RHS of the IN operator is a list or a more complex subquery, then an ephemeral table might need to be generated from the RHS and then pX->iTable made to point to the ephemeral table instead of an existing table.

The inFlags parameter must contain, at a minimum, one of the bits IN_INDEX_MEMBERSHIP or IN_INDEX_LOOP but not both. If inFlags contains IN_INDEX_MEMBERSHIP, then the generated table will be used for a fast membership test. When the IN_INDEX_LOOP bit is set, the IN index will be used to loop over all values of the RHS of the IN operator.

When IN_INDEX_LOOP is used (and the b-tree will be used to iterate through the set members) then the b-tree must not contain duplicates. An epheremal table will be created unless the selected columns are guaranteed to be unique - either because it is an INTEGER PRIMARY KEY or due to a UNIQUE constraint or index.

When IN_INDEX_MEMBERSHIP is used (and the b-tree will be used for fast set membership tests) then an epheremal table must be used unless <columns> is a single INTEGER PRIMARY KEY column or an index can be found with the specified <columns> as its left-most.

If the IN_INDEX_NOOP_OK and IN_INDEX_MEMBERSHIP are both set and if the RHS of the IN operator is a list (not a subquery) then this routine might decide that creating an ephemeral b-tree for membership testing is too expensive and return IN_INDEX_NOOP. In that case, the calling routine should implement the IN operator using a sequence of Eq or Ne comparison operations.

When the b-tree is being used for membership tests, the calling function might need to know whether or not the RHS side of the IN operator contains a NULL. If prRhsHasNull is not a NULL pointer and if there is any chance that the (...) might contain a NULL value at runtime, then a register is allocated and the register number written to *prRhsHasNull. If there is no chance that the (...) contains a NULL value, then *prRhsHasNull is left unchanged.

If a register is allocated and its location stored in *prRhsHasNull, then the value in that register will be NULL if the b-tree contains one or more NULL values, and it will be some non-NULL value if the b-tree contains no NULL values.

If the aiMap parameter is not NULL, it must point to an array containing one element for each column returned by the SELECT statement on the RHS of the IN(...) operator. The i'th entry of the array is populated with the offset of the index column that matches the i'th column returned by the SELECT. For example, if the expression and selected index are:

(?,?,?) IN (SELECT a, b, c FROM t1)
CREATE INDEX i1 ON t1(b, c, a);

then aiMap[] is populated with {2, 0, 1}.

func Xsqlite3FindIndex

func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr

Locate the in-memory structure that describes a particular index given the name of that index and the name of the database that contains the index. Return NULL if not found.

If zDatabase is 0, all databases are searched for the table and the first matching index is returned. (No checking for duplicate index names is done.) The search order is TEMP first, then MAIN, then any auxiliary databases added using the ATTACH command.

func Xsqlite3FindTable

func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintptr) uintptr

Locate the in-memory structure that describes a particular database table given the name of that table and (optionally) the name of the database containing the table. Return NULL if not found.

If zDatabase is 0, all databases are searched for the table and the first matching table is returned. (No checking for duplicate table names is done.) The search order is TEMP first, then MAIN, then any auxiliary databases added using the ATTACH command.

See also sqlite3LocateTable().

func Xsqlite3FinishCoding

func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr)

This routine is called after a single SQL statement has been parsed and a VDBE program to execute that statement has been prepared. This routine puts the finishing touches on the VDBE program and resets the pParse structure for the next parse.

Note that if an error occurred, it might be the case that no VDBE code was generated.

func Xsqlite3FinishTrigger

func Xsqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAll uintptr)

This routine is called after all of the trigger actions have been parsed in order to complete the process of building the trigger.

func Xsqlite3FixExpr

func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32

func Xsqlite3FixInit

func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zType uintptr, pName uintptr)

Initialize a DbFixer structure. This routine must be called prior to passing the structure to one of the sqliteFixAAAA() routines below.

func Xsqlite3FixSelect

func Xsqlite3FixSelect(tls *libc.TLS, pFix uintptr, pSelect uintptr) int32

func Xsqlite3FixSrcList

func Xsqlite3FixSrcList(tls *libc.TLS, pFix uintptr, pList uintptr) int32

The following set of routines walk through the parse tree and assign a specific database to all table references where the database name was left unspecified in the original SQL statement. The pFix structure must have been initialized by a prior call to sqlite3FixInit().

These routines are used to make sure that an index, trigger, or view in one database does not refer to objects in a different database. (Exception: indices, triggers, and views in the TEMP database are allowed to refer to anything.) If a reference is explicitly made to an object in a different database, an error message is added to pParse->zErrMsg and these routines return non-zero. If everything checks out, these routines return 0.

func Xsqlite3FixTriggerStep

func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32

func Xsqlite3FkActions

func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uintptr, regOld int32, aChange uintptr, bChngRowid int32)

This function is called when deleting or updating a row to implement any required CASCADE, SET NULL or SET DEFAULT actions.

func Xsqlite3FkCheck

func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, regNew int32, aChange uintptr, bChngRowid int32)

This function is called when inserting, deleting or updating a row of table pTab to generate VDBE code to perform foreign key constraint processing for the operation.

For a DELETE operation, parameter regOld is passed the index of the first register in an array of (pTab->nCol+1) registers containing the rowid of the row being deleted, followed by each of the column values of the row being deleted, from left to right. Parameter regNew is passed zero in this case.

For an INSERT operation, regOld is passed zero and regNew is passed the first register of an array of (pTab->nCol+1) registers containing the new row data.

For an UPDATE operation, this function is called twice. Once before the original record is deleted from the table using the calling convention described for DELETE. Then again after the original record is deleted but before the new record is inserted using the INSERT convention.

func Xsqlite3FkDelete

func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr)

Free all memory associated with foreign key definitions attached to table pTab. Remove the deleted foreign keys from the Schema.fkeyHash hash table.

func Xsqlite3FkDropTable

func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr)

This function is called to generate code that runs when table pTab is being dropped from the database. The SrcList passed as the second argument to this function contains a single entry guaranteed to resolve to table pTab.

Normally, no code is required. However, if either

(a) The table is the parent table of a FK constraint, or
(b) The table is the child table of a deferred FK constraint and it is
    determined at runtime that there are outstanding deferred FK
    constraint violations in the database,

then the equivalent of "DELETE FROM <tbl>" is executed before dropping the table from the database. Triggers are disabled while running this DELETE, but foreign key actions are not.

func Xsqlite3FkLocateIndex

func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey uintptr, ppIdx uintptr, paiCol uintptr) int32

A foreign key constraint requires that the key columns in the parent table are collectively subject to a UNIQUE or PRIMARY KEY constraint. Given that pParent is the parent table for foreign key constraint pFKey, search the schema for a unique index on the parent key columns.

If successful, zero is returned. If the parent key is an INTEGER PRIMARY KEY column, then output variable *ppIdx is set to NULL. Otherwise, *ppIdx is set to point to the unique index.

If the parent key consists of a single column (the foreign key constraint is not a composite foreign key), output variable *paiCol is set to NULL. Otherwise, it is set to point to an allocated array of size N, where N is the number of columns in the parent key. The first element of the array is the index of the child table column that is mapped by the FK constraint to the parent table column stored in the left-most column of index *ppIdx. The second element of the array is the index of the child table column that corresponds to the second left-most column of *ppIdx, and so on.

If the required index cannot be found, either because:

  1. The named parent key columns do not exist, or

  2. The named parent key columns do exist, but are not subject to a UNIQUE or PRIMARY KEY constraint, or

  3. No parent key columns were provided explicitly as part of the foreign key definition, and the parent table does not have a PRIMARY KEY, or

  4. No parent key columns were provided explicitly as part of the foreign key definition, and the PRIMARY KEY of the parent table consists of a different number of columns to the child key in the child table.

then non-zero is returned, and a "foreign key mismatch" error loaded into pParse. If an OOM error occurs, non-zero is returned and the pParse->db->mallocFailed flag is set.

func Xsqlite3FkReferences

func Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr

This function returns a linked list of FKey objects (connected by FKey.pNextTo) holding all children of table pTab. For example, given the following schema:

CREATE TABLE t1(a PRIMARY KEY);
CREATE TABLE t2(b REFERENCES t1(a);

Calling this function with table "t1" as an argument returns a pointer to the FKey structure representing the foreign key constraint on table "t2". Calling this function with "t2" as the argument would return a NULL pointer (as there are no FK constraints for which t2 is the parent table).

func Xsqlite3FkRequired

func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32

This function is called before generating code to update or delete a row contained in table pTab. If the operation is a DELETE, then parameter aChange is passed a NULL value. For an UPDATE, aChange points to an array of size N, where N is the number of columns in table pTab. If the i'th column is not modified by the UPDATE, then the corresponding entry in the aChange[] array is set to -1. If the column is modified, the value is 0 or greater. Parameter chngRowid is set to true if the UPDATE statement modifies the rowid fields of the table.

If any foreign key processing will be required, this function returns non-zero. If there is no foreign key related processing, this function returns zero.

For an UPDATE, this function returns 2 if:

  • There are any FKs for which pTab is the child and the parent table and any FK processing at all is required (even of a different FK), or

  • the UPDATE modifies one or more parent keys for which the action is not "NO ACTION" (i.e. is CASCADE, SET DEFAULT or SET NULL).

Or, assuming some other foreign key processing is required, 1.

func Xsqlite3FreeIndex

func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr)

Reclaim the memory used by an index

func Xsqlite3Fts5Init

func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32

The following functions are used to register the module with SQLite. If this module is being built as part of the SQLite core (SQLITE_CORE is defined), then sqlite3_open() will call sqlite3Fts5Init() directly.

Or, if this module is being built as a loadable extension, sqlite3Fts5Init() is omitted and the two standard entry points sqlite3_fts_init() and sqlite3_fts5_init() defined instead.

func Xsqlite3FunctionSearch

func Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr

Search a FuncDefHash for a function with the given name. Return a pointer to the matching FuncDef if found, or 0 if there is no match.

func Xsqlite3FunctionUsesThisSrc

func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) int32

Determine if any of the arguments to the pExpr Function reference pSrcList. Return true if they do. Also return true if the function has no arguments or has only constant arguments. Return false if pExpr references columns but not columns of tables found in pSrcList.

func Xsqlite3GenerateColumnNames

func Xsqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr)

Compute the column names for a SELECT statement.

The only guarantee that SQLite makes about column names is that if the column has an AS clause assigning it a name, that will be the name used. That is the only documented guarantee. However, countless applications developed over the years have made baseless assumptions about column names and will break if those assumptions changes. Hence, use extreme caution when modifying this routine to avoid breaking legacy.

See Also: sqlite3ColumnsFromExprList()

The PRAGMA short_column_names and PRAGMA full_column_names settings are deprecated. The default setting is short=ON, full=OFF. 99.9% of all applications should operate this way. Nevertheless, we need to support the other modes for legacy:

short=OFF, full=OFF:      Column name is the text of the expression has it
                          originally appears in the SELECT statement.  In
                          other words, the zSpan of the result expression.

short=ON, full=OFF:       (This is the default setting).  If the result
                          refers directly to a table column, then the
                          result column name is just the table column
                          name: COLUMN.  Otherwise use zSpan.

full=ON, short=ANY:       If the result refers directly to a table column,
                          then the result column name with the table name
                          prefix, ex: TABLE.COLUMN.  Otherwise use zSpan.

func Xsqlite3GenerateConstraintChecks

func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintptr, aRegIdx uintptr, iDataCur int32, iIdxCur int32, regNewData int32, regOldData int32, pkChng U8, overrideError U8, ignoreDest int32, pbMayReplace uintptr, aiChng uintptr, pUpsert uintptr)

Generate code to do constraint checks prior to an INSERT or an UPDATE on table pTab.

The regNewData parameter is the first register in a range that contains the data to be inserted or the data after the update. There will be pTab->nCol+1 registers in this range. The first register (the one that regNewData points to) will contain the new rowid, or NULL in the case of a WITHOUT ROWID table. The second register in the range will contain the content of the first table column. The third register will contain the content of the second table column. And so forth.

The regOldData parameter is similar to regNewData except that it contains the data prior to an UPDATE rather than afterwards. regOldData is zero for an INSERT. This routine can distinguish between UPDATE and INSERT by checking regOldData for zero.

For an UPDATE, the pkChng boolean is true if the true primary key (the rowid for a normal table or the PRIMARY KEY for a WITHOUT ROWID table) might be modified by the UPDATE. If pkChng is false, then the key of the iDataCur content table is guaranteed to be unchanged by the UPDATE.

For an INSERT, the pkChng boolean indicates whether or not the rowid was explicitly specified as part of the INSERT statement. If pkChng is zero, it means that the either rowid is computed automatically or that the table is a WITHOUT ROWID table and has no rowid. On an INSERT, pkChng will only be true if the INSERT statement provides an integer value for either the rowid column or its INTEGER PRIMARY KEY alias.

The code generated by this routine will store new index entries into registers identified by aRegIdx[]. No index entry is created for indices where aRegIdx[i]==0. The order of indices in aRegIdx[] is the same as the order of indices on the linked list of indices at pTab->pIndex.

(2019-05-07) The generated code also creates a new record for the main table, if pTab is a rowid table, and stores that record in the register identified by aRegIdx[nIdx] - in other words in the first entry of aRegIdx[] past the last index. It is important that the record be generated during constraint checks to avoid affinity changes to the register content that occur after constraint checks but before the new record is inserted.

The caller must have already opened writeable cursors on the main table and all applicable indices (that is to say, all indices for which aRegIdx[] is not zero). iDataCur is the cursor for the main table when inserting or updating a rowid table, or the cursor for the PRIMARY KEY index when operating on a WITHOUT ROWID table. iIdxCur is the cursor for the first index in the pTab->pIndex list. Cursors for other indices are at iIdxCur+N for the N-th element of the pTab->pIndex list.

This routine also generates code to check constraints. NOT NULL, CHECK, and UNIQUE constraints are all checked. If a constraint fails, then the appropriate action is performed. There are five possible actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.

Constraint type  Action       What Happens
---------------  ----------   ----------------------------------------
any              ROLLBACK     The current transaction is rolled back and
                              sqlite3_step() returns immediately with a
                              return code of SQLITE_CONSTRAINT.

any              ABORT        Back out changes from the current command
                              only (do not do a complete rollback) then
                              cause sqlite3_step() to return immediately
                              with SQLITE_CONSTRAINT.

any              FAIL         Sqlite3_step() returns immediately with a
                              return code of SQLITE_CONSTRAINT.  The
                              transaction is not rolled back and any
                              changes to prior rows are retained.

any              IGNORE       The attempt in insert or update the current
                              row is skipped, without throwing an error.
                              Processing continues with the next row.
                              (There is an immediate jump to ignoreDest.)

NOT NULL         REPLACE      The NULL value is replace by the default
                              value for that column.  If the default value
                              is NULL, the action is the same as ABORT.

UNIQUE           REPLACE      The other row that conflicts with the row
                              being inserted is removed.

CHECK            REPLACE      Illegal.  The results in an exception.

Which action to take is determined by the overrideError parameter. Or if overrideError==OE_Default, then the pParse->onError parameter is used. Or if pParse->onError==OE_Default then the onError value for the constraint is used.

func Xsqlite3GenerateIndexKey

func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iDataCur int32, regOut int32, prefixOnly int32, piPartIdxLabel uintptr, pPrior uintptr, regPrior int32) int32

Generate code that will assemble an index key and stores it in register regOut. The key with be for index pIdx which is an index on pTab. iCur is the index of a cursor open on the pTab table and pointing to the entry that needs indexing. If pTab is a WITHOUT ROWID table, then iCur must be the cursor of the PRIMARY KEY index.

Return a register number which is the first in a block of registers that holds the elements of the index key. The block of registers has already been deallocated by the time this routine returns.

If *piPartIdxLabel is not NULL, fill it in with a label and jump to that label if pIdx is a partial index that should be skipped. The label should be resolved using sqlite3ResolvePartIdxLabel(). A partial index should be skipped if its WHERE clause evaluates to false or null. If pIdx is not a partial index, *piPartIdxLabel will be set to zero which is an empty label that is ignored by sqlite3ResolvePartIdxLabel().

The pPrior and regPrior parameters are used to implement a cache to avoid unnecessary register loads. If pPrior is not NULL, then it is a pointer to a different index for which an index key has just been computed into register regPrior. If the current pIdx index is generating its key into the same sequence of registers and if pPrior and pIdx share a column in common, then the register corresponding to that column already holds the correct value and the loading of that register is skipped. This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK on a table with multiple indices, and especially with the ROWID or PRIMARY KEY columns of the index.

func Xsqlite3GenerateRowDelete

func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger uintptr, iDataCur int32, iIdxCur int32, iPk int32, nPk I16, count U8, onconf U8, eMode U8, iIdxNoSeek int32)

This routine generates VDBE code that causes a single row of a single table to be deleted. Both the original table entry and all indices are removed.

Preconditions:

  1. iDataCur is an open cursor on the btree that is the canonical data store for the table. (This will be either the table itself, in the case of a rowid table, or the PRIMARY KEY index in the case of a WITHOUT ROWID table.)

  2. Read/write cursors for all indices of pTab must be open as cursor number iIdxCur+i for the i-th index.

  3. The primary key for the row to be deleted must be stored in a sequence of nPk memory cells starting at iPk. If nPk==0 that means that a search record formed from OP_MakeRecord is contained in the single memory location iPk.

eMode:

Parameter eMode may be passed either ONEPASS_OFF (0), ONEPASS_SINGLE, or
ONEPASS_MULTI.  If eMode is not ONEPASS_OFF, then the cursor
iDataCur already points to the row to delete. If eMode is ONEPASS_OFF
then this function must seek iDataCur to the entry identified by iPk
and nPk before reading from it.

If eMode is ONEPASS_MULTI, then this call is being made as part
of a ONEPASS delete that affects multiple rows. In this case, if
iIdxNoSeek is a valid cursor number (>=0) and is not the same as
iDataCur, then its position should be preserved following the delete
operation. Or, if iIdxNoSeek is not a valid cursor number, the
position of iDataCur should be preserved instead.

iIdxNoSeek:

If iIdxNoSeek is a valid cursor number (>=0) not equal to iDataCur,
then it identifies an index cursor (from within array of cursors
starting at iIdxCur) that already points to the index entry to be deleted.
Except, this optimization is disabled if there are BEFORE triggers since
the trigger body might have moved the cursor.

func Xsqlite3GenerateRowIndexDelete

func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, aRegIdx uintptr, iIdxNoSeek int32)

This routine generates VDBE code that causes the deletion of all index entries associated with a single row of a single table, pTab

Preconditions:

  1. A read/write cursor "iDataCur" must be open on the canonical storage btree for the table pTab. (This will be either the table itself for rowid tables or to the primary key index for WITHOUT ROWID tables.)

  2. Read/write cursors for all indices of pTab must be open as cursor number iIdxCur+i for the i-th index. (The pTab->pIndex index is the 0-th index.)

  3. The "iDataCur" cursor must be already be positioned on the row that is to be deleted.

func Xsqlite3GetCollSeq

func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zName uintptr) uintptr

This function is responsible for invoking the collation factory callback or substituting a collation sequence of a different encoding when the requested collation sequence is not available in the desired encoding.

If it is not NULL, then pColl must point to the database native encoding collation sequence with name zName, length nName.

The return value is either the collation sequence to be used in database db for collation type name zName, length nName, or NULL, if no collation sequence can be found. If no collation is found, leave an error message.

See also: sqlite3LocateCollSeq(), sqlite3FindCollSeq()

func Xsqlite3GetInt32

func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32

If zNum represents an integer that will fit in 32-bits, then set *pValue to that integer and return true. Otherwise return false.

This routine accepts both decimal and hexadecimal notation for integers.

Any non-numeric characters that following zNum are ignored. This is different from sqlite3Atoi64() which requires the input number to be zero-terminated.

func Xsqlite3GetTempRange

func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32

Allocate or deallocate a block of nReg consecutive registers.

func Xsqlite3GetTempReg

func Xsqlite3GetTempReg(tls *libc.TLS, pParse uintptr) int32

Allocate a single new register for use to hold some intermediate result.

func Xsqlite3GetToken

func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32

Return the length (in bytes) of the token that begins at z[0]. Store the token type in *tokenType before returning.

func Xsqlite3GetUInt32

func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32

Try to convert z into an unsigned 32-bit integer. Return true on success and false if there is an error.

Only decimal notation is accepted.

func Xsqlite3GetVTable

func Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr

pTab is a pointer to a Table structure representing a virtual-table. Return a pointer to the VTable object used by connection db to access this virtual-table, if one has been created, or NULL otherwise.

func Xsqlite3GetVdbe

func Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr

Get a VDBE for the given parser context. Create a new one if necessary. If an error occurs, return NULL and leave a message in pParse.

func Xsqlite3HaltConstraint

func Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type I8, p5Errmsg U8)

Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT error. The onError parameter determines which (if any) of the statement and/or current transaction is rolled back.

func Xsqlite3HasExplicitNulls

func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int32

If expression list pList contains an expression that was parsed with an explicit "NULLS FIRST" or "NULLS LAST" clause, leave an error in pParse and return non-zero. Otherwise, return zero.

func Xsqlite3HashClear

func Xsqlite3HashClear(tls *libc.TLS, pH uintptr)

Remove all entries from a hash table. Reclaim all memory. Call this routine to delete a hash table or to reset a hash table to the empty state.

func Xsqlite3HashFind

func Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr

Attempt to locate an element of the hash table pH with a key that matches pKey. Return the data for this element if it is found, or NULL if there is no match.

func Xsqlite3HashInit

func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr)

Turn bulk memory into a hash table object by initializing the fields of the Hash structure.

"pNew" is a pointer to the hash table that is to be initialized.

func Xsqlite3HashInsert

func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) uintptr

Insert an element into the hash table pH. The key is pKey and the data is "data".

If no element exists with a matching key, then a new element is created and NULL is returned.

If another element already exists with the same key, then the new data replaces the old data and the old data is returned. The key is not copied in this instance. If a malloc fails, then the new data is returned and the hash table is unchanged.

If the "data" parameter to this function is NULL, then the element corresponding to "key" is removed from the hash table.

func Xsqlite3HeaderSizeBtree

func Xsqlite3HeaderSizeBtree(tls *libc.TLS) int32

Return the size of the header added to each page by this module.

func Xsqlite3HeaderSizePcache

func Xsqlite3HeaderSizePcache(tls *libc.TLS) int32

Return the size of the header added by this middleware layer in the page-cache hierarchy.

func Xsqlite3HeaderSizePcache1

func Xsqlite3HeaderSizePcache1(tls *libc.TLS) int32

Return the size of the header on each page of this PCACHE implementation.

func Xsqlite3HeapNearlyFull

func Xsqlite3HeapNearlyFull(tls *libc.TLS) int32

Return true if the heap is currently under memory pressure - in other words if the amount of heap used is close to the limit set by sqlite3_soft_heap_limit().

func Xsqlite3HexToBlob

func Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr

Convert a BLOB literal of the form "x'hhhhhh'" into its binary value. Return a pointer to its binary value. Space to hold the binary value has been obtained from malloc and must be freed by the calling routine.

func Xsqlite3IdListAppend

func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr) uintptr

Append a new element to the given IdList. Create a new IdList if need be.

A new IdList is returned, or NULL if malloc() fails.

func Xsqlite3IdListDelete

func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr)

Delete an IdList.

func Xsqlite3IdListDup

func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr

func Xsqlite3IdListIndex

func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32

Return the index in pList of the identifier named zId. Return -1 if not found.

func Xsqlite3IndexAffinityOk

func Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) int32

pExpr is a comparison expression, eg. '=', '<', IN(...) etc. idx_affinity is the affinity of an indexed column. Return true if the index with affinity idx_affinity may be used to implement the comparison in pExpr.

func Xsqlite3IndexAffinityStr

func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr

Return a pointer to the column affinity string associated with index pIdx. A column affinity string has one character for each column in the table, according to the affinity of the column:

Character      Column affinity
------------------------------
'A'            BLOB
'B'            TEXT
'C'            NUMERIC
'D'            INTEGER
'F'            REAL

An extra 'D' is appended to the end of the string to cover the rowid that appears as the last column in every index.

Memory for the buffer containing the column index affinity string is managed along with the rest of the Index structure. It will be released when sqlite3DeleteIndex() is called.

func Xsqlite3IndexColumnAffinity

func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol int32) int8

Return the affinity for a single column of an index.

func Xsqlite3IndexHasDuplicateRootPage

func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32

Check to see if any sibling index (another index on the same table) of pIndex has the same root page number, and if it does, return true. This would indicate a corrupt schema.

func Xsqlite3IndexedByLookup

func Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32

If the source-list item passed as an argument was augmented with an INDEXED BY clause, then try to locate the specified index. If there was such a clause and the named index cannot be found, return SQLITE_ERROR and leave an error in pParse. Otherwise, populate pFrom->pIndex and return SQLITE_OK.

func Xsqlite3Init

func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32

Initialize all database files - the main database file, the file used to store temporary tables, and any additional database files created using ATTACH statements. Return a success code. If an error occurs, write an error message into *pzErrMsg.

After a database is initialized, the DB_SchemaLoaded bit is set bit is set in the flags field of the Db structure.

func Xsqlite3InitCallback

func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr, NotUsed uintptr) int32

This is the callback routine for the code that initializes the database. See sqlite3Init() below for additional information. This routine is also called from the OP_ParseSchema opcode of the VDBE.

Each callback contains the following information:

argv[0] = type of object: "table", "index", "trigger", or "view".
argv[1] = name of thing being created
argv[2] = associated table if an index or trigger
argv[3] = root page number for table or index. 0 for trigger or view.
argv[4] = SQL text for the CREATE statement.

func Xsqlite3InitOne

func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFlags U32) int32

Attempt to read the database schema and initialize internal data structures for a single database file. The index of the database file is given by iDb. iDb==0 is used for the main database. iDb==1 should never be used. iDb>=2 is used for auxiliary databases. Return one of the SQLITE_ error codes to indicate success or failure.

func Xsqlite3Insert

func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr)

This routine is called to handle SQL of the following forms:

insert into TABLE (IDLIST) values(EXPRLIST),(EXPRLIST),...
insert into TABLE (IDLIST) select
insert into TABLE (IDLIST) default values

The IDLIST following the table name is always optional. If omitted, then a list of all (non-hidden) columns for the table is substituted. The IDLIST appears in the pColumn parameter. pColumn is NULL if IDLIST is omitted.

For the pSelect parameter holds the values to be inserted for the first two forms shown above. A VALUES clause is really just short-hand for a SELECT statement that omits the FROM clause and everything else that follows. If the pSelect parameter is NULL, that means that the DEFAULT VALUES form of the INSERT statement is intended.

The code generated follows one of four templates. For a simple insert with data coming from a single-row VALUES clause, the code executes once straight down through. Pseudo-code follows (we call this the "1st template"):

open write cursor to <table> and its indices
put VALUES clause expressions into registers
write the resulting record into <table>
cleanup

The three remaining templates assume the statement is of the form

INSERT INTO <table> SELECT ...

If the SELECT clause is of the restricted form "SELECT * FROM <table2>" - in other words if the SELECT pulls all columns from a single table and there is no WHERE or LIMIT or GROUP BY or ORDER BY clauses, and if <table2> and <table1> are distinct tables but have identical schemas, including all the same indices, then a special optimization is invoked that copies raw records from <table2> over to <table1>. See the xferOptimization() function for the implementation of this template. This is the 2nd template.

open a write cursor to <table>
open read cursor on <table2>
transfer all records in <table2> over to <table>
close cursors
foreach index on <table>
  open a write cursor on the <table> index
  open a read cursor on the corresponding <table2> index
  transfer all records from the read to the write cursors
  close cursors
end foreach

The 3rd template is for when the second template does not apply and the SELECT clause does not read from <table> at any time. The generated code follows this template:

   X <- A
   goto B
A: setup for the SELECT
   loop over the rows in the SELECT
     load values into registers R..R+n
     yield X
   end loop
   cleanup after the SELECT
   end-coroutine X
B: open write cursor to <table> and its indices
C: yield X, at EOF goto D
   insert the select result into <table> from R..R+n
   goto C
D: cleanup

The 4th template is used if the insert statement takes its values from a SELECT but the data is being inserted into a table that is also read as part of the SELECT. In the third form, we have to use an intermediate table to store the results of the select. The template is like this:

   X <- A
   goto B
A: setup for the SELECT
   loop over the tables in the SELECT
     load value into register R..R+n
     yield X
   end loop
   cleanup after the SELECT
   end co-routine R
B: open temp table
L: yield X, at EOF goto M
   insert row from R..R+n into temp table
   goto L
M: open write cursor to <table> and its indices
   rewind temp table
C: loop over rows of intermediate table
     transfer values form intermediate table into <table>
   end loop
D: cleanup

func Xsqlite3InsertBuiltinFuncs

func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32)

Insert a new FuncDef into a FuncDefHash hash table.

func Xsqlite3Int64ToText

func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr)

Render an signed 64-bit integer as text. Store the result in zOut[].

The caller must ensure that zOut[] is at least 21 bytes in size.

func Xsqlite3InvokeBusyHandler

func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32

Invoke the given busy handler.

This routine is called when an operation failed to acquire a lock on VFS file pFile.

If this routine returns non-zero, the lock is retried. If it returns 0, the operation aborts with an SQLITE_BUSY error.

func Xsqlite3IsBinary

func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32

Return true if CollSeq is the default built-in BINARY.

func Xsqlite3IsIdChar

func Xsqlite3IsIdChar(tls *libc.TLS, c U8) int32

Make the IdChar function accessible from ctime.c and alter.c

func Xsqlite3IsLikeFunction

func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase uintptr, aWc uintptr) int32

pExpr points to an expression which implements a function. If it is appropriate to apply the LIKE optimization to that function then set aWc[0] through aWc[2] to the wildcard characters and the escape character and then return TRUE. If the function is not a LIKE-style function then return FALSE.

The expression "a LIKE b ESCAPE c" is only considered a valid LIKE operator if c is a string literal that is exactly one byte in length. That one byte is stored in aWc[3]. aWc[3] is set to zero if there is no ESCAPE clause.

*pIsNocase is set to true if uppercase and lowercase are equivalent for the function (default for LIKE). If the function makes the distinction between uppercase and lowercase (as does GLOB) then *pIsNocase is set to false.

func Xsqlite3IsNaN

func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32

Return true if the floating point value is Not a Number (NaN).

func Xsqlite3IsReadOnly

func Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int32) int32

Check to make sure the given table is writable. If it is not writable, generate an error message and return 1. If it is writable return 0;

func Xsqlite3IsRowid

func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32

Return TRUE if the given string is a row-id column name.

func Xsqlite3IsShadowTableOf

func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uintptr) int32

Return true if pTab is a virtual table and zName is a shadow table name for that virtual table.

func Xsqlite3JoinType

func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC uintptr) int32

Given 1 to 3 identifiers preceding the JOIN keyword, determine the type of join. Return an integer constant that expresses that type in terms of the following bit values:

JT_INNER
JT_CROSS
JT_OUTER
JT_NATURAL
JT_LEFT
JT_RIGHT

A full outer join is the combination of JT_LEFT and JT_RIGHT.

If an illegal or unsupported join type is seen, then still return a join type, but put an error in the pParse structure.

func Xsqlite3JournalIsInMemory

func Xsqlite3JournalIsInMemory(tls *libc.TLS, p uintptr) int32

The file-handle passed as the only argument is open on a journal file. Return true if this "journal file" is currently stored in heap memory, or false otherwise.

func Xsqlite3JournalModename

func Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr

Parameter eMode must be one of the PAGER_JOURNALMODE_XXX constants defined in pager.h. This function returns the associated lowercase journal-mode name.

func Xsqlite3JournalOpen

func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintptr, flags int32, nSpill int32) int32

Open a journal file.

The behaviour of the journal file depends on the value of parameter nSpill. If nSpill is 0, then the journal file is always create and accessed using the underlying VFS. If nSpill is less than zero, then all content is always stored in main-memory. Finally, if nSpill is a positive value, then the journal file is initially created in-memory but may be flushed to disk later on. In this case the journal file is flushed to disk either when it grows larger than nSpill bytes in size, or when sqlite3JournalCreate() is called.

func Xsqlite3JournalSize

func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32

Return the number of bytes required to store a JournalFile that uses vfs pVfs to create the underlying on-disk files.

func Xsqlite3Json1Init

func Xsqlite3Json1Init(tls *libc.TLS, db uintptr) int32

func Xsqlite3KeyInfoAlloc

func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr

Allocate a KeyInfo object sufficient for an index of N key columns and X extra columns.

func Xsqlite3KeyInfoFromExprList

func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, iStart int32, nExtra int32) uintptr

Given an expression list, generate a KeyInfo structure that records the collating sequence for each expression in that expression list.

If the ExprList is an ORDER BY or GROUP BY clause then the resulting KeyInfo structure is appropriate for initializing a virtual index to implement that clause. If the ExprList is the result set of a SELECT then the KeyInfo structure is appropriate for initializing a virtual index to implement a DISTINCT test.

Space to hold the KeyInfo structure is obtained from malloc. The calling function is responsible for seeing that this structure is eventually freed.

func Xsqlite3KeyInfoOfIndex

func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr

Return a KeyInfo structure that is appropriate for the given Index.

The caller should invoke sqlite3KeyInfoUnref() on the returned object when it has finished using it.

func Xsqlite3KeyInfoRef

func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr

Make a new pointer to a KeyInfo object

func Xsqlite3KeyInfoUnref

func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr)

Deallocate a KeyInfo object

func Xsqlite3KeywordCode

func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32

func Xsqlite3LeaveMutexAndCloseZombie

func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr)

Close the mutex on database connection db.

Furthermore, if database connection db is a zombie (meaning that there has been a prior call to sqlite3_close(db) or sqlite3_close_v2(db)) and every sqlite3_stmt has now been finalized and every sqlite3_backup has finished, then free all resources.

func Xsqlite3LocateCollSeq

func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr

This function returns the collation sequence for database native text encoding identified by the string zName.

If the requested collation sequence is not available, or not available in the database native encoding, the collation factory is invoked to request it. If the collation factory does not supply such a sequence, and the sequence is available in another text encoding, then that is returned instead.

If no versions of the requested collations sequence are available, or another error occurs, NULL is returned and an error message written into pParse.

This routine is a wrapper around sqlite3FindCollSeq(). This routine invokes the collation factory if the named collation cannot be found and generates an error message.

See also: sqlite3FindCollSeq(), sqlite3GetCollSeq()

func Xsqlite3LocateTable

func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr, zDbase uintptr) uintptr

Locate the in-memory structure that describes a particular database table given the name of that table and (optionally) the name of the database containing the table. Return NULL if not found. Also leave an error message in pParse->zErrMsg.

The difference between this routine and sqlite3FindTable() is that this routine leaves an error message in pParse->zErrMsg where sqlite3FindTable() does not.

func Xsqlite3LocateTableItem

func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr) uintptr

Locate the table identified by *p.

This is a wrapper around sqlite3LocateTable(). The difference between sqlite3LocateTable() and this function is that this function restricts the search to schema (p->pSchema) if it is not NULL. p->pSchema may be non-NULL if it is part of a view or trigger program definition. See sqlite3FixSrcList() for details.

func Xsqlite3LookasideUsed

func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32

Count the number of slots of lookaside memory that are outstanding

func Xsqlite3MPrintf

func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uintptr

Print into memory obtained from sqliteMalloc(). Use the internal %-conversion extensions.

func Xsqlite3Malloc

func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr

Allocate memory. This routine is like sqlite3_malloc() except that it assumes the memory subsystem has already been initialized.

func Xsqlite3MallocEnd

func Xsqlite3MallocEnd(tls *libc.TLS)

Deinitialize the memory allocation subsystem.

func Xsqlite3MallocInit

func Xsqlite3MallocInit(tls *libc.TLS) int32

Initialize the memory allocation subsystem.

func Xsqlite3MallocMutex

func Xsqlite3MallocMutex(tls *libc.TLS) uintptr

Return the memory allocator mutex. sqlite3_status() needs it.

func Xsqlite3MallocSize

func Xsqlite3MallocSize(tls *libc.TLS, p uintptr) int32

Return the size of a memory allocation previously obtained from sqlite3Malloc() or sqlite3_malloc().

func Xsqlite3MallocZero

func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr

Allocate and zero memory.

func Xsqlite3MatchEName

func Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr, zDb uintptr) int32

Subqueries stores the original database, table and column names for their result sets in ExprList.a[].zSpan, in the form "DATABASE.TABLE.COLUMN". Check to see if the zSpan given to this routine matches the zDb, zTab, and zCol. If any of zDb, zTab, and zCol are NULL then those fields will match anything.

func Xsqlite3MaterializeView

func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr, iCur int32)

Evaluate a view and store its result in an ephemeral table. The pWhere argument is an optional WHERE clause that restricts the set of rows in the view that are to be added to the ephemeral table.

func Xsqlite3MayAbort

func Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr)

The code generator calls this routine if is discovers that it is possible to abort a statement prior to completion. In order to perform this abort without corrupting the database, we need to make sure that the statement is protected by a statement transaction.

Technically, we only need to set the mayAbort flag if the isMultiWrite flag was previously set. There is a time dependency such that the abort must occur after the multiwrite. This makes some statements involving the REPLACE conflict resolution algorithm go a little faster. But taking advantage of this time dependency makes it more difficult to prove that the code is correct (in particular, it prevents us from writing an effective implementation of sqlite3AssertMayAbort()) and so we have chosen to take the safe route and skip the optimization.

func Xsqlite3MemCompare

func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) int32

Compare the values contained by the two memory cells, returning negative, zero or positive if pMem1 is less than, equal to, or greater than pMem2. Sorting order is NULL's first, followed by numbers (integers and reals) sorted numerically, followed by text ordered by the collating sequence pColl and finally blob's ordered by memcmp().

Two NULL values are considered equal by this function.

func Xsqlite3MemJournalOpen

func Xsqlite3MemJournalOpen(tls *libc.TLS, pJfd uintptr)

Open an in-memory journal file.

func Xsqlite3MemSetDefault

func Xsqlite3MemSetDefault(tls *libc.TLS)

This routine is the only routine in this file with external linkage.

Populate the low-level memory allocation function pointers in sqlite3GlobalConfig.m with pointers to the routines in this file.

func Xsqlite3MemdbInit

func Xsqlite3MemdbInit(tls *libc.TLS) int32

This routine is called when the extension is loaded. Register the new VFS.

func Xsqlite3MemoryBarrier

func Xsqlite3MemoryBarrier(tls *libc.TLS)

Try to provide a memory barrier operation, needed for initialization and also for the implementation of xShmBarrier in the VFS in cases where SQLite is compiled without mutexes.

func Xsqlite3MisuseError

func Xsqlite3MisuseError(tls *libc.TLS, lineno int32) int32

func Xsqlite3MulInt64

func Xsqlite3MulInt64(tls *libc.TLS, pA uintptr, iB I64) int32

func Xsqlite3MultiWrite

func Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr)

Indicate that the statement currently under construction might write more than one entry (example: deleting one row then inserting another, inserting multiple rows in a table, or inserting a row and index entries.) If an abort occurs after some of these writes have completed, then it will be necessary to undo the completed writes.

func Xsqlite3MutexAlloc

func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr

func Xsqlite3MutexEnd

func Xsqlite3MutexEnd(tls *libc.TLS) int32

Shutdown the mutex system. This call frees resources allocated by sqlite3MutexInit().

func Xsqlite3MutexInit

func Xsqlite3MutexInit(tls *libc.TLS) int32

Initialize the mutex system.

func Xsqlite3NameFromToken

func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr

Given a token, return a string that consists of the text of that token. Space to hold the returned string is obtained from sqliteMalloc() and must be freed by the calling function.

Any quotation marks (ex: "name", 'name', [name], or `name`) that surround the body of the token are removed.

Tokens are often just pointers into the original SQL text and so are not \000 terminated and are not persistent. The returned string is \000 terminated and is persistent.

func Xsqlite3NestedParse

func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr)

Run the parser and code generator recursively in order to generate code for the SQL statement given onto the end of the pParse context currently under construction. When the parser is run recursively this way, the final OP_Halt is not appended and other initialization and finalization steps are omitted because those are handling by the outermost parser.

Not everything is nestable. This facility is designed to permit INSERT, UPDATE, and DELETE operations against the schema table. Use care if you decide to try to use this routine for some other purposes.

func Xsqlite3NoopDestructor

func Xsqlite3NoopDestructor(tls *libc.TLS, p uintptr)

A no-op destructor

func Xsqlite3NoopMutex

func Xsqlite3NoopMutex(tls *libc.TLS) uintptr

func Xsqlite3NotPureFunc

func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32

Cause a function to throw an error if it was call from OP_PureFunc rather than OP_Function.

OP_PureFunc means that the function must be deterministic, and should throw an error if it is given inputs that would make it non-deterministic. This routine is invoked by date/time functions that use non-deterministic features such as 'now'.

func Xsqlite3OomClear

func Xsqlite3OomClear(tls *libc.TLS, db uintptr)

This routine reactivates the memory allocator and clears the db->mallocFailed flag as necessary.

The memory allocator is not restarted if there are running VDBEs.

func Xsqlite3OomFault

func Xsqlite3OomFault(tls *libc.TLS, db uintptr)

Call this routine to record the fact that an OOM (out-of-memory) error has happened. This routine will set db->mallocFailed, and also temporarily disable the lookaside memory allocator and interrupt any running VDBEs.

func Xsqlite3OpcodeName

func Xsqlite3OpcodeName(tls *libc.TLS, i int32) uintptr

************* End of hash.c *********************************************** ************* Begin file opcodes.c **************************************** Automatically generated. Do not edit See the tool/mkopcodec.tcl script for details.

func Xsqlite3OpenSchemaTable

func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32)

Open the sqlite_schema table stored in database number iDb for writing. The table is opened using cursor 0.

func Xsqlite3OpenTable

func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTab uintptr, opcode int32)

Generate code that will

(1) acquire a lock for table pTab then
(2) open pTab as cursor iCur.

If pTab is a WITHOUT ROWID table, then it is the PRIMARY KEY index for that table that is actually opened.

func Xsqlite3OpenTableAndIndices

func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p5 U8, iBase int32, aToOpen uintptr, piDataCur uintptr, piIdxCur uintptr) int32

Allocate cursors for the pTab table and all its indices and generate code to open and initialized those cursors.

The cursor for the object that contains the complete data (normally the table itself, but the PRIMARY KEY index in the case of a WITHOUT ROWID table) is returned in *piDataCur. The first index cursor is returned in *piIdxCur. The number of indices is returned.

Use iBase as the first cursor (either the *piDataCur for rowid tables or the first index for WITHOUT ROWID tables) if it is non-negative. If iBase is negative, then allocate the next available cursor.

For a rowid table, *piDataCur will be exactly one less than *piIdxCur. For a WITHOUT ROWID table, *piDataCur will be somewhere in the range of *piIdxCurs, depending on where the PRIMARY KEY index appears on the pTab->pIndex list.

If pTab is a virtual table, then this routine is a no-op and the *piDataCur and *piIdxCur values are left uninitialized.

func Xsqlite3OpenTempDatabase

func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32

Make sure the TEMP database is open and available for use. Return the number of errors. Leave any error messages in the pParse structure.

func Xsqlite3OsAccess

func Xsqlite3OsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32

func Xsqlite3OsCheckReservedLock

func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32

func Xsqlite3OsClose

func Xsqlite3OsClose(tls *libc.TLS, pId uintptr)

The following routines are convenience wrappers around methods of the sqlite3_file object. This is mostly just syntactic sugar. All of this would be completely automatic if SQLite were coded using C++ instead of plain old C.

func Xsqlite3OsCloseFree

func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr)

func Xsqlite3OsCurrentTimeInt64

func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32

func Xsqlite3OsDelete

func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32

func Xsqlite3OsDeviceCharacteristics

func Xsqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) int32

func Xsqlite3OsDlClose

func Xsqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr)

func Xsqlite3OsDlError

func Xsqlite3OsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr)

func Xsqlite3OsDlOpen

func Xsqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr

func Xsqlite3OsDlSym

func Xsqlite3OsDlSym(tls *libc.TLS, pVfs uintptr, pHdle uintptr, zSym uintptr) uintptr

func Xsqlite3OsFetch

func Xsqlite3OsFetch(tls *libc.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr) int32

The real implementation of xFetch and xUnfetch

func Xsqlite3OsFileControl

func Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32

Use sqlite3OsFileControl() when we are doing something that might fail and we need to know about the failures. Use sqlite3OsFileControlHint() when simply tossing information over the wall to the VFS and we do not really care if the VFS receives and understands the information since it is only a hint and can be safely ignored. The sqlite3OsFileControlHint() routine has no return value since the return value would be meaningless.

func Xsqlite3OsFileControlHint

func Xsqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr)

func Xsqlite3OsFileSize

func Xsqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32

func Xsqlite3OsFullPathname

func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32

func Xsqlite3OsGetLastError

func Xsqlite3OsGetLastError(tls *libc.TLS, pVfs uintptr) int32

func Xsqlite3OsInit

func Xsqlite3OsInit(tls *libc.TLS) int32

This function is a wrapper around the OS specific implementation of sqlite3_os_init(). The purpose of the wrapper is to provide the ability to simulate a malloc failure, so that the handling of an error in sqlite3_os_init() by the upper layers can be tested.

func Xsqlite3OsLock

func Xsqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) int32

func Xsqlite3OsOpen

func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pFlagsOut uintptr) int32

The next group of routines are convenience wrappers around the VFS methods.

func Xsqlite3OsOpenMalloc

func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uintptr, flags int32, pOutFlags uintptr) int32

func Xsqlite3OsRandomness

func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32

func Xsqlite3OsRead

func Xsqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32

func Xsqlite3OsSectorSize

func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32

func Xsqlite3OsShmBarrier

func Xsqlite3OsShmBarrier(tls *libc.TLS, id uintptr)

func Xsqlite3OsShmLock

func Xsqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) int32

func Xsqlite3OsShmMap

func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) int32

func Xsqlite3OsShmUnmap

func Xsqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) int32

func Xsqlite3OsSleep

func Xsqlite3OsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32

func Xsqlite3OsSync

func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32

func Xsqlite3OsTruncate

func Xsqlite3OsTruncate(tls *libc.TLS, id uintptr, size I64) int32

func Xsqlite3OsUnfetch

func Xsqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff I64, p uintptr) int32

func Xsqlite3OsUnlock

func Xsqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) int32

func Xsqlite3OsWrite

func Xsqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32

func Xsqlite3PCacheBufferSetup

func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32)

This function is called during initialization if a static buffer is supplied to use for the page-cache by passing the SQLITE_CONFIG_PAGECACHE verb to sqlite3_config(). Parameter pBuf points to an allocation large enough to contain 'n' buffers of 'sz' bytes each.

This routine is called from sqlite3_initialize() and so it is guaranteed to be serialized already. There is no need for further mutexing.

func Xsqlite3PCachePercentDirty

func Xsqlite3PCachePercentDirty(tls *libc.TLS, pCache uintptr) int32

Return the number of dirty pages currently in the cache, as a percentage of the configured cache size.

func Xsqlite3PCacheSetDefault

func Xsqlite3PCacheSetDefault(tls *libc.TLS)

This function is called during initialization (sqlite3_initialize()) to install the default pluggable cache module, assuming the user has not already provided an alternative.

func Xsqlite3PExpr

func Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRight uintptr) uintptr

Allocate an Expr node which joins as many as two subtrees.

One or both of the subtrees can be NULL. Return a pointer to the new Expr node. Or, if an OOM error occurs, set pParse->db->mallocFailed, free the subtrees and return NULL.

func Xsqlite3PExprAddSelect

func Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelect uintptr)

Add pSelect to the Expr.x.pSelect field. Or, if pExpr is NULL (due do a memory allocation failure) then delete the pSelect object.

func Xsqlite3PageFree

func Xsqlite3PageFree(tls *libc.TLS, p uintptr)

Free an allocated buffer obtained from sqlite3PageMalloc().

func Xsqlite3PageMalloc

func Xsqlite3PageMalloc(tls *libc.TLS, sz int32) uintptr

Malloc function used by SQLite to obtain space from the buffer configured using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no such buffer exists, this function falls back to sqlite3Malloc().

func Xsqlite3PagerBackupPtr

func Xsqlite3PagerBackupPtr(tls *libc.TLS, pPager uintptr) uintptr

Return a pointer to the pPager->pBackup variable. The backup module in backup.c maintains the content of this variable. This module uses it opaquely as an argument to sqlite3BackupRestart() and sqlite3BackupUpdate() only.

func Xsqlite3PagerBegin

func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemory int32) int32

Begin a write-transaction on the specified pager object. If a write-transaction has already been opened, this function is a no-op.

If the exFlag argument is false, then acquire at least a RESERVED lock on the database file. If exFlag is true, then acquire at least an EXCLUSIVE lock. If such a lock is already held, no locking functions need be called.

If the subjInMemory argument is non-zero, then any sub-journal opened within this transaction will be opened as an in-memory file. This has no effect if the sub-journal is already opened (as it may be when running in exclusive mode) or if the transaction does not require a sub-journal. If the subjInMemory argument is zero, then any required sub-journal is implemented in-memory if pPager is an in-memory database, or using a temporary file otherwise.

func Xsqlite3PagerCacheStat

func Xsqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset int32, pnVal uintptr)

Parameter eStat must be one of SQLITE_DBSTATUS_CACHE_HIT, _MISS, _WRITE, or _WRITE+1. The SQLITE_DBSTATUS_CACHE_WRITE+1 case is a translation of SQLITE_DBSTATUS_CACHE_SPILL. The _SPILL case is not contiguous because it was added later.

Before returning, *pnVal is incremented by the current cache hit or miss count, according to the value of eStat. If the reset parameter is non-zero, the cache hit or miss count is zeroed before returning.

func Xsqlite3PagerCheckpoint

func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32

This function is called when the user invokes "PRAGMA wal_checkpoint", "PRAGMA wal_blocking_checkpoint" or calls the sqlite3_wal_checkpoint() or wal_blocking_checkpoint() API functions.

Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.

func Xsqlite3PagerClearCache

func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr)

Unless this is an in-memory or temporary database, clear the pager cache.

func Xsqlite3PagerClose

func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32

Shutdown the page cache. Free all memory and close all files.

If a transaction was in progress when this routine is called, that transaction is rolled back. All outstanding pages are invalidated and their memory is freed. Any attempt to use a page associated with this page cache after this function returns will likely result in a coredump.

This function always succeeds. If a transaction is active an attempt is made to roll it back. If an error occurs during the rollback a hot journal may be left in the filesystem but no error is returned to the caller.

func Xsqlite3PagerCloseWal

func Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32

This function is called to close the connection to the log file prior to switching from WAL to rollback mode.

Before closing the log file, this function attempts to take an EXCLUSIVE lock on the database file. If this cannot be obtained, an error (SQLITE_BUSY) is returned and the log connection is not closed. If successful, the EXCLUSIVE lock is not released before returning.

func Xsqlite3PagerCommitPhaseOne

func Xsqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, noSync int32) int32

Sync the database file for the pager pPager. zSuper points to the name of a super-journal file that should be written into the individual journal file. zSuper may be NULL, which is interpreted as no super-journal (a single database transaction).

This routine ensures that:

  • The database file change-counter is updated,
  • the journal is synced (unless the atomic-write optimization is used),
  • all dirty pages are written to the database file,
  • the database file is truncated (if required), and
  • the database file synced.

The only thing that remains to commit the transaction is to finalize (delete, truncate or zero the first part of) the journal file (or delete the super-journal file if specified).

Note that if zSuper==NULL, this does not overwrite a previous value passed to an sqlite3PagerCommitPhaseOne() call.

If the final parameter - noSync - is true, then the database file itself is not synced. The caller must call sqlite3PagerSync() directly to sync the database file before calling CommitPhaseTwo() to delete the journal file in this case.

func Xsqlite3PagerCommitPhaseTwo

func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32

When this function is called, the database file has been completely updated to reflect the changes made by the current transaction and synced to disk. The journal file still exists in the file-system though, and if a failure occurs at this point it will eventually be used as a hot-journal and the current transaction rolled back.

This function finalizes the journal file, either by deleting, truncating or partially zeroing it, so that it cannot be used for hot-journal rollback. Once this is done the transaction is irrevocably committed.

If an error occurs, an IO error code is returned and the pager moves into the error state. Otherwise, SQLITE_OK is returned.

func Xsqlite3PagerDontWrite

func Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr)

A call to this routine tells the pager that it is not necessary to write the information on page pPg back to the disk, even though that page might be marked as dirty. This happens, for example, when the page has been added as a leaf of the freelist and so its content no longer matters.

The overlying software layer calls this routine when all of the data on the given page is unused. The pager marks the page as clean so that it does not get written to disk.

Tests show that this optimization can quadruple the speed of large DELETE operations.

This optimization cannot be used with a temp-file, as the page may have been dirty at the start of the transaction. In that case, if memory pressure forces page pPg out of the cache, the data does need to be written out to disk so that it may be read back in if the current transaction is rolled back.

func Xsqlite3PagerExclusiveLock

func Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32

This function may only be called while a write-transaction is active in rollback. If the connection is in WAL mode, this call is a no-op. Otherwise, if the connection does not already have an EXCLUSIVE lock on the database file, an attempt is made to obtain one.

If the EXCLUSIVE lock is already held or the attempt to obtain it is successful, or the connection is in WAL mode, SQLITE_OK is returned. Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is returned.

func Xsqlite3PagerFile

func Xsqlite3PagerFile(tls *libc.TLS, pPager uintptr) uintptr

Return the file handle for the database file associated with the pager. This might return NULL if the file has not yet been opened.

func Xsqlite3PagerFilename

func Xsqlite3PagerFilename(tls *libc.TLS, pPager uintptr, nullIfMemDb int32) uintptr

Return the full pathname of the database file.

Except, if the pager is in-memory only, then return an empty string if nullIfMemDb is true. This routine is called with nullIfMemDb==1 when used to report the filename to the user, for compatibility with legacy behavior. But when the Btree needs to know the filename for matching to shared cache, it uses nullIfMemDb==0 so that in-memory databases can participate in shared-cache.

The return value to this routine is always safe to use with sqlite3_uri_parameter() and sqlite3_filename_database() and friends.

func Xsqlite3PagerFlush

func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32

Flush all unreferenced dirty pages to disk.

func Xsqlite3PagerGet

func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32

Dispatch all page fetch requests to the appropriate getter method.

func Xsqlite3PagerGetData

func Xsqlite3PagerGetData(tls *libc.TLS, pPg uintptr) uintptr

Return a pointer to the data for the specified page.

func Xsqlite3PagerGetExtra

func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr

Return a pointer to the Pager.nExtra bytes of "extra" space allocated along with the specified page.

func Xsqlite3PagerGetJournalMode

func Xsqlite3PagerGetJournalMode(tls *libc.TLS, pPager uintptr) int32

Return the current journal mode.

func Xsqlite3PagerIsMemdb

func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32

Return true if this is an in-memory or temp-file backed pager.

func Xsqlite3PagerJournalname

func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr

Return the full pathname of the journal file.

func Xsqlite3PagerJrnlFile

func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr

Return the file handle for the journal file (if it exists). This will be either the rollback journal or the WAL file.

func Xsqlite3PagerLockingMode

func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32

Get/set the locking-mode for this pager. Parameter eMode must be one of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or PAGER_LOCKINGMODE_EXCLUSIVE. If the parameter is not _QUERY, then the locking-mode is set to the value specified.

The returned value is either PAGER_LOCKINGMODE_NORMAL or PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated) locking-mode.

func Xsqlite3PagerLookup

func Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr

Acquire a page if it is already in the in-memory cache. Do not read the page from disk. Return a pointer to the page, or 0 if the page is not in cache.

See also sqlite3PagerGet(). The difference between this routine and sqlite3PagerGet() is that _get() will go to the disk and read in the page if the page is not already in cache. This routine returns NULL if the page is not in cache or if a disk I/O error has ever happened.

func Xsqlite3PagerMemUsed

func Xsqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) int32

Return the approximate number of bytes of memory currently used by the pager and its associated cache.

func Xsqlite3PagerMovepage

func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno, isCommit int32) int32

Move the page pPg to location pgno in the file.

There must be no references to the page previously located at pgno (which we call pPgOld) though that page is allowed to be in cache. If the page previously located at pgno is not already in the rollback journal, it is not put there by by this routine.

References to the page pPg remain valid. Updating any meta-data associated with pPg (i.e. data stored in the nExtra bytes allocated along with the page) is the responsibility of the caller.

A transaction must be active when this routine is called. It used to be required that a statement transaction was not active, but this restriction has been removed (CREATE INDEX needs to move a page when a statement transaction is active).

If the fourth argument, isCommit, is non-zero, then this page is being moved as part of a database reorganization just before the transaction is being committed. In this case, it is guaranteed that the database page pPg refers to will not be written to again within this transaction.

This function may return SQLITE_NOMEM or an IO error code if an error occurs. Otherwise, it returns SQLITE_OK.

func Xsqlite3PagerOkToChangeJournalMode

func Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32

Return TRUE if the pager is in a state where it is OK to change the journalmode. Journalmode changes can only happen when the database is unmodified.

func Xsqlite3PagerOpen

func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) int32

Allocate and initialize a new Pager object and put a pointer to it in *ppPager. The pager should eventually be freed by passing it to sqlite3PagerClose().

The zFilename argument is the path to the database file to open. If zFilename is NULL then a randomly-named temporary file is created and used as the file to be cached. Temporary files are be deleted automatically when they are closed. If zFilename is ":memory:" then all information is held in cache. It is never written to disk. This can be used to implement an in-memory database.

The nExtra parameter specifies the number of bytes of space allocated along with each page reference. This space is available to the user via the sqlite3PagerGetExtra() API. When a new page is allocated, the first 8 bytes of this space are zeroed but the remainder is uninitialized. (The extra space is used by btree as the MemPage object.)

The flags argument is used to specify properties that affect the operation of the pager. It should be passed some bitwise combination of the PAGER_* flags.

The vfsFlags parameter is a bitmask to pass to the flags parameter of the xOpen() method of the supplied VFS when opening files.

If the pager object is allocated and the specified file opened successfully, SQLITE_OK is returned and *ppPager set to point to the new pager object. If an error occurs, *ppPager is set to NULL and error code returned. This function may return SQLITE_NOMEM (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or various SQLITE_IO_XXX errors.

func Xsqlite3PagerOpenSavepoint

func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32

func Xsqlite3PagerOpenWal

func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32

The caller must be holding a SHARED lock on the database file to call this function.

If the pager passed as the first argument is open on a real database file (not a temp file or an in-memory database), and the WAL file is not already open, make an attempt to open it now. If successful, return SQLITE_OK. If an error occurs or the VFS used by the pager does not support the xShmXXX() methods, return an error code. *pbOpen is not modified in either case.

If the pager is open on a temp-file (or in-memory database), or if the WAL file is already open, set *pbOpen to 1 and return SQLITE_OK without doing anything.

func Xsqlite3PagerPageRefcount

func Xsqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) int32

Return the number of references to the specified page.

func Xsqlite3PagerPagecount

func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr)

This function may only be called when a read-transaction is open on the pager. It returns the total number of pages in the database.

However, if the file is between 1 and <page-size> bytes in size, then this is considered a 1 page file.

func Xsqlite3PagerReadFileheader

func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest uintptr) int32

Read the first N bytes from the beginning of the file into memory that pDest points to.

If the pager was opened on a transient file (zFilename==""), or opened on a file less than N bytes in size, the output buffer is zeroed and SQLITE_OK returned. The rationale for this is that this function is used to read database headers, and a new transient or zero sized database has a header than consists entirely of zeroes.

If any IO error apart from SQLITE_IOERR_SHORT_READ is encountered, the error code is returned to the caller and the contents of the output buffer undefined.

func Xsqlite3PagerRef

func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr)

Increment the reference count for page pPg.

func Xsqlite3PagerRekey

func Xsqlite3PagerRekey(tls *libc.TLS, pPg uintptr, iNew Pgno, flags U16)

The page handle passed as the first argument refers to a dirty page with a page number other than iNew. This function changes the page's page number to iNew and sets the value of the PgHdr.flags field to the value passed as the third parameter.

func Xsqlite3PagerRollback

func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32

If a write transaction is open, then all changes made within the transaction are reverted and the current write-transaction is closed. The pager falls back to PAGER_READER state if successful, or PAGER_ERROR state if an error occurs.

If the pager is already in PAGER_ERROR state when this function is called, it returns Pager.errCode immediately. No work is performed in this case.

Otherwise, in rollback mode, this function performs two functions:

  1. It rolls back the journal file, restoring all database file and in-memory cache pages to the state they were in when the transaction was opened, and

  2. It finalizes the journal file, so that it is not used for hot rollback at any point in the future.

Finalization of the journal file (task 2) is only performed if the rollback is successful.

In WAL mode, all cache-entries containing data modified within the current transaction are either expelled from the cache or reverted to their pre-transaction state by re-reading data from the database or WAL files. The WAL transaction is then closed.

func Xsqlite3PagerSavepoint

func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint int32) int32

This function is called to rollback or release (commit) a savepoint. The savepoint to release or rollback need not be the most recently created savepoint.

Parameter op is always either SAVEPOINT_ROLLBACK or SAVEPOINT_RELEASE. If it is SAVEPOINT_RELEASE, then release and destroy the savepoint with index iSavepoint. If it is SAVEPOINT_ROLLBACK, then rollback all changes that have occurred since the specified savepoint was created.

The savepoint to rollback or release is identified by parameter iSavepoint. A value of 0 means to operate on the outermost savepoint (the first created). A value of (Pager.nSavepoint-1) means operate on the most recently created savepoint. If iSavepoint is greater than (Pager.nSavepoint-1), then this function is a no-op.

If a negative value is passed to this function, then the current transaction is rolled back. This is different to calling sqlite3PagerRollback() because this function does not terminate the transaction or unlock the database, it just restores the contents of the database to its original state.

In any case, all savepoints with an index greater than iSavepoint are destroyed. If this is a release operation (op==SAVEPOINT_RELEASE), then savepoint iSavepoint is also destroyed.

This function may return SQLITE_NOMEM if a memory allocation fails, or an IO error code if an IO error occurs while rolling back a savepoint. If no errors occur, SQLITE_OK is returned.

func Xsqlite3PagerSetBusyHandler

func Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr)

Set the busy handler function.

The pager invokes the busy-handler if sqlite3OsLock() returns SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock, or when trying to upgrade from a RESERVED lock to an EXCLUSIVE lock. It does *not* invoke the busy handler when upgrading from SHARED to RESERVED, or when upgrading from SHARED to EXCLUSIVE (which occurs during hot-journal rollback). Summary:

Transition                        | Invokes xBusyHandler
--------------------------------------------------------
NO_LOCK       -> SHARED_LOCK      | Yes
SHARED_LOCK   -> RESERVED_LOCK    | No
SHARED_LOCK   -> EXCLUSIVE_LOCK   | No
RESERVED_LOCK -> EXCLUSIVE_LOCK   | Yes

If the busy-handler callback returns non-zero, the lock is retried. If it returns zero, then the SQLITE_BUSY error is returned to the caller of the pager API function.

func Xsqlite3PagerSetCachesize

func Xsqlite3PagerSetCachesize(tls *libc.TLS, pPager uintptr, mxPage int32)

Change the maximum number of in-memory pages that are allowed before attempting to recycle clean and unused pages.

func Xsqlite3PagerSetFlags

func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32)

Adjust settings of the pager to those specified in the pgFlags parameter.

The "level" in pgFlags & PAGER_SYNCHRONOUS_MASK sets the robustness of the database to damage due to OS crashes or power failures by changing the number of syncs()s when writing the journals. There are four levels:

OFF       sqlite3OsSync() is never called.  This is the default
          for temporary and transient files.

NORMAL    The journal is synced once before writes begin on the
          database.  This is normally adequate protection, but
          it is theoretically possible, though very unlikely,
          that an inopertune power failure could leave the journal
          in a state which would cause damage to the database
          when it is rolled back.

FULL      The journal is synced twice before writes begin on the
          database (with some additional information - the nRec field
          of the journal header - being written in between the two
          syncs).  If we assume that writing a
          single disk sector is atomic, then this mode provides
          assurance that the journal will not be corrupted to the
          point of causing damage to the database during rollback.

EXTRA     This is like FULL except that is also syncs the directory
          that contains the rollback journal after the rollback
          journal is unlinked.

The above is for a rollback-journal mode. For WAL mode, OFF continues to mean that no syncs ever occur. NORMAL means that the WAL is synced prior to the start of checkpoint and that the database file is synced at the conclusion of the checkpoint if the entire content of the WAL was written back into the database. But no sync operations occur for an ordinary commit in NORMAL mode with WAL. FULL means that the WAL file is synced following each commit operation, in addition to the syncs associated with NORMAL. There is no difference between FULL and EXTRA for WAL mode.

Do not confuse synchronous=FULL with SQLITE_SYNC_FULL. The SQLITE_SYNC_FULL macro means to use the MacOSX-style full-fsync using fcntl(F_FULLFSYNC). SQLITE_SYNC_NORMAL means to do an ordinary fsync() call. There is no difference between SQLITE_SYNC_FULL and SQLITE_SYNC_NORMAL on platforms other than MacOSX. But the synchronous=FULL versus synchronous=NORMAL setting determines when the xSync primitive is called and is relevant to all platforms.

Numeric values associated with these states are OFF==1, NORMAL=2, and FULL=3.

func Xsqlite3PagerSetJournalMode

func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int32

Set the journal-mode for this pager. Parameter eMode must be one of:

PAGER_JOURNALMODE_DELETE
PAGER_JOURNALMODE_TRUNCATE
PAGER_JOURNALMODE_PERSIST
PAGER_JOURNALMODE_OFF
PAGER_JOURNALMODE_MEMORY
PAGER_JOURNALMODE_WAL

The journalmode is set to the value specified if the change is allowed. The change may be disallowed for the following reasons:

  • An in-memory database can only have its journal_mode set to _OFF or _MEMORY.

  • Temporary databases cannot have _WAL journalmode.

The returned indicate the current (possibly updated) journal-mode.

func Xsqlite3PagerSetMmapLimit

func Xsqlite3PagerSetMmapLimit(tls *libc.TLS, pPager uintptr, szMmap Sqlite3_int64)

Change the maximum size of any memory mapping made of the database file.

func Xsqlite3PagerSetPagesize

func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, nReserve int32) int32

Change the page size used by the Pager object. The new page size is passed in *pPageSize.

If the pager is in the error state when this function is called, it is a no-op. The value returned is the error state error code (i.e. one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL).

Otherwise, if all of the following are true:

  • the new page size (value of *pPageSize) is valid (a power of two between 512 and SQLITE_MAX_PAGE_SIZE, inclusive), and

  • there are no outstanding page references, and

  • the database is either not an in-memory database or it is an in-memory database that currently consists of zero pages.

then the pager object page size is set to *pPageSize.

If the page size is changed, then this function uses sqlite3PagerMalloc() to obtain a new Pager.pTmpSpace buffer. If this allocation attempt fails, SQLITE_NOMEM is returned and the page size remains unchanged. In all other cases, SQLITE_OK is returned.

If the page size is not changed, either because one of the enumerated conditions above is not true, the pager was in error state when this function was called, or because the memory allocation attempt failed, then *pPageSize is set to the old, retained page size before returning.

func Xsqlite3PagerSetSpillsize

func Xsqlite3PagerSetSpillsize(tls *libc.TLS, pPager uintptr, mxPage int32) int32

Change the maximum number of in-memory pages that are allowed before attempting to spill pages to journal.

func Xsqlite3PagerSharedLock

func Xsqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) int32

This function is called to obtain a shared lock on the database file. It is illegal to call sqlite3PagerGet() until after this function has been successfully called. If a shared-lock is already held when this function is called, it is a no-op.

The following operations are also performed by this function.

  1. If the pager is currently in PAGER_OPEN state (no lock held on the database file), then an attempt is made to obtain a SHARED lock on the database file. Immediately after obtaining the SHARED lock, the file-system is checked for a hot-journal, which is played back if present. Following any hot-journal rollback, the contents of the cache are validated by checking the 'change-counter' field of the database file header and discarded if they are found to be invalid.

  2. If the pager is running in exclusive-mode, and there are currently no outstanding references to any pages, and is in the error state, then an attempt is made to clear the error state by discarding the contents of the page cache and rolling back any open journal file.

If everything is successful, SQLITE_OK is returned. If an IO error occurs while locking the database, checking for a hot-journal file or rolling back a journal file, the IO error code is returned.

func Xsqlite3PagerShrink

func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr)

Free as much memory as possible from the pager.

func Xsqlite3PagerSnapshotCheck

func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32

The caller currently has a read transaction open on the database. If this is not a WAL database, SQLITE_ERROR is returned. Otherwise, this function takes a SHARED lock on the CHECKPOINTER slot and then checks if the snapshot passed as the second argument is still available. If so, SQLITE_OK is returned.

If the snapshot is not available, SQLITE_ERROR is returned. Or, if the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER lock is released before returning.

func Xsqlite3PagerSnapshotGet

func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr) int32

If this is a WAL database, obtain a snapshot handle for the snapshot currently open. Otherwise, return an error.

func Xsqlite3PagerSnapshotOpen

func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32

If this is a WAL database, store a pointer to pSnapshot. Next time a read transaction is opened, attempt to read from the snapshot it identifies. If this is not a WAL database, return an error.

func Xsqlite3PagerSnapshotRecover

func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32

If this is a WAL database, call sqlite3WalSnapshotRecover(). If this is not a WAL database, return an error.

func Xsqlite3PagerSnapshotUnlock

func Xsqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr)

Release a lock obtained by an earlier successful call to sqlite3PagerSnapshotCheck().

func Xsqlite3PagerStats

func Xsqlite3PagerStats(tls *libc.TLS, pPager uintptr) uintptr

This routine is used for testing and analysis only.

func Xsqlite3PagerSync

func Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32

Sync the database file to disk. This is a no-op for in-memory databases or pages with the Pager.noSync flag set.

If successful, or if called on a pager for which it is a no-op, this function returns SQLITE_OK. Otherwise, an IO error code is returned.

func Xsqlite3PagerTempSpace

func Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr

Return a pointer to the "temporary page" buffer held internally by the pager. This is a buffer that is big enough to hold the entire content of a database page. This buffer is used internally during rollback and will be overwritten whenever a rollback occurs. But other modules are free to use it too, as long as no rollbacks are happening.

func Xsqlite3PagerTruncateImage

func Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno)

Truncate the in-memory database file image to nPage pages. This function does not actually modify the database file on disk. It just sets the internal state of the pager object so that the truncation will be done when the current transaction is committed.

This function is only called right before committing a transaction. Once this function has been called, the transaction must either be rolled back or committed. It is not safe to call this function and then continue writing to the database.

func Xsqlite3PagerUnref

func Xsqlite3PagerUnref(tls *libc.TLS, pPg uintptr)

func Xsqlite3PagerUnrefNotNull

func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr)

Release a page reference.

The sqlite3PagerUnref() and sqlite3PagerUnrefNotNull() may only be used if we know that the page being released is not the last page. The btree layer always holds page1 open until the end, so these first to routines can be used to release any page other than BtShared.pPage1.

Use sqlite3PagerUnrefPageOne() to release page1. This latter routine checks the total number of outstanding pages and if the number of pages reaches zero it drops the database lock.

func Xsqlite3PagerUnrefPageOne

func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr)

func Xsqlite3PagerVfs

func Xsqlite3PagerVfs(tls *libc.TLS, pPager uintptr) uintptr

Return the VFS structure for the pager.

func Xsqlite3PagerWalCallback

func Xsqlite3PagerWalCallback(tls *libc.TLS, pPager uintptr) int32

func Xsqlite3PagerWalSupported

func Xsqlite3PagerWalSupported(tls *libc.TLS, pPager uintptr) int32

Return true if the underlying VFS for the given pager supports the primitives necessary for write-ahead logging.

func Xsqlite3PagerWrite

func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32

Mark a data page as writeable. This routine must be called before making changes to a page. The caller must check the return value of this function and be careful not to change any page data unless this routine returns SQLITE_OK.

The difference between this function and pager_write() is that this function also deals with the special case where 2 or more pages fit on a single disk sector. In this case all co-resident pages must have been written to the journal file before returning.

If an error occurs, SQLITE_NOMEM or an IO error code is returned as appropriate. Otherwise, SQLITE_OK.

func Xsqlite3ParseUri

func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags uintptr, ppVfs uintptr, pzFile uintptr, pzErrMsg uintptr) int32

This function is used to parse both URIs and non-URI filenames passed by the user to API functions sqlite3_open() or sqlite3_open_v2(), and for database URIs specified as part of ATTACH statements.

The first argument to this function is the name of the VFS to use (or a NULL to signify the default VFS) if the URI does not contain a "vfs=xxx" query parameter. The second argument contains the URI (or non-URI filename) itself. When this function is called the *pFlags variable should contain the default flags to open the database handle with. The value stored in *pFlags may be updated before returning if the URI filename contains "cache=xxx" or "mode=xxx" query parameters.

If successful, SQLITE_OK is returned. In this case *ppVfs is set to point to the VFS that should be used to open the database file. *pzFile is set to point to a buffer containing the name of the file to open. The value stored in *pzFile is a database name acceptable to sqlite3_uri_parameter() and is in the same format as names created using sqlite3_create_filename(). The caller must invoke sqlite3_free_filename() (not sqlite3_free()!) on the value returned in *pzFile to avoid a memory leak.

If an error occurs, then an SQLite error code is returned and *pzErrMsg may be set to point to a buffer containing an English language error message. It is the responsibility of the caller to eventually release this buffer by calling sqlite3_free().

func Xsqlite3Parser

func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token)

The main parser program. The first argument is a pointer to a structure obtained from "sqlite3ParserAlloc" which describes the current state of the parser. The second argument is the major token number. The third is the minor token. The fourth optional argument is whatever the user wants (and specified in the grammar) and is available for use by the action routines.

Inputs: <ul> <li> A pointer to the parser (an opaque structure.) <li> The major token number. <li> The minor token number. <li> An option argument of a grammar-specified type. </ul>

Outputs: None.

func Xsqlite3ParserAddCleanup

func Xsqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) uintptr

Add a new cleanup operation to a Parser. The cleanup should happen when the parser object is destroyed. But, beware: the cleanup might happen immediately.

Use this mechanism for uncommon cleanups. There is a higher setup cost for this mechansim (an extra malloc), so it should not be used for common cleanups that happen on most calls. But for less common cleanups, we save a single NULL-pointer comparison in sqlite3ParserReset(), which reduces the total CPU cycle count.

If a memory allocation error occurs, then the cleanup happens immediately. When either SQLITE_DEBUG or SQLITE_COVERAGE_TEST are defined, the pParse->earlyCleanup flag is set in that case. Calling code show verify that test cases exist for which this happens, to guard against possible use-after-free errors following an OOM. The preferred way to do this is to immediately follow the call to this routine with:

testcase( pParse->earlyCleanup );

This routine returns a copy of its pPtr input (the third parameter) except if an early cleanup occurs, in which case it returns NULL. So another way to check for early cleanup is to check the return value. Or, stop using the pPtr parameter with this call and use only its return value thereafter. Something like this:

pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj);

func Xsqlite3ParserFallback

func Xsqlite3ParserFallback(tls *libc.TLS, iToken int32) int32

Return the fallback token corresponding to canonical token iToken, or 0 if iToken has no fallback.

func Xsqlite3ParserFinalize

func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr)

Clear all secondary memory allocations from the parser

func Xsqlite3ParserInit

func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr)

Initialize a new parser that has already been allocated.

func Xsqlite3ParserReset

func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr)

Free all memory allocations in the pParse object

func Xsqlite3Pcache1Mutex

func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr

Return the global mutex used by this PCACHE implementation. The sqlite3_status() routine needs access to this mutex.

func Xsqlite3PcacheCleanAll

func Xsqlite3PcacheCleanAll(tls *libc.TLS, pCache uintptr)

Make every page in the cache clean.

func Xsqlite3PcacheClear

func Xsqlite3PcacheClear(tls *libc.TLS, pCache uintptr)

Discard the contents of the cache.

func Xsqlite3PcacheClearSyncFlags

func Xsqlite3PcacheClearSyncFlags(tls *libc.TLS, pCache uintptr)

Clear the PGHDR_NEED_SYNC flag from all dirty pages.

func Xsqlite3PcacheClearWritable

func Xsqlite3PcacheClearWritable(tls *libc.TLS, pCache uintptr)

Clear the PGHDR_NEED_SYNC and PGHDR_WRITEABLE flag from all dirty pages.

func Xsqlite3PcacheClose

func Xsqlite3PcacheClose(tls *libc.TLS, pCache uintptr)

Close a cache.

func Xsqlite3PcacheDirtyList

func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr

Return a list of all dirty pages in the cache, sorted by page number.

func Xsqlite3PcacheDrop

func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr)

Drop a page from the cache. There must be exactly one reference to the page. This function deletes that reference, so after it returns the page pointed to by p is invalid.

func Xsqlite3PcacheFetch

func Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag int32) uintptr

Try to obtain a page from the cache.

This routine returns a pointer to an sqlite3_pcache_page object if such an object is already in cache, or if a new one is created. This routine returns a NULL pointer if the object was not in cache and could not be created.

The createFlags should be 0 to check for existing pages and should be 3 (not 1, but 3) to try to create a new page.

If the createFlag is 0, then NULL is always returned if the page is not already in the cache. If createFlag is 1, then a new page is created only if that can be done without spilling dirty pages and without exceeding the cache size limit.

The caller needs to invoke sqlite3PcacheFetchFinish() to properly initialize the sqlite3_pcache_page object and convert it into a PgHdr object. The sqlite3PcacheFetch() and sqlite3PcacheFetchFinish() routines are split this way for performance reasons. When separated they can both (usually) operate without having to push values to the stack on entry and pop them back off on exit, which saves a lot of pushing and popping.

func Xsqlite3PcacheFetchFinish

func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr

This routine converts the sqlite3_pcache_page object returned by sqlite3PcacheFetch() into an initialized PgHdr object. This routine must be called after sqlite3PcacheFetch() in order to get a usable result.

func Xsqlite3PcacheFetchStress

func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage uintptr) int32

If the sqlite3PcacheFetch() routine is unable to allocate a new page because no clean pages are available for reuse and the cache size limit has been reached, then this routine can be invoked to try harder to allocate a page. This routine might invoke the stress callback to spill dirty pages to the journal. It will then try to allocate the new page and will only fail to allocate a new page on an OOM error.

This routine should be invoked only after sqlite3PcacheFetch() fails.

func Xsqlite3PcacheGetCachesize

func Xsqlite3PcacheGetCachesize(tls *libc.TLS, pCache uintptr) int32

Get the suggested cache-size value.

func Xsqlite3PcacheInitialize

func Xsqlite3PcacheInitialize(tls *libc.TLS) int32

************************************************** General Interfaces ******

Initialize and shutdown the page cache subsystem. Neither of these functions are threadsafe.

func Xsqlite3PcacheMakeClean

func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr)

Make sure the page is marked as clean. If it isn't clean already, make it so.

func Xsqlite3PcacheMakeDirty

func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr)

Make sure the page is marked as dirty. If it isn't dirty already, make it so.

func Xsqlite3PcacheMove

func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno)

Change the page number of page p to newPgno.

func Xsqlite3PcacheOpen

func Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) int32

Create a new PCache object. Storage space to hold the object has already been allocated and is passed in as the p pointer. The caller discovers how much space needs to be allocated by calling sqlite3PcacheSize().

szExtra is some extra space allocated for each page. The first 8 bytes of the extra space will be zeroed as the page is allocated, but remaining content will be uninitialized. Though it is opaque to this module, the extra space really ends up being the MemPage structure in the pager.

func Xsqlite3PcachePageRefcount

func Xsqlite3PcachePageRefcount(tls *libc.TLS, p uintptr) int32

Return the number of references to the page supplied as an argument.

func Xsqlite3PcachePagecount

func Xsqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) int32

Return the total number of pages in the cache.

func Xsqlite3PcacheRef

func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr)

Increase the reference count of a supplied page by 1.

func Xsqlite3PcacheRefCount

func Xsqlite3PcacheRefCount(tls *libc.TLS, pCache uintptr) int32

Return the total number of references to all pages held by the cache.

This is not the total number of pages referenced, but the sum of the reference count for all pages.

func Xsqlite3PcacheRelease

func Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr)

Decrement the reference count on a page. If the page is clean and the reference count drops to 0, then it is made eligible for recycling.

func Xsqlite3PcacheReleaseMemory

func Xsqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) int32

This function is called to free superfluous dynamically allocated memory held by the pager system. Memory in use by any SQLite pager allocated by the current thread may be sqlite3_free()ed.

nReq is the number of bytes of memory required. Once this much has been released, the function returns. The return value is the total number of bytes of memory released.

func Xsqlite3PcacheSetCachesize

func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32)

Set the suggested cache-size value.

func Xsqlite3PcacheSetPageSize

func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int32

Change the page size for PCache object. The caller must ensure that there are no outstanding page references when this function is called.

func Xsqlite3PcacheSetSpillsize

func Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32

Set the suggested cache-spill value. Make no changes if if the argument is zero. Return the effective cache-spill size, which will be the larger of the szSpill and szCache.

func Xsqlite3PcacheShrink

func Xsqlite3PcacheShrink(tls *libc.TLS, pCache uintptr)

Free up as much memory as possible from the page cache.

func Xsqlite3PcacheShutdown

func Xsqlite3PcacheShutdown(tls *libc.TLS)

func Xsqlite3PcacheSize

func Xsqlite3PcacheSize(tls *libc.TLS) int32

Return the size in bytes of a PCache object.

func Xsqlite3PcacheStats

func Xsqlite3PcacheStats(tls *libc.TLS, pnCurrent uintptr, pnMax uintptr, pnMin uintptr, pnRecyclable uintptr)

This function is used by test procedures to inspect the internal state of the global cache.

func Xsqlite3PcacheTruncate

func Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno)

Drop every cache entry whose page number is greater than "pgno". The caller must ensure that there are no outstanding references to any pages other than page 1 with a page number greater than pgno.

If there is a reference to page 1 and the pgno parameter passed to this function is 0, then the data area associated with page 1 is zeroed, but the page object is not dropped.

func Xsqlite3Pragma

func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pValue uintptr, minusFlag int32)

Process a pragma statement.

Pragmas are of this form:

PRAGMA [schema.]id [= value]

The identifier might also be a string. The value is a string, and identifier, or a number. If minusFlag is true, then the value is a number that was preceded by a minus sign.

If the left side is "database.id" then pId1 is the database name and pId2 is the id. If the left side is just "id" then pId1 is the id and pId2 is any empty string.

func Xsqlite3PragmaVtabRegister

func Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintptr

Check to see if zTabName is really the name of a pragma. If it is, then register an eponymous virtual table for that pragma and return a pointer to the Module object for the new virtual table.

func Xsqlite3PrimaryKeyIndex

func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr

Return the PRIMARY KEY index of a table

func Xsqlite3PrngRestoreState

func Xsqlite3PrngRestoreState(tls *libc.TLS)

func Xsqlite3PrngSaveState

func Xsqlite3PrngSaveState(tls *libc.TLS)

func Xsqlite3Put4byte

func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32)

func Xsqlite3PutVarint

func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32

func Xsqlite3ReadOnlyShadowTables

func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32

Return TRUE if shadow tables should be read-only in the current context.

func Xsqlite3ReadSchema

func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32

This routine is a no-op if the database schema is already initialized. Otherwise, the schema is loaded. An error code is returned.

func Xsqlite3RealSameAsInt

func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32

Compare a floating point value to an integer. Return true if the two values are the same within the precision of the floating point value.

This function assumes that i was obtained by assignment from r1.

For some versions of GCC on 32-bit machines, if you do the more obvious comparison of "r1==(double)i" you sometimes get an answer of false even though the r1 and (double)i values are bit-for-bit the same.

func Xsqlite3Realloc

func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr

Change the size of an existing memory allocation

func Xsqlite3RegisterBuiltinFunctions

func Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS)

All of the FuncDef structures in the aBuiltinFunc[] array above to the global function hash table. This occurs at start-time (as a consequence of calling sqlite3_initialize()).

After this routine runs

func Xsqlite3RegisterDateTimeFunctions

func Xsqlite3RegisterDateTimeFunctions(tls *libc.TLS)

This function registered all of the above C functions as SQL functions. This should be the only routine in this file with external linkage.

func Xsqlite3RegisterLikeFunctions

func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int32)

Re-register the built-in LIKE functions. The caseSensitive parameter determines whether or not the LIKE operator is case sensitive.

func Xsqlite3RegisterPerConnectionBuiltinFunctions

func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr)

This routine does per-connection function registration. Most of the built-in functions above are part of the global function set. This routine only deals with those that are not global.

func Xsqlite3Reindex

func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr)

Generate code for the REINDEX command.

REINDEX                            -- 1
REINDEX  <collation>               -- 2
REINDEX  ?<database>.?<tablename>  -- 3
REINDEX  ?<database>.?<indexname>  -- 4

Form 1 causes all indices in all attached databases to be rebuilt. Form 2 rebuilds all indices in all databases that use the named collating function. Forms 3 and 4 rebuild the named index or all indices associated with the named table.

func Xsqlite3ReleaseTempRange

func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32)

func Xsqlite3ReleaseTempReg

func Xsqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32)

Deallocate a register, making available for reuse for some other purpose.

func Xsqlite3RenameExprUnmap

func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr)

Remove all nodes that are part of expression pExpr from the rename list.

func Xsqlite3RenameExprlistUnmap

func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr)

Remove all nodes that are part of expression-list pEList from the rename list.

func Xsqlite3RenameTokenMap

func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken uintptr) uintptr

Remember that the parser tree element pPtr was created using the token pToken.

In other words, construct a new RenameToken object and add it to the list of RenameToken objects currently being built up in pParse->pRename.

The pPtr argument is returned so that this routine can be used with tail recursion in tokenExpr() routine, for a small performance improvement.

func Xsqlite3RenameTokenRemap

func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom uintptr)

It is assumed that there is already a RenameToken object associated with parse tree element pFrom. This function remaps the associated token to parse tree element pTo.

func Xsqlite3ReportError

func Xsqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) int32

The following routines are substitutes for constants SQLITE_CORRUPT, SQLITE_MISUSE, SQLITE_CANTOPEN, SQLITE_NOMEM and possibly other error constants. They serve two purposes:

  1. Serve as a convenient place to set a breakpoint in a debugger to detect when version error conditions occurs.

  2. Invoke sqlite3_log() to provide the source code location where a low-level error is first detected.

func Xsqlite3Reprepare

func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32

Rerun the compilation of a statement after a schema change.

If the statement is successfully recompiled, return SQLITE_OK. Otherwise, if the statement cannot be recompiled because another connection has locked the sqlite3_schema table, return SQLITE_LOCKED. If any other error occurs, return SQLITE_SCHEMA.

func Xsqlite3ResetAllSchemasOfConnection

func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr)

Erase all schema information from all attached databases (including "main" and "temp") for a single database connection.

func Xsqlite3ResetOneSchema

func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32)

Reset the schema for the database at index iDb. Also reset the TEMP schema. The reset is deferred if db->nSchemaLock is not zero. Deferred resets may be run by calling with iDb<0.

func Xsqlite3ResolveExprListNames

func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int32

Resolve all names for all expression in an expression list. This is just like sqlite3ResolveExprNames() except that it works for an expression list rather than a single expression.

func Xsqlite3ResolveExprNames

func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32

This routine walks an expression tree and resolves references to table columns and result-set columns. At the same time, do error checking on function usage and set a flag if any aggregate functions are seen.

To resolve table columns references we look for nodes (or subtrees) of the form X.Y.Z or Y.Z or just Z where

X:   The name of a database.  Ex:  "main" or "temp" or
     the symbolic name assigned to an ATTACH-ed database.

Y:   The name of a table in a FROM clause.  Or in a trigger
     one of the special names "old" or "new".

Z:   The name of a column in table Y.

The node at the root of the subtree is modified as follows:

Expr.op        Changed to TK_COLUMN
Expr.pTab      Points to the Table object for X.Y
Expr.iColumn   The column index in X.Y.  -1 for the rowid.
Expr.iTable    The VDBE cursor number for X.Y

To resolve result-set references, look for expression nodes of the form Z (with no X and Y prefix) where the Z matches the right-hand size of an AS clause in the result-set of a SELECT. The Z expression is replaced by a copy of the left-hand side of the result-set expression. Table-name and function resolution occurs on the substituted expression tree. For example, in:

SELECT a+b AS x, c+d AS y FROM t1 ORDER BY x;

The "x" term of the order by is replaced by "a+b" to render:

SELECT a+b AS x, c+d AS y FROM t1 ORDER BY a+b;

Function calls are checked to make sure that the function is defined and that the correct number of arguments are specified. If the function is an aggregate function, then the NC_HasAgg flag is set and the opcode is changed from TK_FUNCTION to TK_AGG_FUNCTION. If an expression contains aggregate functions then the EP_Agg property on the expression is set.

An error message is left in pParse if anything is amiss. The number if errors is returned.

func Xsqlite3ResolveOrderGroupBy

func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32

Check every term in the ORDER BY or GROUP BY clause pOrderBy of the SELECT statement pSelect. If any term is reference to a result set expression (as determined by the ExprList.a.u.x.iOrderByCol field) then convert that term into a copy of the corresponding result set column.

If any errors are detected, add an error message to pParse and return non-zero. Return zero if no errors are seen.

func Xsqlite3ResolvePartIdxLabel

func Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32)

If a prior call to sqlite3GenerateIndexKey() generated a jump-over label because it was a partial index, then this routine should be called to resolve that label.

func Xsqlite3ResolveSelectNames

func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr)

Resolve all names in all expressions of a SELECT and in all decendents of the SELECT, including compounds off of p->pPrior, subqueries in expressions, and subqueries used as FROM clause terms.

See sqlite3ResolveExprNames() for a description of the kinds of transformations that occur.

All SELECT statements should have been expanded using sqlite3SelectExpand() prior to invoking this routine.

func Xsqlite3ResolveSelfReference

func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) int32

Resolve names in expressions that can only reference a single table or which cannot reference any tables at all. Examples:

                                                "type" flag
                                                ------------
(1)   CHECK constraints                         NC_IsCheck
(2)   WHERE clauses on partial indices          NC_PartIdx
(3)   Expressions in indexes on expressions     NC_IdxExpr
(4)   Expression arguments to VACUUM INTO.      0
(5)   GENERATED ALWAYS as expressions           NC_GenCol

In all cases except (4), the Expr.iTable value for Expr.op==TK_COLUMN nodes of the expression is set to -1 and the Expr.iColumn value is set to the column number. In case (4), TK_COLUMN nodes cause an error.

Any errors cause an error message to be set in pParse.

func Xsqlite3ResultIntReal

func Xsqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr)

Force the INT64 value currently stored as the result to be a MEM_IntReal value. See the SQLITE_TESTCTRL_RESULT_INTREAL test-control.

func Xsqlite3ResultSetOfSelect

func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, aff int8) uintptr

Given a SELECT statement, generate a Table structure that describes the result set of that SELECT.

func Xsqlite3RollbackAll

func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32)

Rollback all database files. If tripCode is not SQLITE_OK, then any write cursors are invalidated ("tripped" - as in "tripping a circuit breaker") and made to return tripCode if there are any further attempts to use that cursor. Read cursors remain open and valid but are "saved" in case the table pages are moved around.

func Xsqlite3RootPageMoved

func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo Pgno)

This function is called by the VDBE to adjust the internal schema used by SQLite when the btree layer moves a table root page. The root-page of a table or index in database iDb has changed from iFrom to iTo.

Ticket #1728: The symbol table might still contain information on tables and/or indices that are the process of being deleted. If you are unlucky, one of those deleted indices or tables might have the same rootpage number as the real table or index that is being moved. So we cannot stop searching after the first match because the first match might be for one of the deleted indices or tables and not the table/index that is actually being moved. We must continue looping until all tables and indices with rootpage==iFrom have been converted to have a rootpage of iTo in order to be certain that we got the right one.

func Xsqlite3RowSetClear

func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr)

Deallocate all chunks from a RowSet. This frees all memory that the RowSet has allocated over its lifetime. This routine is the destructor for the RowSet.

func Xsqlite3RowSetDelete

func Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr)

Deallocate all chunks from a RowSet. This frees all memory that the RowSet has allocated over its lifetime. This routine is the destructor for the RowSet.

func Xsqlite3RowSetInit

func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr

Allocate a RowSet object. Return NULL if a memory allocation error occurs.

func Xsqlite3RowSetInsert

func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64)

Insert a new value into a RowSet.

The mallocFailed flag of the database connection is set if a memory allocation fails.

func Xsqlite3RowSetNext

func Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32

Extract the smallest element from the RowSet. Write the element into *pRowid. Return 1 on success. Return 0 if the RowSet is already empty.

After this routine has been called, the sqlite3RowSetInsert() routine may not be called again.

This routine may not be called after sqlite3RowSetTest() has been used. Older versions of RowSet allowed that, but as the capability was not used by the code generator, it was removed for code economy.

func Xsqlite3RowSetTest

func Xsqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Sqlite3_int64) int32

Check to see if element iRowid was inserted into the rowset as part of any insert batch prior to iBatch. Return 1 or 0.

If this is the first test of a new batch and if there exist entries on pRowSet->pEntry, then sort those entries into the forest at pRowSet->pForest so that they can be tested.

func Xsqlite3RowidConstraint

func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab uintptr)

Code an OP_Halt due to non-unique rowid.

func Xsqlite3RtreeInit

func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32

Register the r-tree module with database handle db. This creates the virtual table module "rtree" and the debugging/analysis scalar function "rtreenode".

func Xsqlite3RunParser

func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uintptr) int32

Run the parser on the given SQL string. The parser structure is passed in. An SQLITE_ status code is returned. If an error occurs then an and attempt is made to write an error message into memory obtained from sqlite3_malloc() and to make *pzErrMsg point to that error message.

func Xsqlite3RunVacuum

func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pOut uintptr) int32

This routine implements the OP_Vacuum opcode of the VDBE.

func Xsqlite3SafetyCheckOk

func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32

Check to make sure we have a valid db pointer. This test is not foolproof but it does provide some measure of protection against misuse of the interface such as passing in db pointers that are NULL or which have been previously closed. If this routine returns 1 it means that the db pointer is valid and 0 if it should not be dereferenced for any reason. The calling function should invoke SQLITE_MISUSE immediately.

sqlite3SafetyCheckOk() requires that the db pointer be valid for use. sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to open properly and is not fit for general use but which can be used as an argument to sqlite3_errmsg() or sqlite3_close().

func Xsqlite3SafetyCheckSickOrOk

func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32

func Xsqlite3Savepoint

func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr)

This function is called by the parser when it parses a command to create, release or rollback an SQL savepoint.

func Xsqlite3SchemaClear

func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr)

Free all resources held by the schema structure. The void* argument points at a Schema struct. This function does not call sqlite3DbFree(db, ) on the pointer itself, it just cleans up subsidiary resources (i.e. the contents of the schema hash tables).

The Schema.cache_size variable is not cleared.

func Xsqlite3SchemaGet

func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr

Find and return the schema associated with a BTree. Create a new one if necessary.

func Xsqlite3SchemaToIndex

func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32

Convert a schema pointer into the iDb index that indicates which database file in db->aDb[] the schema refers to.

If the same database is attached more than once, the first attached database is returned.

func Xsqlite3SectorSize

func Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32

Return a sanitized version of the sector-size of OS file pFile. The return value is guaranteed to lie between 32 and MAX_SECTOR_SIZE.

func Xsqlite3Select

func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32

Generate code for the SELECT statement given in the p argument.

The results are returned according to the SelectDest structure. See comments in sqliteInt.h for further information.

This routine returns the number of errors. If any errors are encountered, then an appropriate error message is left in pParse->zErrMsg.

This routine does NOT free the Select structure passed in. The calling function needs to do that.

func Xsqlite3SelectAddColumnTypeAndCollation

func Xsqlite3SelectAddColumnTypeAndCollation(tls *libc.TLS, pParse uintptr, pTab uintptr, pSelect uintptr, aff int8)

Add type and collation information to a column list based on a SELECT statement.

The column list presumably came from selectColumnNamesFromExprList(). The column list has only names, not types or collations. This routine goes through and adds the types and collations.

This routine requires that all identifiers in the SELECT statement be resolved.

func Xsqlite3SelectDelete

func Xsqlite3SelectDelete(tls *libc.TLS, db uintptr, p uintptr)

Delete the given Select structure and all of its substructures.

func Xsqlite3SelectDestInit

func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int32)

Initialize a SelectDest structure.

func Xsqlite3SelectDup

func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uintptr

func Xsqlite3SelectExprHeight

func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32

Return the maximum height of any expression tree referenced by the select statement passed as an argument.

func Xsqlite3SelectNew

func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintptr, pWhere uintptr, pGroupBy uintptr, pHaving uintptr, pOrderBy uintptr, selFlags U32, pLimit uintptr) uintptr

Allocate a new Select structure and return a pointer to that structure.

func Xsqlite3SelectOpName

func Xsqlite3SelectOpName(tls *libc.TLS, id int32) uintptr

Name of the connection operator, used for error messages.

func Xsqlite3SelectPopWith

func Xsqlite3SelectPopWith(tls *libc.TLS, pWalker uintptr, p uintptr)

If the SELECT passed as the second argument has an associated WITH clause, pop it from the stack stored as part of the Parse object.

This function is used as the xSelectCallback2() callback by sqlite3SelectExpand() when walking a SELECT tree to resolve table names and other FROM clause elements.

func Xsqlite3SelectPrep

func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr)

This routine sets up a SELECT statement for processing. The following is accomplished:

  • VDBE Cursor numbers are assigned to all FROM-clause terms.
  • Ephemeral Table objects are created for all FROM-clause subqueries.
  • ON and USING clauses are shifted into WHERE statements
  • Wildcards "*" and "TABLE.*" in result sets are expanded.
  • Identifiers in expression are matched to tables.

This routine acts recursively on all subqueries within the SELECT.

func Xsqlite3SelectWalkFail

func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int32

This is a SELECT-node callback for the expression walker that always "fails". By "fail" in this case, we mean set pWalker->eCode to zero and abort.

This callback is used by multiple expression walkers.

func Xsqlite3SelectWalkNoop

func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32

No-op routine for the parse-tree walker for SELECT statements. subquery in the parser tree.

func Xsqlite3SelectWrongNumTermsError

func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr)

Error message for when two or more terms of a compound select have different size result sets.

func Xsqlite3SetJoinExpr

func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32)

Set the EP_FromJoin property on all terms of the given expression. And set the Expr.iRightJoinTable to iTable for every term in the expression.

The EP_FromJoin property is used on terms of an expression to tell the LEFT OUTER JOIN processing logic that this term is part of the join restriction specified in the ON or USING clause and not a part of the more general WHERE clause. These terms are moved over to the WHERE clause during join processing but we need to remember that they originated in the ON or USING clause.

The Expr.iRightJoinTable tells the WHERE clause processing that the expression depends on table iRightJoinTable even if that table is not explicitly mentioned in the expression. That information is needed for cases like this:

SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5

The where clause needs to defer the handling of the t1.x=5 term until after the t2 loop of the join. In that way, a NULL t2 row will be inserted whenever t1.x!=5. If we do not defer the handling of t1.x=5, it will be processed immediately after the t1 loop and rows with t1.x!=5 will never appear in the output, which is incorrect.

func Xsqlite3SetString

func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr)

Free any prior content in *pz and replace it with a copy of zNew.

func Xsqlite3SetTextEncoding

func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8)

Change the text encoding for a database connection. This means that the pDfltColl must change as well.

func Xsqlite3ShadowTableName

func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32

Return true if zName is a shadow table name in the current database connection.

zName is temporarily modified while this routine is running, but is restored to its original value prior to this routine returning.

func Xsqlite3SrcListAppend

func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable uintptr, pDatabase uintptr) uintptr

Append a new table name to the given SrcList. Create a new SrcList if need be. A new entry is created in the SrcList even if pTable is NULL.

A SrcList is returned, or NULL if there is an OOM error or if the SrcList grows to large. The returned SrcList might be the same as the SrcList that was input or it might be a new one. If an OOM error does occurs, then the prior value of pList that is input to this routine is automatically freed.

If pDatabase is not null, it means that the table has an optional database name prefix. Like this: "database.table". The pDatabase points to the table name and the pTable points to the database name. The SrcList.a[].zName field is filled with the table name which might come from pTable (if pDatabase is NULL) or from pDatabase. SrcList.a[].zDatabase is filled with the database name from pTable, or with NULL if no database is specified.

In other words, if call like this:

sqlite3SrcListAppend(D,A,B,0);

Then B is a table name and the database name is unspecified. If called like this:

sqlite3SrcListAppend(D,A,B,C);

Then C is the table name and B is the database name. If C is defined then so is B. In other words, we never have a case where:

sqlite3SrcListAppend(D,A,0,C);

Both pTable and pDatabase are assumed to be quoted. They are dequoted before being added to the SrcList.

func Xsqlite3SrcListAppendFromTerm

func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTable uintptr, pDatabase uintptr, pAlias uintptr, pSubquery uintptr, pOn uintptr, pUsing uintptr) uintptr

This routine is called by the parser to add a new term to the end of a growing FROM clause. The "p" parameter is the part of the FROM clause that has already been constructed. "p" is NULL if this is the first term of the FROM clause. pTable and pDatabase are the name of the table and database named in the FROM clause term. pDatabase is NULL if the database name qualifier is missing - the usual case. If the term has an alias, then pAlias points to the alias token. If the term is a subquery, then pSubquery is the SELECT statement that the subquery encodes. The pTable and pDatabase parameters are NULL for subqueries. The pOn and pUsing parameters are the content of the ON and USING clauses.

Return a new SrcList which encodes is the FROM with the new term added.

func Xsqlite3SrcListAppendList

func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr) uintptr

Append the contents of SrcList p2 to SrcList p1 and return the resulting SrcList. Or, if an error occurs, return NULL. In all cases, p1 and p2 are deleted by this function.

func Xsqlite3SrcListAssignCursors

func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr)

Assign VdbeCursor index numbers to all tables in a SrcList

func Xsqlite3SrcListDelete

func Xsqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr)

Delete an entire SrcList including all its substructure.

func Xsqlite3SrcListDup

func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr

If cursors, triggers, views and subqueries are all omitted from the build, then none of the following routines, except for sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes called with a NULL argument.

func Xsqlite3SrcListEnlarge

func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra int32, iStart int32) uintptr

Expand the space allocated for the given SrcList object by creating nExtra new slots beginning at iStart. iStart is zero based. New slots are zeroed.

For example, suppose a SrcList initially contains two entries: A,B. To append 3 new entries onto the end, do this:

sqlite3SrcListEnlarge(db, pSrclist, 3, 2);

After the call above it would contain: A, B, nil, nil, nil. If the iStart argument had been 1 instead of 2, then the result would have been: A, nil, nil, nil, B. To prepend the new slots, the iStart value would be 0. The result then would be: nil, nil, nil, A, B.

If a memory allocation fails or the SrcList becomes too large, leave the original SrcList unchanged, return NULL, and leave an error message in pParse.

func Xsqlite3SrcListFuncArgs

func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uintptr)

Add the list of function arguments to the SrcList entry for a table-valued-function.

func Xsqlite3SrcListIndexedBy

func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexedBy uintptr)

Add an INDEXED BY or NOT INDEXED clause to the most recently added element of the source-list passed as the second argument.

func Xsqlite3SrcListLookup

func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr

While a SrcList can in general represent multiple tables and subqueries (as in the FROM clause of a SELECT statement) in this case it contains the name of a single table, as one might find in an INSERT, DELETE, or UPDATE statement. Look up that table in the symbol table and return a pointer. Set an error message and return NULL if the table name is not found or if any other error occurs.

The following fields are initialized appropriate in pSrc:

pSrc->a[0].pTab       Pointer to the Table object
pSrc->a[0].pIndex     Pointer to the INDEXED BY index, if there is one

func Xsqlite3SrcListShiftJoinType

func Xsqlite3SrcListShiftJoinType(tls *libc.TLS, p uintptr)

When building up a FROM clause in the parser, the join operator is initially attached to the left operand. But the code generator expects the join operator to be on the right operand. This routine Shifts all join operators from left to right for an entire FROM clause.

Example: Suppose the join is like this:

A natural cross join B

The operator is "natural cross join". The A and B operands are stored in p->a[0] and p->a[1], respectively. The parser initially stores the operator with A. This routine shifts that operator over to B.

func Xsqlite3StartTable

func Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, isTemp int32, isView int32, isVirtual int32, noErr int32)

Begin constructing a new table representation in memory. This is the first of several action routines that get called in response to a CREATE TABLE statement. In particular, this routine is called after seeing tokens "CREATE" and "TABLE" and the table name. The isTemp flag is true if the table should be stored in the auxiliary database file instead of in the main database file. This is normally the case when the "TEMP" or "TEMPORARY" keyword occurs in between CREATE and TABLE.

The new table record is initialized and put in pParse->pNewTable. As more of the CREATE TABLE statement is parsed, additional action routines will be called to add more information to this record. At the end of the CREATE TABLE statement, the sqlite3EndTable() routine is called to complete the construction of the new table record.

func Xsqlite3Stat4Column

func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iCol int32, ppVal uintptr) int32

Extract the iCol-th column from the nRec-byte record in pRec. Write the column value into *ppVal. If *ppVal is initially NULL then a new sqlite3_value object is allocated.

If *ppVal is initially NULL then the caller is responsible for ensuring that the value written into *ppVal is eventually freed.

func Xsqlite3Stat4ProbeFree

func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr)

Unless it is NULL, the argument must be an UnpackedRecord object returned by an earlier call to sqlite3Stat4ProbeSetValue(). This call deletes the object.

func Xsqlite3Stat4ProbeSetValue

func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppRec uintptr, pExpr uintptr, nElem int32, iVal int32, pnExtract uintptr) int32

This function is used to allocate and populate UnpackedRecord structures intended to be compared against sample index keys stored in the sqlite_stat4 table.

A single call to this function populates zero or more fields of the record starting with field iVal (fields are numbered from left to right starting with 0). A single field is populated if:

  • (pExpr==0). In this case the value is assumed to be an SQL NULL,

  • The expression is a bound variable, and this is a reprepare, or

  • The sqlite3ValueFromExpr() function is able to extract a value from the expression (i.e. the expression is a literal value).

Or, if pExpr is a TK_VECTOR, one field is populated for each of the vector components that match either of the two latter criteria listed above.

Before any value is appended to the record, the affinity of the corresponding column within index pIdx is applied to it. Before this function returns, output parameter *pnExtract is set to the number of values appended to the record.

When this function is called, *ppRec must either point to an object allocated by an earlier call to this function, or must be NULL. If it is NULL and a value can be successfully extracted, a new UnpackedRecord is allocated (and *ppRec set to point to it) before returning.

Unless an error is encountered, SQLITE_OK is returned. It is not an error if a value cannot be extracted from pExpr. If an error does occur, an SQLite error code is returned.

func Xsqlite3Stat4ValueFromExpr

func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, ppVal uintptr) int32

Attempt to extract a value from expression pExpr using the methods as described for sqlite3Stat4ProbeSetValue() above.

If successful, set *ppVal to point to a new value object and return SQLITE_OK. If no value can be extracted, but no other error occurs (e.g. OOM), return SQLITE_OK and set *ppVal to NULL. Or, if an error does occur, return an SQLite error code. The final value of *ppVal is undefined in this case.

func Xsqlite3StatusDown

func Xsqlite3StatusDown(tls *libc.TLS, op int32, N int32)

func Xsqlite3StatusHighwater

func Xsqlite3StatusHighwater(tls *libc.TLS, op int32, X int32)

Adjust the highwater mark if necessary. The caller must hold the appropriate mutex.

func Xsqlite3StatusUp

func Xsqlite3StatusUp(tls *libc.TLS, op int32, N int32)

Add N to the value of a status record. The caller must hold the appropriate mutex. (Locking is checked by assert()).

The StatusUp() routine can accept positive or negative values for N. The value of N is added to the current status value and the high-water mark is adjusted if necessary.

The StatusDown() routine lowers the current value by N. The highwater mark is unchanged. N must be non-negative for StatusDown().

func Xsqlite3StmtVtabInit

func Xsqlite3StmtVtabInit(tls *libc.TLS, db uintptr) int32

func Xsqlite3StrAccumFinish

func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr

func Xsqlite3StrAccumInit

func Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32)

Initialize a string accumulator.

p: The accumulator to be initialized. db: Pointer to a database connection. May be NULL. Lookaside

memory is used if not NULL. db->mallocFailed is set appropriately
when not NULL.

zBase: An initial buffer. May be NULL in which case the initial buffer

is malloced.

n: Size of zBase in bytes. If total space requirements never exceed

n then no memory allocations ever occur.

mx: Maximum number of bytes to accumulate. If mx==0 then no memory

allocations will ever occur.

func Xsqlite3StrICmp

func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32

func Xsqlite3Strlen30

func Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32

Compute a string length that is limited to what can be stored in lower 30 bits of a 32-bit signed integer.

The value returned will never be negative. Nor will it ever be greater than the actual length of the string. For very long strings (greater than 1GiB) the value returned might be less than the true string length.

func Xsqlite3SubInt64

func Xsqlite3SubInt64(tls *libc.TLS, pA uintptr, iB I64) int32

func Xsqlite3SubselectError

func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpect int32)

Load the Parse object passed as the first argument with an error message of the form:

"sub-select returns N columns - expected M"

func Xsqlite3SystemError

func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32)

Load the sqlite3.iSysErrno field if that is an appropriate thing to do based on the SQLite error code in rc.

func Xsqlite3TableAffinity

func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32)

Compute the affinity string for table pTab, if it has not already been computed. As an optimization, omit trailing SQLITE_AFF_BLOB affinities.

If the affinity exists (if it is no entirely SQLITE_AFF_BLOB values) and if iReg>0 then code an OP_Affinity opcode that will set the affinities for register iReg and following. Or if affinities exists and iReg==0, then just set the P4 operand of the previous opcode (which should be an OP_MakeRecord) to the affinity string.

A column affinity string has one character per column:

Character      Column affinity
------------------------------
'A'            BLOB
'B'            TEXT
'C'            NUMERIC
'D'            INTEGER
'E'            REAL

func Xsqlite3TableColumnAffinity

func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8

Return the affinity character for a single column of a table.

func Xsqlite3TableLock

func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr)

func Xsqlite3TempInMemory

func Xsqlite3TempInMemory(tls *libc.TLS, db uintptr) int32

This function returns true if main-memory should be used instead of a temporary file for transient pager files and statement journals. The value returned depends on the value of db->temp_store (runtime parameter) and the compile time value of SQLITE_TEMP_STORE. The following table describes the relationship between these two values and this functions return value.

SQLITE_TEMP_STORE     db->temp_store     Location of temporary database
-----------------     --------------     ------------------------------
0                     any                file      (return 0)
1                     1                  file      (return 0)
1                     2                  memory    (return 1)
1                     0                  file      (return 0)
2                     1                  file      (return 0)
2                     2                  memory    (return 1)
2                     0                  memory    (return 1)
3                     any                memory    (return 1)

func Xsqlite3ThreadCreate

func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) int32

Create a new thread

func Xsqlite3ThreadJoin

func Xsqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) int32

Get the results of the thread

func Xsqlite3TokenInit

func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr)

Generate a Token object from a string

func Xsqlite3TransferBindings

func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32

Transfer all bindings from the first statement over to the second.

func Xsqlite3TriggerDeleteStep

func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pWhere uintptr, zStart uintptr, zEnd uintptr) uintptr

Construct a trigger step that implements a DELETE statement and return a pointer to that trigger step. The parser calls this routine when it sees a DELETE statement inside the body of a CREATE TRIGGER.

func Xsqlite3TriggerInsertStep

func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pColumn uintptr, pSelect uintptr, orconf U8, pUpsert uintptr, zStart uintptr, zEnd uintptr) uintptr

Build a trigger step out of an INSERT statement. Return a pointer to the new trigger step.

The parser calls this routine when it sees an INSERT inside the body of a trigger.

func Xsqlite3TriggerList

func Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr

Given table pTab, return a list of all the triggers attached to the table. The list is connected by Trigger.pNext pointers.

All of the triggers on pTab that are in the same database as pTab are already attached to pTab->pTrigger. But there might be additional triggers on pTab in the TEMP schema. This routine prepends all TEMP triggers on pTab to the beginning of the pTab->pTrigger list and returns the combined list.

To state it another way: This routine returns a list of all triggers that fire off of pTab. The list will include any TEMP triggers on pTab as well as the triggers lised in pTab->pTrigger.

func Xsqlite3TriggerSelectStep

func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStart uintptr, zEnd uintptr) uintptr

Turn a SELECT statement (that the pSelect parameter points to) into a trigger step. Return a pointer to a TriggerStep structure.

The parser calls this routine when it finds a SELECT statement in body of a TRIGGER.

func Xsqlite3TriggerStepSrc

func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintptr

Convert the pStep->zTarget string into a SrcList and return a pointer to that SrcList.

This routine adds a specific database name, if needed, to the target when forming the SrcList. This prevents a trigger in one database from referring to a target in another database. An exception is when the trigger is in TEMP in which case it can refer to any other database it wants.

func Xsqlite3TriggerUpdateStep

func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pFrom uintptr, pEList uintptr, pWhere uintptr, orconf U8, zStart uintptr, zEnd uintptr) uintptr

Construct a trigger step that implements an UPDATE statement and return a pointer to that trigger step. The parser calls this routine when it sees an UPDATE statement inside the body of a CREATE TRIGGER.

func Xsqlite3TriggersExist

func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) uintptr

Return a list of all triggers on table pTab if there exists at least one trigger that must be fired when an operation of type 'op' is performed on the table, and, if that operation is an UPDATE, if at least one of the columns in pChanges is being modified.

func Xsqlite3TwoPartName

func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pUnqual uintptr) int32

The table or view or trigger name is passed to this routine via tokens pName1 and pName2. If the table name was fully qualified, for example:

CREATE TABLE xxx.yyy (...);

Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if the table name is not fully qualified, i.e.:

CREATE TABLE yyy(...);

Then pName1 is set to "yyy" and pName2 is "".

This routine sets the *ppUnqual pointer to point at the token (pName1 or pName2) that stores the unqualified table name. The index of the database "xxx" is returned.

func Xsqlite3UniqueConstraint

func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx uintptr)

Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation.

func Xsqlite3UnlinkAndDeleteIndex

func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName uintptr)

For the index called zIdxName which is found in the database iDb, unlike that index from its Table then remove the index from the index hash table and free all memory structures associated with the index.

func Xsqlite3UnlinkAndDeleteTable

func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName uintptr)

Unlink the given table from the hash tables and the delete the table structure with all its indices and foreign keys.

func Xsqlite3UnlinkAndDeleteTrigger

func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName uintptr)

Remove a trigger from the hash tables of the sqlite* pointer.

func Xsqlite3Update

func Xsqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr)

Process an UPDATE statement.

UPDATE OR IGNORE tbl SET a=b, c=d FROM tbl2... WHERE e<5 AND f NOT NULL;
       \_______/ \_/     \______/      \_____/       \________________/
        onError   |      pChanges         |                pWhere
                  \_______________________/
                            pTabList

func Xsqlite3UpsertAnalyzeTarget

func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr, pUpsert uintptr) int32

Analyze the ON CONFLICT clause described by pUpsert. Resolve all symbols in the conflict-target.

Return SQLITE_OK if everything works, or an error code is something is wrong.

func Xsqlite3UpsertDelete

func Xsqlite3UpsertDelete(tls *libc.TLS, db uintptr, p uintptr)

func Xsqlite3UpsertDoUpdate

func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab uintptr, pIdx uintptr, iCur int32)

Generate bytecode that does an UPDATE as part of an upsert.

If pIdx is NULL, then the UNIQUE constraint that failed was the IPK. In this case parameter iCur is a cursor open on the table b-tree that currently points to the conflicting table row. Otherwise, if pIdx is not NULL, then pIdx is the constraint that failed and iCur is a cursor points to the conflicting row.

func Xsqlite3UpsertDup

func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr

Duplicate an Upsert object.

func Xsqlite3UpsertNew

func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere uintptr, pSet uintptr, pWhere uintptr, pNext uintptr) uintptr

Create a new Upsert object.

func Xsqlite3UpsertNextIsIPK

func Xsqlite3UpsertNextIsIPK(tls *libc.TLS, pUpsert uintptr) int32

Return true if pUpsert is the last ON CONFLICT clause with a conflict target, or if pUpsert is followed by another ON CONFLICT clause that targets the INTEGER PRIMARY KEY.

func Xsqlite3UpsertOfIndex

func Xsqlite3UpsertOfIndex(tls *libc.TLS, pUpsert uintptr, pIdx uintptr) uintptr

Given the list of ON CONFLICT clauses described by pUpsert, and a particular index pIdx, return a pointer to the particular ON CONFLICT clause that applies to the index. Or, if the index is not subject to any ON CONFLICT clause, return NULL.

func Xsqlite3Utf16ByteLen

func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32

zIn is a UTF-16 encoded unicode string at least nChar characters long. Return the number of bytes in the first nChar unicode characters in pZ. nChar must be non-negative.

func Xsqlite3Utf16to8

func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8) uintptr

Convert a UTF-16 string in the native encoding into a UTF-8 string. Memory to hold the UTF-8 string is obtained from sqlite3_malloc and must be freed by the calling function.

NULL is returned if there is an allocation error.

func Xsqlite3Utf8CharLen

func Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32

pZ is a UTF-8 encoded unicode string. If nByte is less than zero, return the number of unicode characters in pZ up to (but not including) the first 0x00 byte. If nByte is not less than zero, return the number of unicode characters in the first nByte of pZ (or up to the first 0x00, whichever comes first).

func Xsqlite3UtfSelfTest

func Xsqlite3UtfSelfTest(tls *libc.TLS)

This routine is called from the TCL test function "translate_selftest". It checks that the primitives for serializing and deserializing characters in each encoding are inverses of each other.

func Xsqlite3VListAdd

func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) uintptr

Add a new name/number pair to a VList. This might require that the VList object be reallocated, so return the new VList. If an OOM error occurs, the original VList returned and the db->mallocFailed flag is set.

A VList is really just an array of integers. To destroy a VList, simply pass it to sqlite3DbFree().

The first integer is the number of integers allocated for the whole VList. The second integer is the number of integers actually used. Each name/number pair is encoded by subsequent groups of 3 or more integers.

Each name/number pair starts with two integers which are the numeric value for the pair and the size of the name/number pair, respectively. The text name overlays one or more following integers. The text name is always zero-terminated.

Conceptually:

struct VList {
  int nAlloc;   // Number of allocated slots
  int nUsed;    // Number of used slots
  struct VListEntry {
    int iValue;    // Value for this entry
    int nSlot;     // Slots used by this entry
    // ... variable name goes here
  } a[0];
}

During code generation, pointers to the variable names within the VList are taken. When that happens, nAlloc is set to zero as an indication that the VList may never again be enlarged, since the accompanying realloc() would invalidate the pointers.

func Xsqlite3VListNameToNum

func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int32) int32

Return the number of the variable named zName, if it is in VList. or return 0 if there is no such variable.

func Xsqlite3VListNumToName

func Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr

Return a pointer to the name of a variable in the given VList that has the value iVal. Or return a NULL if there is no such variable in the list

func Xsqlite3VMPrintf

func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) uintptr

Print into memory obtained from sqliteMalloc(). Use the internal %-conversion extensions.

func Xsqlite3Vacuum

func Xsqlite3Vacuum(tls *libc.TLS, pParse uintptr, pNm uintptr, pInto uintptr)

The VACUUM command is used to clean up the database, collapse free space, etc. It is modelled after the VACUUM command in PostgreSQL. The VACUUM command works as follows:

(1)  Create a new transient database file
(2)  Copy all content from the database being vacuumed into
     the new transient database file
(3)  Copy content from the transient database back into the
     original database.

The transient database requires temporary disk space approximately equal to the size of the original database. The copy operation of step (3) requires additional temporary disk space approximately equal to the size of the original database for the rollback journal. Hence, temporary disk space that is approximately 2x the size of the original database is required. Every page of the database is written approximately 3 times: Once for step (2) and twice for step (3). Two writes per page are required in step (3) because the original database content must be written into the rollback journal prior to overwriting the database with the vacuumed content.

Only 1x temporary space and only 1x writes would be required if the copy of step (3) were replaced by deleting the original database and renaming the transient database as the original. But that will not work if other processes are attached to the original database. And a power loss in between deleting the original and renaming the transient would cause the database file to appear to be deleted following reboot.

func Xsqlite3ValueApplyAffinity

func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8)

Exported version of applyAffinity(). This one works on sqlite3_value*, not the internal Mem* type.

func Xsqlite3ValueBytes

func Xsqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32

func Xsqlite3ValueFree

func Xsqlite3ValueFree(tls *libc.TLS, v uintptr)

Free an sqlite3_value object

func Xsqlite3ValueFromExpr

func Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr) int32

Create a new sqlite3_value object, containing the value of pExpr.

This only works for very simple expressions that consist of one constant token (i.e. "5", "5.1", "'a string'"). If the expression can be converted directly into a value, then the value is allocated and a pointer written to *ppVal. The caller is responsible for deallocating the value by passing it to sqlite3ValueFree() later on. If the expression cannot be converted to a value, then *ppVal is set to NULL.

func Xsqlite3ValueNew

func Xsqlite3ValueNew(tls *libc.TLS, db uintptr) uintptr

Create a new sqlite3_value object.

func Xsqlite3ValueSetNull

func Xsqlite3ValueSetNull(tls *libc.TLS, p uintptr)

func Xsqlite3ValueSetStr

func Xsqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc U8, xDel uintptr)

Change the string value of an sqlite3_value object

func Xsqlite3ValueText

func Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr

This function is only available internally, it is not part of the external API. It works in a similar way to sqlite3_value_text(), except the data returned is in the encoding specified by the second parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or SQLITE_UTF8.

(2006-02-16:) The enc value can be or-ed with SQLITE_UTF16_ALIGNED. If that is the case, then the result must be aligned on an even byte boundary.

func Xsqlite3VarintLen

func Xsqlite3VarintLen(tls *libc.TLS, v U64) int32

Return the number of bytes that will be needed to store the given 64-bit integer.

func Xsqlite3VdbeAddFunctionCall

func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) int32

Add an OP_Function or OP_PureFunc opcode.

The eCallCtx argument is information (typically taken from Expr.op2) that describes the calling context of the function. 0 means a general function call. NC_IsCheck means called by a check constraint, NC_IdxExpr means called as part of an index expression. NC_PartIdx means in the WHERE clause of a partial index. NC_GenCol means called while computing a generated column value. 0 is the usual case.

func Xsqlite3VdbeAddOp0

func Xsqlite3VdbeAddOp0(tls *libc.TLS, p uintptr, op int32) int32

func Xsqlite3VdbeAddOp1

func Xsqlite3VdbeAddOp1(tls *libc.TLS, p uintptr, op int32, p1 int32) int32

func Xsqlite3VdbeAddOp2

func Xsqlite3VdbeAddOp2(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32) int32

func Xsqlite3VdbeAddOp3

func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32

func Xsqlite3VdbeAddOp4

func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32

Add an opcode that includes the p4 value as a pointer.

func Xsqlite3VdbeAddOp4Dup8

func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32

Add an opcode that includes the p4 value with a P4_INT64 or P4_REAL type.

func Xsqlite3VdbeAddOp4Int

func Xsqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, p4 int32) int32

Add an opcode that includes the p4 value as an integer.

func Xsqlite3VdbeAddOpList

func Xsqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLineno int32) uintptr

Add a whole list of operations to the operation stack. Return a pointer to the first operation inserted.

Non-zero P2 arguments to jump instructions are automatically adjusted so that the jump target is relative to the first operation inserted.

func Xsqlite3VdbeAddParseSchemaOp

func Xsqlite3VdbeAddParseSchemaOp(tls *libc.TLS, p uintptr, iDb int32, zWhere uintptr, p5 U16)

Add an OP_ParseSchema opcode. This routine is broken out from sqlite3VdbeAddOp4() since it needs to also needs to mark all btrees as having been used.

The zWhere string must have been obtained from sqlite3_malloc(). This routine will take ownership of the allocated memory.

func Xsqlite3VdbeAllocUnpackedRecord

func Xsqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) uintptr

This routine is used to allocate sufficient space for an UnpackedRecord structure large enough to be used with sqlite3VdbeRecordUnpack() if the first argument is a pointer to KeyInfo structure pKeyInfo.

The space is either allocated using sqlite3DbMallocRaw() or from within the unaligned buffer passed via the second and third arguments (presumably stack space). If the former, then *ppFree is set to a pointer that should be eventually freed by the caller using sqlite3DbFree(). Or, if the allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL before returning.

If an OOM error occurs, NULL is returned.

func Xsqlite3VdbeAppendP4

func Xsqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32)

Change the P4 operand of the most recently coded instruction to the value defined by the arguments. This is a high-speed version of sqlite3VdbeChangeP4().

The P4 operand must not have been previously defined. And the new P4 must not be P4_INT32. Use sqlite3VdbeChangeP4() in either of those cases.

func Xsqlite3VdbeBooleanValue

func Xsqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) int32

Return 1 if pMem represents true, and return 0 if pMem represents false. Return the value ifNull if pMem is NULL.

func Xsqlite3VdbeBytecodeVtabInit

func Xsqlite3VdbeBytecodeVtabInit(tls *libc.TLS, db uintptr) int32

func Xsqlite3VdbeChangeEncoding

func Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) int32

If pMem is an object with a valid string representation, this routine ensures the internal encoding for the string representation is 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE.

If pMem is not a string object, or the encoding of the string representation is already stored using the requested encoding, then this routine is a no-op.

SQLITE_OK is returned if the conversion is successful (or not required). SQLITE_NOMEM may be returned if a malloc() fails during conversion between formats.

func Xsqlite3VdbeChangeOpcode

func Xsqlite3VdbeChangeOpcode(tls *libc.TLS, p uintptr, addr int32, iNewOpcode U8)

Change the value of the opcode, or P1, P2, P3, or P5 operands for a specific instruction.

func Xsqlite3VdbeChangeP1

func Xsqlite3VdbeChangeP1(tls *libc.TLS, p uintptr, addr int32, val int32)

func Xsqlite3VdbeChangeP2

func Xsqlite3VdbeChangeP2(tls *libc.TLS, p uintptr, addr int32, val int32)

func Xsqlite3VdbeChangeP3

func Xsqlite3VdbeChangeP3(tls *libc.TLS, p uintptr, addr int32, val int32)

func Xsqlite3VdbeChangeP4

func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n int32)

func Xsqlite3VdbeChangeP5

func Xsqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 U16)

func Xsqlite3VdbeChangeToNoop

func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32

Change the opcode at addr into OP_Noop

func Xsqlite3VdbeCheckFk

func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32

This function is called when a transaction opened by the database handle associated with the VM passed as an argument is about to be committed. If there are outstanding deferred foreign key constraint violations, return SQLITE_ERROR. Otherwise, SQLITE_OK.

If there are outstanding FK violations and this function returns SQLITE_ERROR, set the result of the VM to SQLITE_CONSTRAINT_FOREIGNKEY and write an error message to it. Then return SQLITE_ERROR.

func Xsqlite3VdbeClearObject

func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr)

Free all memory associated with the Vdbe passed as the second argument, except for object itself, which is preserved.

The difference between this function and sqlite3VdbeDelete() is that VdbeDelete() also unlinks the Vdbe from the list of VMs associated with the database connection and frees the object itself.

func Xsqlite3VdbeCloseStatement

func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32

func Xsqlite3VdbeComment

func Xsqlite3VdbeComment(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr)

func Xsqlite3VdbeCountChanges

func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr)

Set a flag in the vdbe to update the change counter when it is finalised or reset.

func Xsqlite3VdbeCreate

func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr

Create a new virtual database engine.

func Xsqlite3VdbeCurrentAddr

func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32

Return the address of the next instruction to be inserted.

func Xsqlite3VdbeCursorMoveto

func Xsqlite3VdbeCursorMoveto(tls *libc.TLS, pp uintptr, piCol uintptr) int32

Make sure the cursor p is ready to read or write the row to which it was last positioned. Return an error code if an OOM fault or I/O error prevents us from positioning the cursor to its correct position.

If a MoveTo operation is pending on the given cursor, then do that MoveTo now. If no move is pending, check to see if the row has been deleted out from under the cursor and if it has, mark the row as a NULL row.

If the cursor is already pointing to the correct row and that row has not been deleted out from under the cursor, then this routine is a no-op.

func Xsqlite3VdbeCursorRestore

func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32

Check to ensure that the cursor is valid. Restore the cursor if need be. Return any I/O error from the restore operation.

func Xsqlite3VdbeDb

func Xsqlite3VdbeDb(tls *libc.TLS, v uintptr) uintptr

Return the database associated with the Vdbe.

func Xsqlite3VdbeDelete

func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr)

Delete an entire VDBE.

func Xsqlite3VdbeDeleteAuxData

func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, mask int32)

If parameter iOp is less than zero, then invoke the destructor for all auxiliary data pointers currently cached by the VM passed as the first argument.

Or, if iOp is greater than or equal to zero, then the destructor is only invoked for those auxiliary data pointers created by the user function invoked by the OP_Function opcode at instruction iOp of VM pVdbe, and only then if:

  • the associated function parameter is the 32nd or later (counting from left to right), or

  • the corresponding bit in argument mask is clear (where the first function parameter corresponds to bit 0 etc.).

func Xsqlite3VdbeDeletePriorOpcode

func Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32

If the last opcode is "op" and it is not a jump destination, then remove it. Return true if and only if an opcode was removed.

func Xsqlite3VdbeDisplayComment

func Xsqlite3VdbeDisplayComment(tls *libc.TLS, db uintptr, pOp uintptr, zP4 uintptr) uintptr

Compute a string for the "comment" field of a VDBE opcode listing.

The Synopsis: field in comments in the vdbe.c source file gets converted to an extra string that is appended to the sqlite3OpcodeName(). In the absence of other comments, this synopsis becomes the comment on the opcode. Some translation occurs:

"PX"      ->  "r[X]"
"PX@PY"   ->  "r[X..X+Y-1]"  or "r[x]" if y is 0 or 1
"PX@PY+1" ->  "r[X..X+Y]"    or "r[x]" if y is 0
"PY..PY"  ->  "r[X..Y]"      or "r[x]" if y<=x

func Xsqlite3VdbeDisplayP4

func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr

Compute a string that describes the P4 parameter for an opcode. Use zTemp for any required temporary buffer space.

func Xsqlite3VdbeEndCoroutine

func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32)

Insert the end of a co-routine

func Xsqlite3VdbeEnter

func Xsqlite3VdbeEnter(tls *libc.TLS, p uintptr)

If SQLite is compiled to support shared-cache mode and to be threadsafe, this routine obtains the mutex associated with each BtShared structure that may be accessed by the VM passed as an argument. In doing so it also sets the BtShared.db member of each of the BtShared structures, ensuring that the correct busy-handler callback is invoked if required.

If SQLite is not threadsafe but does support shared-cache mode, then sqlite3BtreeEnter() is invoked to set the BtShared.db variables of all of BtShared structures accessible via the database handle associated with the VM.

If SQLite is not threadsafe and does not support shared-cache mode, this function is a no-op.

The p->btreeMask field is a bitmask of all btrees that the prepared statement p will ever use. Let N be the number of bits in p->btreeMask corresponding to btrees that use shared cache. Then the runtime of this routine is N*N. But as N is rarely more than 1, this should not be a problem.

func Xsqlite3VdbeError

func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr)

Change the error string stored in Vdbe.zErrMsg

func Xsqlite3VdbeExec

func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32

Execute as much of a VDBE program as we can. This is the core of sqlite3_step().

func Xsqlite3VdbeExpandSql

func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr

This function returns a pointer to a nul-terminated string in memory obtained from sqlite3DbMalloc(). If sqlite3.nVdbeExec is 1, then the string contains a copy of zRawSql but with host parameters expanded to their current bindings. Or, if sqlite3.nVdbeExec is greater than 1, then the returned string holds a copy of zRawSql with "-- " prepended to each line of text.

If the SQLITE_TRACE_SIZE_LIMIT macro is defined to an integer, then then long strings and blobs are truncated to that many bytes. This can be used to prevent unreasonably large trace strings when dealing with large (multi-megabyte) strings and blobs.

The calling function is responsible for making sure the memory returned is eventually freed.

ALGORITHM: Scan the input string looking for host parameters in any of these forms: ?, ?N, $A, @A, :A. Take care to avoid text within string literals, quoted identifier names, and comments. For text forms, the host parameter index is found by scanning the prepared statement for the corresponding OP_Variable opcode. Once the host parameter index is known, locate the value in p->aVar[]. Then render the value as a literal in place of the host parameter name.

func Xsqlite3VdbeExplain

func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr, va uintptr)

Add a new OP_Explain opcode.

If the bPush flag is true, then make this opcode the parent for subsequent Explains until sqlite3VdbeExplainPop() is called.

func Xsqlite3VdbeExplainParent

func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32

Return the address of the current EXPLAIN QUERY PLAN baseline. 0 means "none".

func Xsqlite3VdbeExplainPop

func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr)

Pop the EXPLAIN QUERY PLAN stack one level.

func Xsqlite3VdbeFinalize

func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32

Clean up and delete a VDBE after execution. Return an integer which is the result code. Write any error message text into *pzErrMsg.

func Xsqlite3VdbeFinishMoveto

func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32

The cursor "p" has a pending seek operation that has not yet been carried out. Seek the cursor now. If an error occurs, return the appropriate error code.

func Xsqlite3VdbeFrameDelete

func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr)

Delete a VdbeFrame object and its contents. VdbeFrame objects are allocated by the OP_Program opcode in sqlite3VdbeExec().

func Xsqlite3VdbeFrameMemDel

func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr)

This is a destructor on a Mem object (which is really an sqlite3_value) that deletes the Frame object that is attached to it as a blob.

This routine does not delete the Frame right away. It merely adds the frame to a list of frames to be deleted when the Vdbe halts.

func Xsqlite3VdbeFrameRestore

func Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32

Copy the values stored in the VdbeFrame structure to its Vdbe. This is used, for example, when a trigger sub-program is halted to restore control to the main program.

func Xsqlite3VdbeFreeCursor

func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr)

Close a VDBE cursor and release all the resources that cursor happens to hold.

func Xsqlite3VdbeGetBoundValue

func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uintptr

Return a pointer to an sqlite3_value structure containing the value bound parameter iVar of VM v. Except, if the value is an SQL NULL, return 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_* constants) to the value before returning it.

The returned value must be freed by the caller using sqlite3ValueFree().

func Xsqlite3VdbeGetOp

func Xsqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) uintptr

Return the opcode for a given address. If the address is -1, then return the most recently inserted opcode.

If a memory allocation error has occurred prior to the calling of this routine, then a pointer to a dummy VdbeOp will be returned. That opcode is readable but not writable, though it is cast to a writable value. The return of a dummy opcode allows the call to continue functioning after an OOM fault without having to check to see if the return from this routine is a valid pointer. But because the dummy.opcode is 0, dummy will never be written to. This is verified by code inspection and by running with Valgrind.

func Xsqlite3VdbeGoto

func Xsqlite3VdbeGoto(tls *libc.TLS, p uintptr, iDest int32) int32

Generate code for an unconditional jump to instruction iDest

func Xsqlite3VdbeHalt

func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32

This routine is called the when a VDBE tries to halt. If the VDBE has made changes and is in autocommit mode, then commit those changes. If a rollback is needed, then do the rollback.

This routine is the only way to move the state of a VM from SQLITE_MAGIC_RUN to SQLITE_MAGIC_HALT. It is harmless to call this on a VM that is in the SQLITE_MAGIC_HALT state.

Return an error code. If the commit could not complete because of lock contention, return SQLITE_BUSY. If SQLITE_BUSY is returned, it means the close did not happen and needs to be repeated.

func Xsqlite3VdbeHasSubProgram

func Xsqlite3VdbeHasSubProgram(tls *libc.TLS, pVdbe uintptr) int32

Return true if the given Vdbe has any SubPrograms.

func Xsqlite3VdbeIdxKeyCompare

func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked uintptr, res uintptr) int32

Compare the key of the index entry that cursor pC is pointing to against the key string in pUnpacked. Write into *pRes a number that is negative, zero, or positive if pC is less than, equal to, or greater than pUnpacked. Return SQLITE_OK on success.

pUnpacked is either created without a rowid or is truncated so that it omits the rowid at the end. The rowid at the end of the index entry is ignored as well. Hence, this routine only compares the prefixes of the keys prior to the final rowid, not the entire key.

func Xsqlite3VdbeIdxRowid

func Xsqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr) int32

pCur points at an index entry created using the OP_MakeRecord opcode. Read the rowid (the last field in the record) and store it in *rowid. Return SQLITE_OK if everything works, or an error code otherwise.

pCur might be pointing to text obtained from a corrupt database file. So the content cannot be trusted. Do appropriate checks on the content.

func Xsqlite3VdbeIntegerAffinity

func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr)

The MEM structure is already a MEM_Real. Try to also make it a MEM_Int if we can.

func Xsqlite3VdbeJumpHere

func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32)

Change the P2 operand of instruction addr so that it points to the address of the next instruction to be coded.

func Xsqlite3VdbeJumpHereOrPopInst

func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32)

Change the P2 operand of the jump instruction at addr so that the jump lands on the next opcode. Or if the jump instruction was the previous opcode (and is thus a no-op) then simply back up the next instruction counter by one slot so that the jump is overwritten by the next inserted opcode.

This routine is an optimization of sqlite3VdbeJumpHere() that strives to omit useless byte-code like this:

7   Once 0 8 0
8   ...

func Xsqlite3VdbeLeave

func Xsqlite3VdbeLeave(tls *libc.TLS, p uintptr)

func Xsqlite3VdbeLinkSubProgram

func Xsqlite3VdbeLinkSubProgram(tls *libc.TLS, pVdbe uintptr, p uintptr)

Link the SubProgram object passed as the second argument into the linked list at Vdbe.pSubProgram. This list is used to delete all sub-program objects when the VM is no longer required.

func Xsqlite3VdbeList

func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32

Give a listing of the program in the virtual machine.

The interface is the same as sqlite3VdbeExec(). But instead of running the code, it invokes the callback once for each instruction. This feature is used to implement "EXPLAIN".

When p->explain==1, each instruction is listed. When p->explain==2, only OP_Explain instructions are listed and these are shown in a different format. p->explain==2 is used to implement EXPLAIN QUERY PLAN. 2018-04-24: In p->explain==2 mode, the OP_Init opcodes of triggers are also shown, so that the boundaries between the main program and each trigger are clear.

When p->explain==1, first the main program is listed, then each of the trigger subprograms are listed one by one.

func Xsqlite3VdbeLoadString

func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr) int32

Generate code to cause the string zStr to be loaded into register iDest

func Xsqlite3VdbeMakeLabel

func Xsqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) int32

Create a new symbolic label for an instruction that has yet to be coded. The symbolic label is really just a negative number. The label can be used as the P2 value of an operation. Later, when the label is resolved to a specific address, the VDBE will scan through its operation list and change all values of P2 which match the label into the resolved address.

The VDBE knows that a P2 value is a label because labels are always negative and P2 values are suppose to be non-negative. Hence, a negative P2 value is a label that has yet to be resolved. (Later:) This is only true for opcodes that have the OPFLG_JUMP property.

Variable usage notes:

Parse.aLabel[x]     Stores the address that the x-th label resolves
                    into.  For testing (SQLITE_DEBUG), unresolved
                    labels stores -1, but that is not required.
Parse.nLabelAlloc   Number of slots allocated to Parse.aLabel[]
Parse.nLabel        The *negative* of the number of labels that have
                    been issued.  The negative is stored because
                    that gives a performance improvement over storing
                    the equivalent positive value.

func Xsqlite3VdbeMakeReady

func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr)

Prepare a virtual machine for execution for the first time after creating the virtual machine. This involves things such as allocating registers and initializing the program counter. After the VDBE has be prepped, it can be executed by one or more calls to sqlite3VdbeExec().

This function may be called exactly once on each virtual machine. After this routine is called the VM has been "packaged" and is ready to run. After this routine is called, further calls to sqlite3VdbeAddOp() functions are prohibited. This routine disconnects the Vdbe from the Parse object that helped generate it so that the the Vdbe becomes an independent entity and the Parse object can be destroyed.

Use the sqlite3VdbeRewind() procedure to restore a virtual machine back to its initial state after it has been run.

func Xsqlite3VdbeMemAggValue

func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) int32

Memory cell pAccum contains the context of an aggregate function. This routine calls the xValue method for that function and stores the results in memory cell pMem.

SQLITE_ERROR is returned if xValue() reports an error. SQLITE_OK otherwise.

func Xsqlite3VdbeMemCast

func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32

Cast the datatype of the value in pMem according to the affinity "aff". Casting is different from applying affinity in that a cast is forced. In other words, the value is converted into the desired affinity even if that results in loss of data. This routine is used (for example) to implement the SQL "cast()" operator.

func Xsqlite3VdbeMemClearAndResize

func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int32

Change the pMem->zMalloc allocation to be at least szNew bytes. If pMem->zMalloc already meets or exceeds the requested size, this routine is a no-op.

Any prior string or blob content in the pMem object may be discarded. The pMem->xDel destructor is called, if it exists. Though MEM_Str and MEM_Blob values may be discarded, MEM_Int, MEM_Real, MEM_IntReal, and MEM_Null values are preserved.

Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM) if unable to complete the resizing.

func Xsqlite3VdbeMemCopy

func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32

Make a full copy of pFrom into pTo. Prior contents of pTo are freed before the copy is made.

func Xsqlite3VdbeMemExpandBlob

func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32

If the given Mem* has a zero-filled tail, turn it into an ordinary blob stored in dynamically allocated space.

func Xsqlite3VdbeMemFinalize

func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32

Memory cell pMem contains the context of an aggregate function. This routine calls the finalize method for that function. The result of the aggregate is stored back into pMem.

Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK otherwise.

func Xsqlite3VdbeMemFromBtree

func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32

Move data out of a btree key or data field and into a Mem structure. The data is payload from the entry that pCur is currently pointing to. offset and amt determine what portion of the data or key to retrieve. The result is written into the pMem element.

The pMem object must have been initialized. This routine will use pMem->zMalloc to hold the content from the btree, if possible. New pMem->zMalloc space will be allocated if necessary. The calling routine is responsible for making sure that the pMem object is eventually destroyed.

If this routine fails for any reason (malloc returns NULL or unable to read from the disk) then the pMem is left in an inconsistent state.

func Xsqlite3VdbeMemFromBtreeZeroOffset

func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pMem uintptr) int32

func Xsqlite3VdbeMemGrow

func Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) int32

Make sure pMem->z points to a writable allocation of at least n bytes.

If the bPreserve argument is true, then copy of the content of pMem->z into the new allocation. pMem must be either a string or blob if bPreserve is true. If bPreserve is false, any prior content in pMem->z is discarded.

func Xsqlite3VdbeMemHandleBom

func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32

This routine checks for a byte-order mark at the beginning of the UTF-16 string stored in *pMem. If one is present, it is removed and the encoding of the Mem adjusted. This routine does not do any byte-swapping, it just sets Mem.enc appropriately.

The allocation (static, dynamic etc.) and encoding of the Mem may be changed by this function.

func Xsqlite3VdbeMemInit

func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16)

Initialize bulk memory to be a consistent Mem object.

The minimum amount of initialization feasible is performed.

func Xsqlite3VdbeMemIntegerify

func Xsqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) int32

Convert pMem to type integer. Invalidate any prior representations.

func Xsqlite3VdbeMemMakeWriteable

func Xsqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) int32

Change pMem so that its MEM_Str or MEM_Blob value is stored in MEM.zMalloc, where it can be safely written.

Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.

func Xsqlite3VdbeMemMove

func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr)

Transfer the contents of pFrom to pTo. Any existing value in pTo is freed. If pFrom contains ephemeral data, a copy is made.

pFrom contains an SQL NULL when this routine returns.

func Xsqlite3VdbeMemNulTerminate

func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32

Make sure the given Mem is \u0000 terminated.

func Xsqlite3VdbeMemNumerify

func Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32

Convert pMem so that it has type MEM_Real or MEM_Int. Invalidate any prior representations.

Every effort is made to force the conversion, even if the input is a string that does not look completely like a number. Convert as much of the string as we can and ignore the rest.

func Xsqlite3VdbeMemRealify

func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32

Convert pMem so that it is of type MEM_Real. Invalidate any prior representations.

func Xsqlite3VdbeMemRelease

func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr)

Release any memory resources held by the Mem. Both the memory that is free by Mem.xDel and the Mem.zMalloc allocation are freed.

Use this routine prior to clean up prior to abandoning a Mem, or to reset a Mem back to its minimum memory utilization.

Use sqlite3VdbeMemSetNull() to release just the Mem.xDel space prior to inserting new content into the Mem.

func Xsqlite3VdbeMemSetDouble

func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64)

Delete any previous value and set the value stored in *pMem to val, manifest type REAL.

func Xsqlite3VdbeMemSetInt64

func Xsqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val I64)

Delete any previous value and set the value stored in *pMem to val, manifest type INTEGER.

func Xsqlite3VdbeMemSetNull

func Xsqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr)

Delete any previous value and set the value stored in *pMem to NULL.

This routine calls the Mem.xDel destructor to dispose of values that require the destructor. But it preserves the Mem.zMalloc memory allocation. To free all resources, use sqlite3VdbeMemRelease(), which both calls this routine to invoke the destructor and deallocates Mem.zMalloc.

Use this routine to reset the Mem prior to insert a new value.

Use sqlite3VdbeMemRelease() to complete erase the Mem prior to abandoning it.

func Xsqlite3VdbeMemSetPointer

func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr)

Set the value stored in *pMem should already be a NULL. Also store a pointer to go with it.

func Xsqlite3VdbeMemSetRowSet

func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32

Delete any previous value and set the value of pMem to be an empty boolean index.

Return SQLITE_OK on success and SQLITE_NOMEM if a memory allocation error occurs.

func Xsqlite3VdbeMemSetStr

func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n I64, enc U8, xDel uintptr) int32

Change the value of a Mem to be a string or a BLOB.

The memory management strategy depends on the value of the xDel parameter. If the value passed is SQLITE_TRANSIENT, then the string is copied into a (possibly existing) buffer managed by the Mem structure. Otherwise, any existing buffer is freed and the pointer copied.

If the string is too large (if it exceeds the SQLITE_LIMIT_LENGTH size limit) then no memory allocation occurs. If the string can be stored without allocating memory, then it is. If a memory allocation is required to store the string, then value of pMem is unchanged. In either case, SQLITE_TOOBIG is returned.

func Xsqlite3VdbeMemSetZeroBlob

func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32)

Delete any previous value and set the value to be a BLOB of length n containing all zeros.

func Xsqlite3VdbeMemShallowCopy

func Xsqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcType int32)

func Xsqlite3VdbeMemStringify

func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) int32

Add MEM_Str to the set of representations for the given Mem. This routine is only called if pMem is a number of some kind, not a NULL or a BLOB.

Existing representations MEM_Int, MEM_Real, or MEM_IntReal are invalidated if bForce is true but are retained if bForce is false.

A MEM_Null value will never be passed to this function. This function is used for converting values to text for returning to the user (i.e. via sqlite3_value_text()), or for ensuring that values to be used as btree keys are strings. In the former case a NULL pointer is returned the user and the latter is an internal programming error.

func Xsqlite3VdbeMemTooBig

func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32

Return true if the Mem object contains a TEXT or BLOB that is too large - whose size exceeds SQLITE_MAX_LENGTH.

func Xsqlite3VdbeMemTranslate

func Xsqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc U8) int32

This routine transforms the internal text encoding used by pMem to desiredEnc. It is an error if the string is already of the desired encoding, or if *pMem does not contain a string value.

func Xsqlite3VdbeMultiLoad

func Xsqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr, va uintptr)

Generate code that initializes multiple registers to string or integer constants. The registers begin with iDest and increase consecutively. One register is initialized for each characgter in zTypes[]. For each "s" character in zTypes[], the register is a string if the argument is not NULL, or OP_Null if the value is a null pointer. For each "i" character in zTypes[], the register is initialized to an integer.

If the input string does not end with "X" then an OP_ResultRow instruction is generated for the values inserted.

func Xsqlite3VdbeNextOpcode

func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, piPc uintptr, piAddr uintptr, paOp uintptr) int32

Locate the next opcode to be displayed in EXPLAIN or EXPLAIN QUERY PLAN output.

Return SQLITE_ROW on success. Return SQLITE_DONE if there are no more opcodes to be displayed.

func Xsqlite3VdbeNoopComment

func Xsqlite3VdbeNoopComment(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr)

func Xsqlite3VdbeParameterIndex

func Xsqlite3VdbeParameterIndex(tls *libc.TLS, p uintptr, zName uintptr, nName int32) int32

Given a wildcard parameter name, return the index of the variable with that name. If there is no variable with the given name, return 0.

func Xsqlite3VdbeParser

func Xsqlite3VdbeParser(tls *libc.TLS, p uintptr) uintptr

Return the Parse object that owns a Vdbe object.

func Xsqlite3VdbePreUpdateHook

func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 I64, iReg int32, iBlobWrite int32)

Invoke the pre-update hook. If this is an UPDATE or DELETE pre-update call, then cursor passed as the second argument should point to the row about to be update or deleted. If the application calls sqlite3_preupdate_old(), the required value will be read from the row the cursor points to.

func Xsqlite3VdbeRealValue

func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64

func Xsqlite3VdbeRecordCompare

func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32

func Xsqlite3VdbeRecordCompareWithSkip

func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr, bSkip int32) int32

This function compares the two table rows or index records specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero or positive integer if key1 is less than, equal to or greater than key2. The {nKey1, pKey1} key must be a blob created by the OP_MakeRecord opcode of the VDBE. The pPKey2 key must be a parsed key such as obtained from sqlite3VdbeParseRecord.

If argument bSkip is non-zero, it is assumed that the caller has already determined that the first fields of the keys are equal.

Key1 and Key2 do not have to contain the same number of fields. If all fields that appear in both keys are equal, then pPKey2->default_rc is returned.

If database corruption is discovered, set pPKey2->errCode to SQLITE_CORRUPT and return 0. If an OOM error is encountered, pPKey2->errCode is set to SQLITE_NOMEM and, if it is not NULL, the malloc-failed flag set on database handle (pPKey2->pKeyInfo->db).

func Xsqlite3VdbeRecordUnpack

func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr, p uintptr)

Given the nKey-byte encoding of a record in pKey[], populate the UnpackedRecord structure indicated by the fourth argument with the contents of the decoded record.

func Xsqlite3VdbeReset

func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32

Clean up a VDBE after execution but do not delete the VDBE just yet. Write any error messages into *pzErrMsg. Return the result code.

After this routine is run, the VDBE should be ready to be executed again.

To look at it another way, this routine resets the state of the virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to VDBE_MAGIC_INIT.

func Xsqlite3VdbeResetStepResult

func Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr)

Each VDBE holds the result of the most recent sqlite3_step() call in p->rc. This routine sets that result back to SQLITE_OK.

func Xsqlite3VdbeResolveLabel

func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32)

func Xsqlite3VdbeReusable

func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr)

Mark the VDBE as one that can only be run multiple times.

func Xsqlite3VdbeRewind

func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr)

Rewind the VDBE back to the beginning in preparation for running it.

func Xsqlite3VdbeRunOnlyOnce

func Xsqlite3VdbeRunOnlyOnce(tls *libc.TLS, p uintptr)

Mark the VDBE as one that can only be run one time.

func Xsqlite3VdbeSetChanges

func Xsqlite3VdbeSetChanges(tls *libc.TLS, db uintptr, nChange int32)

This routine sets the value to be returned by subsequent calls to sqlite3_changes() on the database handle 'db'.

func Xsqlite3VdbeSetColName

func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) int32

Set the name of the idx'th column to be returned by the SQL statement. zName must be a pointer to a nul terminated string.

This call must be made after a call to sqlite3VdbeSetNumCols().

The final parameter, xDel, must be one of SQLITE_DYNAMIC, SQLITE_STATIC or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed.

func Xsqlite3VdbeSetNumCols

func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32)

Set the number of result columns that will be returned by this SQL statement. This is now set at compile time, rather than during execution of the vdbe program so that sqlite3_column_count() can be called on an SQL statement before sqlite3_step().

func Xsqlite3VdbeSetP4KeyInfo

func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr)

Set the P4 on the most recently added opcode to the KeyInfo for the index given.

func Xsqlite3VdbeSetSql

func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags U8)

Remember the SQL string for a prepared statement.

func Xsqlite3VdbeSetVarmask

func Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32)

Configure SQL variable iVar so that binding a new value to it signals to sqlite3_reoptimize() that re-preparing the statement may result in a better query plan.

func Xsqlite3VdbeSorterClose

func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr)

Free any cursor components allocated by sqlite3VdbeSorterXXX routines.

func Xsqlite3VdbeSorterCompare

func Xsqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCol int32, pRes uintptr) int32

Compare the key in memory cell pVal with the key that the sorter cursor passed as the first argument currently points to. For the purposes of the comparison, ignore the rowid field at the end of each record.

If the sorter cursor key contains any NULL values, consider it to be less than pVal. Even if pVal also contains NULL values.

If an error occurs, return an SQLite error code (i.e. SQLITE_NOMEM). Otherwise, set *pRes to a negative, zero or positive value if the key in pVal is smaller than, equal to or larger than the current sorter key.

This routine forms the core of the OP_SorterCompare opcode, which in turn is used to verify uniqueness when constructing a UNIQUE INDEX.

func Xsqlite3VdbeSorterInit

func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) int32

Initialize the temporary index cursor just opened as a sorter cursor.

Usually, the sorter module uses the value of (pCsr->pKeyInfo->nKeyField) to determine the number of fields that should be compared from the records being sorted. However, if the value passed as argument nField is non-zero and the sorter is able to guarantee a stable sort, nField is used instead. This is used when sorting records for a CREATE INDEX statement. In this case, keys are always delivered to the sorter in order of the primary key, which happens to be make up the final part of the records being sorted. So if the sort is stable, there is never any reason to compare PK fields and they can be ignored for a small performance boost.

The sorter can guarantee a stable sort when running in single-threaded mode, but not in multi-threaded mode.

SQLITE_OK is returned if successful, or an SQLite error code otherwise.

func Xsqlite3VdbeSorterNext

func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32

Advance to the next element in the sorter. Return value:

SQLITE_OK     success
SQLITE_DONE   end of data
otherwise     some kind of error.

func Xsqlite3VdbeSorterReset

func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr)

Reset a sorting cursor back to its original empty state.

func Xsqlite3VdbeSorterRewind

func Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32

Once the sorter has been populated by calls to sqlite3VdbeSorterWrite, this function is called to prepare for iterating through the records in sorted order.

func Xsqlite3VdbeSorterRowkey

func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32

Copy the current sorter key into the memory cell pOut.

func Xsqlite3VdbeSorterWrite

func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32

Add a record to the sorter.

func Xsqlite3VdbeSwap

func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr)

Swap all content between two VDBE structures.

func Xsqlite3VdbeTakeOpArray

func Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg uintptr) uintptr

This function returns a pointer to the array of opcodes associated with the Vdbe passed as the first argument. It is the callers responsibility to arrange for the returned array to be eventually freed using the vdbeFreeOpArray() function.

Before returning, *pnOp is set to the number of entries in the returned array. Also, *pnMaxArg is set to the larger of its current value and the number of entries in the Vdbe.apArg[] array required to execute the returned program.

func Xsqlite3VdbeTransferError

func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32

Copy the error code and error message belonging to the VDBE passed as the first argument to its database handle (so that they will be returned by calls to sqlite3_errcode() and sqlite3_errmsg()).

This function does not clear the VDBE error code or message, just copies them to the database handle.

func Xsqlite3VdbeUsesBtree

func Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32)

Declare to the Vdbe that the BTree object at db->aDb[i] is used.

The prepared statements need to know in advance the complete set of attached databases that will be use. A mask of these databases is maintained in p->btreeMask. The p->lockMask value is the subset of p->btreeMask of databases that will require a lock.

func Xsqlite3VectorErrorMsg

func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr)

Expression pExpr is a vector that has been used in a context where it is not permitted. If pExpr is a sub-select vector, this routine loads the Parse object with a message of the form:

"sub-select returns N columns - expected 1"

Or, if it is a regular scalar vector:

"row value misused"

func Xsqlite3VectorFieldSubexpr

func Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr

Return a pointer to a subexpression of pVector that is the i-th column of the vector (numbered starting with 0). The caller must ensure that i is within range.

If pVector is really a scalar (and "scalar" here includes subqueries that return a single column!) then return pVector unmodified.

pVector retains ownership of the returned subexpression.

If the vector is a (SELECT ...) then the expression returned is just the expression for the i-th term of the result set, and may not be ready for evaluation because the table cursor has not yet been positioned.

func Xsqlite3ViewGetColumnNames

func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) int32

The Table structure pTable is really a VIEW. Fill in the names of the columns of the view in the pTable structure. Return the number of errors. If an error is seen leave an error message in pParse->zErrMsg.

func Xsqlite3VtabArgExtend

func Xsqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr)

The parser calls this routine for each token after the first token in an argument to the module name in a CREATE VIRTUAL TABLE statement.

func Xsqlite3VtabArgInit

func Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr)

The parser calls this routine when it sees the first token of an argument to the module name in a CREATE VIRTUAL TABLE statement.

func Xsqlite3VtabBegin

func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32

If the virtual table pVtab supports the transaction interface (xBegin/xRollback/xCommit and optionally xSync) and a transaction is not currently open, invoke the xBegin method now.

If the xBegin call is successful, place the sqlite3_vtab pointer in the sqlite3.aVTrans array.

func Xsqlite3VtabBeginParse

func Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pModuleName uintptr, ifNotExists int32)

The parser calls this routine when it first sees a CREATE VIRTUAL TABLE statement. The module name has been parsed, but the optional list of parameters that follow the module name are still pending.

func Xsqlite3VtabCallConnect

func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32

This function is invoked by the parser to call the xConnect() method of the virtual table pTab. If an error occurs, an error code is returned and an error left in pParse.

This call is a no-op if table pTab is not a virtual table.

func Xsqlite3VtabCallCreate

func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, pzErr uintptr) int32

This function is invoked by the vdbe to call the xCreate method of the virtual table named zTab in database iDb.

If an error occurs, *pzErr is set to point to an English language description of the error and an SQLITE_XXX error code is returned. In this case the caller must call sqlite3DbFree(db, ) on *pzErr.

func Xsqlite3VtabCallDestroy

func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) int32

This function is invoked by the vdbe to call the xDestroy method of the virtual table named zTab in database iDb. This occurs when a DROP TABLE is mentioned.

This call is a no-op if zTab is not a virtual table.

func Xsqlite3VtabClear

func Xsqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr)

Clear any and all virtual-table information from the Table record. This routine is called, for example, just before deleting the Table record.

Since it is a virtual-table, the Table structure contains a pointer to the head of a linked list of VTable structures. Each VTable structure is associated with a single sqlite3* user of the schema. The reference count of the VTable structure associated with database connection db is decremented immediately (which may lead to the structure being xDisconnected and free). Any other VTable structures in the list are moved to the sqlite3.pDisconnect list of the associated database connection.

func Xsqlite3VtabCommit

func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32

Invoke the xCommit method of all virtual tables in the sqlite3.aVTrans array. Then clear the array itself.

func Xsqlite3VtabCreateModule

func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) uintptr

Construct and install a Module object for a virtual table. When this routine is called, it is guaranteed that all appropriate locks are held and the module is not already part of the connection.

If there already exists a module with zName, replace it with the new one. If pModule==0, then delete the module zName if it exists.

func Xsqlite3VtabDisconnect

func Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr)

Table *p is a virtual table. This function removes the VTable object for table *p associated with database connection db from the linked list in p->pVTab. It also decrements the VTable ref count. This is used when closing database connection db to free all of its VTable objects without disturbing the rest of the Schema object (which may be being used by other shared-cache connections).

func Xsqlite3VtabEponymousTableClear

func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr)

Erase the eponymous virtual table instance associated with virtual table module pMod, if it exists.

func Xsqlite3VtabEponymousTableInit

func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) int32

Check to see if virtual table module pMod can be have an eponymous virtual table instance. If it can, create one if one does not already exist. Return non-zero if the eponymous virtual table instance exists when this routine returns, and return zero if it does not exist.

An eponymous virtual table instance is one that is named after its module, and more importantly, does not require a CREATE VIRTUAL TABLE statement in order to come into existance. Eponymous virtual table instances always exist. They cannot be DROP-ed.

Any virtual table module for which xConnect and xCreate are the same method can have an eponymous virtual table instance.

func Xsqlite3VtabFinishParse

func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr)

The parser calls this routine after the CREATE VIRTUAL TABLE statement has been completely parsed.

func Xsqlite3VtabImportErrmsg

func Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr)

Transfer error message text from an sqlite3_vtab.zErrMsg (text stored in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored in memory obtained from sqlite3DbMalloc).

func Xsqlite3VtabLock

func Xsqlite3VtabLock(tls *libc.TLS, pVTab uintptr)

Lock the virtual table so that it cannot be disconnected. Locks nest. Every lock should have a corresponding unlock. If an unlock is omitted, resources leaks will occur.

If a disconnect is attempted while a virtual table is locked, the disconnect is deferred until all locks have been removed.

func Xsqlite3VtabMakeWritable

func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr)

Make sure virtual table pTab is contained in the pParse->apVirtualLock[] array so that an OP_VBegin will get generated for it. Add pTab to the array if it is missing. If pTab is already in the array, this routine is a no-op.

func Xsqlite3VtabModuleUnref

func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr)

Decrement the reference count on a Module object. Destroy the module when the reference count reaches zero.

func Xsqlite3VtabOverloadFunction

func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg int32, pExpr uintptr) uintptr

The first parameter (pDef) is a function implementation. The second parameter (pExpr) is the first argument to this function. If pExpr is a column in a virtual table, then let the virtual table implementation have an opportunity to overload the function.

This routine is used to allow virtual table implementations to overload MATCH, LIKE, GLOB, and REGEXP operators.

Return either the pDef argument (indicating no change) or a new FuncDef structure that is marked as ephemeral using the SQLITE_FUNC_EPHEM flag.

func Xsqlite3VtabRollback

func Xsqlite3VtabRollback(tls *libc.TLS, db uintptr) int32

Invoke the xRollback method of all virtual tables in the sqlite3.aVTrans array. Then clear the array itself.

func Xsqlite3VtabSavepoint

func Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32) int32

Invoke either the xSavepoint, xRollbackTo or xRelease method of all virtual tables that currently have an open transaction. Pass iSavepoint as the second argument to the virtual table method invoked.

If op is SAVEPOINT_BEGIN, the xSavepoint method is invoked. If it is SAVEPOINT_ROLLBACK, the xRollbackTo method. Otherwise, if op is SAVEPOINT_RELEASE, then the xRelease method of each virtual table with an open transaction is invoked.

If any virtual table method returns an error code other than SQLITE_OK, processing is abandoned and the error returned to the caller of this function immediately. If all calls to virtual table methods are successful, SQLITE_OK is returned.

func Xsqlite3VtabSync

func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32

Invoke the xSync method of all virtual tables in the sqlite3.aVTrans array. Return the error code for the first error that occurs, or SQLITE_OK if all xSync operations are successful.

If an error message is available, leave it in p->zErrMsg.

func Xsqlite3VtabUnlock

func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr)

Decrement the ref-count on a virtual table object. When the ref-count reaches zero, call the xDisconnect() method to delete the object.

func Xsqlite3VtabUnlockList

func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr)

Disconnect all the virtual table objects in the sqlite3.pDisconnect list.

This function may only be called when the mutexes associated with all shared b-tree databases opened using connection db are held by the caller. This is done to protect the sqlite3.pDisconnect list. The sqlite3.pDisconnect list is accessed only as follows:

  1. By this function. In this case, all BtShared mutexes and the mutex associated with the database handle itself must be held.

  2. By function vtabDisconnectAll(), when it adds a VTable entry to the sqlite3.pDisconnect list. In this case either the BtShared mutex associated with the database the virtual table is stored in is held or, if the virtual table is stored in a non-sharable database, then the database handle mutex is held.

As a result, a sqlite3.pDisconnect cannot be accessed simultaneously by multiple threads. It is thread-safe.

func Xsqlite3WalBeginReadTransaction

func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32

Begin a read transaction on the database.

This routine used to be called sqlite3OpenSnapshot() and with good reason: it takes a snapshot of the state of the WAL and wal-index for the current instant in time. The current thread will continue to use this snapshot. Other threads might append new content to the WAL and wal-index but that extra content is ignored by the current thread.

If the database contents have changes since the previous read transaction, then *pChanged is set to 1 before returning. The Pager layer will use this to know that its cache is stale and needs to be flushed.

func Xsqlite3WalBeginWriteTransaction

func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32

This function starts a write transaction on the WAL.

A read transaction must have already been started by a prior call to sqlite3WalBeginReadTransaction().

If another thread or process has written into the database since the read transaction was started, then it is not possible for this thread to write as doing so would cause a fork. So this routine returns SQLITE_BUSY in that case and no write transaction is started.

There can only be a single writer active at a time.

func Xsqlite3WalCallback

func Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32

Return the value to pass to a sqlite3_wal_hook callback, the number of frames in the WAL at the point of the last commit since sqlite3WalCallback() was called. If no commits have occurred since the last call, then return 0.

func Xsqlite3WalCheckpoint

func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) int32

This routine is called to implement sqlite3_wal_checkpoint() and related interfaces.

Obtain a CHECKPOINT lock and then backfill as much information as we can from WAL into the database.

If parameter xBusy is not NULL, it is a pointer to a busy-handler callback. In this case this function runs a blocking checkpoint.

func Xsqlite3WalClose

func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, nBuf int32, zBuf uintptr) int32

Close a connection to a log file.

func Xsqlite3WalDefaultHook

func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb uintptr, nFrame int32) int32

The sqlite3_wal_hook() callback registered by sqlite3_wal_autocheckpoint(). Invoke sqlite3_wal_checkpoint if the number of frames in the log file is greater than sqlite3.pWalArg cast to an integer (the value configured by wal_autocheckpoint()).

func Xsqlite3WalEndReadTransaction

func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr)

Finish with a read transaction. All this does is release the read-lock.

func Xsqlite3WalEndWriteTransaction

func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32

End a write transaction. The commit has already been done. This routine merely releases the lock.

func Xsqlite3WalExclusiveMode

func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32

This function is called to change the WAL subsystem into or out of locking_mode=EXCLUSIVE.

If op is zero, then attempt to change from locking_mode=EXCLUSIVE into locking_mode=NORMAL. This means that we must acquire a lock on the pWal->readLock byte. If the WAL is already in locking_mode=NORMAL or if the acquisition of the lock fails, then return 0. If the transition out of exclusive-mode is successful, return 1. This operation must occur while the pager is still holding the exclusive lock on the main database file.

If op is one, then change from locking_mode=NORMAL into locking_mode=EXCLUSIVE. This means that the pWal->readLock must be released. Return 1 if the transition is made and 0 if the WAL is already in exclusive-locking mode - meaning that this routine is a no-op. The pager must already hold the exclusive lock on the main database file before invoking this operation.

If op is negative, then do a dry-run of the op==1 case but do not actually change anything. The pager uses this to see if it should acquire the database exclusive lock prior to invoking the op==1 case.

func Xsqlite3WalFile

func Xsqlite3WalFile(tls *libc.TLS, pWal uintptr) uintptr

Return the sqlite3_file object for the WAL file

func Xsqlite3WalFindFrame

func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr) int32

Search the wal file for page pgno. If found, set *piRead to the frame that contains the page. Otherwise, if pgno is not in the wal file, set *piRead to zero.

Return SQLITE_OK if successful, or an error code if an error occurs. If an error does occur, the final value of *piRead is undefined.

func Xsqlite3WalFrames

func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTruncate Pgno, isCommit int32, sync_flags int32) int32

Write a set of frames to the log. The caller must hold the write-lock on the log file (obtained using sqlite3WalBeginWriteTransaction()).

func Xsqlite3WalHeapMemory

func Xsqlite3WalHeapMemory(tls *libc.TLS, pWal uintptr) int32

Return true if the argument is non-NULL and the WAL module is using heap-memory for the wal-index. Otherwise, if the argument is NULL or the WAL module is using shared-memory, return false.

func Xsqlite3WalLimit

func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64)

Change the size to which the WAL file is trucated on each reset.

func Xsqlite3WalOpen

func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr, bNoShm int32, mxWalSize I64, ppWal uintptr) int32

Open a connection to the WAL file zWalName. The database file must already be opened on connection pDbFd. The buffer that zWalName points to must remain valid for the lifetime of the returned Wal* handle.

A SHARED lock should be held on the database file when this function is called. The purpose of this SHARED lock is to prevent any other client from unlinking the WAL or wal-index file. If another process were to do this just after this client opened one of these files, the system would be badly broken.

If the log file is successfully opened, SQLITE_OK is returned and *ppWal is set to point to a new WAL handle. If an error occurs, an SQLite error code is returned and *ppWal is left unmodified.

func Xsqlite3WalReadFrame

func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32

Read the contents of frame iRead from the wal file into buffer pOut (which is nOut bytes in size). Return SQLITE_OK if successful, or an error code otherwise.

func Xsqlite3WalSavepoint

func Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr)

Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32 values. This function populates the array with values required to "rollback" the write position of the WAL handle back to the current point in the event of a savepoint rollback (via WalSavepointUndo()).

func Xsqlite3WalSavepointUndo

func Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int32

Move the write position of the WAL back to the point identified by the values in the aWalData[] array. aWalData must point to an array of WAL_SAVEPOINT_NDATA u32 values that has been previously populated by a call to WalSavepoint().

func Xsqlite3WalSnapshotCheck

func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) int32

The caller currently has a read transaction open on the database. This function takes a SHARED lock on the CHECKPOINTER slot and then checks if the snapshot passed as the second argument is still available. If so, SQLITE_OK is returned.

If the snapshot is not available, SQLITE_ERROR is returned. Or, if the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER lock is released before returning.

func Xsqlite3WalSnapshotGet

func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int32

Create a snapshot object. The content of a snapshot is opaque to every other subsystem, so the WAL module can put whatever it needs in the object.

func Xsqlite3WalSnapshotOpen

func Xsqlite3WalSnapshotOpen(tls *libc.TLS, pWal uintptr, pSnapshot uintptr)

Try to open on pSnapshot when the next read-transaction starts

func Xsqlite3WalSnapshotRecover

func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32

Attempt to reduce the value of the WalCkptInfo.nBackfillAttempted variable so that older snapshots can be accessed. To do this, loop through all wal frames from nBackfillAttempted to (nBackfill+1), comparing their content to the corresponding page with the database file, if any. Set nBackfillAttempted to the frame number of the first frame for which the wal file content matches the db file.

This is only really safe if the file-system is such that any page writes made by earlier checkpointers were atomic operations, which is not always true. It is also possible that nBackfillAttempted may be left set to a value larger than expected, if a wal frame contains content that duplicate of an earlier version of the same page.

SQLITE_OK is returned if successful, or an SQLite error code if an error occurs. It is not an error if nBackfillAttempted cannot be decreased at all.

func Xsqlite3WalSnapshotUnlock

func Xsqlite3WalSnapshotUnlock(tls *libc.TLS, pWal uintptr)

Release a lock obtained by an earlier successful call to sqlite3WalSnapshotCheck().

func Xsqlite3WalUndo

func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) int32

If any data has been written (but not committed) to the log file, this function moves the write-pointer back to the start of the transaction.

Additionally, the callback function is invoked for each frame written to the WAL since the start of the transaction. If the callback returns other than SQLITE_OK, it is not invoked again and the error code is returned to the caller.

Otherwise, if the callback function does not return an error, this function returns SQLITE_OK.

func Xsqlite3WalkExpr

func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32

func Xsqlite3WalkExprList

func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32

Call sqlite3WalkExpr() for every expression in list p or until an abort request is seen.

func Xsqlite3WalkSelect

func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32

Call sqlite3WalkExpr() for every expression in Select statement p. Invoke sqlite3WalkSelect() for subqueries in the FROM clause and on the compound select chain, p->pPrior.

If it is not NULL, the xSelectCallback() callback is invoked before the walk of the expressions and FROM clause. The xSelectCallback2() method is invoked following the walk of the expressions and FROM clause, but only if both xSelectCallback and xSelectCallback2 are both non-NULL and if the expressions and FROM clause both return WRC_Continue;

Return WRC_Continue under normal conditions. Return WRC_Abort if there is an abort request.

If the Walker does not have an xSelectCallback() then this routine is a no-op returning WRC_Continue.

func Xsqlite3WalkSelectExpr

func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32

Walk all expressions associated with SELECT statement p. Do not invoke the SELECT callback on p, but do (of course) invoke any expr callbacks and SELECT callbacks that come from subqueries. Return WRC_Abort or WRC_Continue.

func Xsqlite3WalkSelectFrom

func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32

Walk the parse trees associated with all subqueries in the FROM clause of SELECT statement p. Do not invoke the select callback on p, but do invoke it on each FROM clause subquery and on any subqueries further down in the tree. Return WRC_Abort or WRC_Continue;

func Xsqlite3WalkWinDefnDummyCallback

func Xsqlite3WalkWinDefnDummyCallback(tls *libc.TLS, pWalker uintptr, p uintptr)

This is a no-op callback for Walker->xSelectCallback2. If this callback is set, then the Select->pWinDefn list is traversed.

func Xsqlite3WalkerDepthDecrease

func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr)

func Xsqlite3WalkerDepthIncrease

func Xsqlite3WalkerDepthIncrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32

Increase the walkerDepth when entering a subquery, and descrease when leaving the subquery.

func Xsqlite3WhereBegin

func Xsqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pResultSet uintptr, wctrlFlags U16, iAuxArg int32) uintptr

Generate the beginning of the loop used for WHERE clause processing. The return value is a pointer to an opaque structure that contains information needed to terminate the loop. Later, the calling routine should invoke sqlite3WhereEnd() with the return value of this function in order to complete the WHERE clause processing.

If an error occurs, this routine returns NULL.

The basic idea is to do a nested loop, one loop for each table in the FROM clause of a select. (INSERT and UPDATE statements are the same as a SELECT with only a single table in the FROM clause.) For example, if the SQL is this:

SELECT * FROM t1, t2, t3 WHERE ...;

Then the code generated is conceptually like the following:

foreach row1 in t1 do       \    Code generated
  foreach row2 in t2 do      |-- by sqlite3WhereBegin()
    foreach row3 in t3 do   /
      ...
    end                     \    Code generated
  end                        |-- by sqlite3WhereEnd()
end                         /

Note that the loops might not be nested in the order in which they appear in the FROM clause if a different order is better able to make use of indices. Note also that when the IN operator appears in the WHERE clause, it might result in additional nested loops for scanning through all values on the right-hand side of the IN.

There are Btree cursors associated with each table. t1 uses cursor number pTabList->a[0].iCursor. t2 uses the cursor pTabList->a[1].iCursor. And so forth. This routine generates code to open those VDBE cursors and sqlite3WhereEnd() generates the code to close them.

The code that sqlite3WhereBegin() generates leaves the cursors named in pTabList pointing at their appropriate entries. The [...] code can use OP_Column and OP_Rowid opcodes on these cursors to extract data from the various tables of the loop.

If the WHERE clause is empty, the foreach loops must each scan their entire tables. Thus a three-way join is an O(N^3) operation. But if the tables have indices and there are terms in the WHERE clause that refer to those indices, a complete table scan can be avoided and the code will run much faster. Most of the work of this routine is checking to see if there are indices that can be used to speed up the loop.

Terms of the WHERE clause are also used to limit which rows actually make it to the "..." in the middle of the loop. After each "foreach", terms of the WHERE clause that use only terms in that loop and outer loops are evaluated and if false a jump is made around all subsequent inner loops (or around the "..." if the test occurs within the inner- most loop)

OUTER JOINS

An outer join of tables t1 and t2 is conceptally coded as follows:

foreach row1 in t1 do
  flag = 0
  foreach row2 in t2 do
    start:
      ...
      flag = 1
  end
  if flag==0 then
    move the row2 cursor to a null row
    goto start
  fi
end

ORDER BY CLAUSE PROCESSING

pOrderBy is a pointer to the ORDER BY clause (or the GROUP BY clause if the WHERE_GROUPBY flag is set in wctrlFlags) of a SELECT statement if there is one. If there is no ORDER BY clause or if this routine is called from an UPDATE or DELETE statement, then pOrderBy is NULL.

The iIdxCur parameter is the cursor number of an index. If WHERE_OR_SUBCLAUSE is set, iIdxCur is the cursor number of an index to use for OR clause processing. The WHERE clause should use this specific cursor. If WHERE_ONEPASS_DESIRED is set, then iIdxCur is the first cursor in an array of cursors for all indices. iIdxCur should be used to compute the appropriate cursor depending on which index is used.

func Xsqlite3WhereBreakLabel

func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32

Return the VDBE address or label to jump to in order to break out of a WHERE loop.

func Xsqlite3WhereClauseClear

func Xsqlite3WhereClauseClear(tls *libc.TLS, pWC uintptr)

Deallocate a WhereClause structure. The WhereClause structure itself is not freed. This routine is the inverse of sqlite3WhereClauseInit().

func Xsqlite3WhereClauseInit

func Xsqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr)

Initialize a preallocated WhereClause structure.

func Xsqlite3WhereContinueLabel

func Xsqlite3WhereContinueLabel(tls *libc.TLS, pWInfo uintptr) int32

Return the VDBE address or label to jump to in order to continue immediately with the next row of a WHERE clause.

func Xsqlite3WhereEnd

func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr)

Generate the end of the WHERE loop. See comments on sqlite3WhereBegin() for additional information.

func Xsqlite3WhereExplainOneScan

func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags U16) int32

This function is a no-op unless currently processing an EXPLAIN QUERY PLAN command, or if either SQLITE_DEBUG or SQLITE_ENABLE_STMT_SCANSTATUS was defined at compile-time. If it is not a no-op, a single OP_Explain opcode is added to the output to describe the table scan strategy in pLevel.

If an OP_Explain opcode is added to the VM, its address is returned. Otherwise, if no OP_Explain is coded, zero is returned.

func Xsqlite3WhereExprAnalyze

func Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr)

Call exprAnalyze on all terms in a WHERE clause.

Note that exprAnalyze() might add new virtual terms onto the end of the WHERE clause. We do not want to analyze these new virtual terms, so start analyzing at the end and work forward so that the added virtual terms are never processed.

func Xsqlite3WhereFindTerm

func Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32, notReady Bitmask, op U32, pIdx uintptr) uintptr

Search for a term in the WHERE clause that is of the form "X <op> <expr>" where X is a reference to the iColumn of table iCur or of index pIdx if pIdx!=0 and <op> is one of the WO_xx operator codes specified by the op parameter. Return a pointer to the term. Return 0 if not found.

If pIdx!=0 then it must be one of the indexes of table iCur. Search for terms matching the iColumn-th column of pIdx rather than the iColumn-th column of table iCur.

The term returned might by Y=<expr> if there is another constraint in the WHERE clause that specifies that X=Y. Any such constraints will be identified by the WO_EQUIV bit in the pTerm->eOperator field. The aiCur[]/iaColumn[] arrays hold X and all its equivalents. There are 11 slots in aiCur[]/aiColumn[] so that means we can look for X plus up to 10 other equivalent values. Hence a search for X will return <expr> if X=A1 and A1=A2 and A2=A3 and ... and A9=A10 and A10=<expr>.

If there are multiple terms in the WHERE clause of the form "X <op> <expr>" then try for the one with no dependencies on <expr> - in other words where <expr> is a constant expression of some kind. Only return entries of the form "X <op> Y" where Y is a column in another table if no terms of the form "X <op> <const-expr>" exist. If no terms with a constant RHS exist, try to return a term that does not use WO_EQUIV.

func Xsqlite3WhereIsDistinct

func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32

Return one of the WHERE_DISTINCT_xxxxx values to indicate how this WHERE clause returns outputs for DISTINCT processing.

func Xsqlite3WhereIsOrdered

func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32

Return the number of ORDER BY terms that are satisfied by the WHERE clause. A return of 0 means that the output must be completely sorted. A return equal to the number of ORDER BY terms means that no sorting is needed at all. A return that is positive but less than the number of ORDER BY terms means that block sorting is required.

func Xsqlite3WhereIsSorted

func Xsqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) int32

If the WHERE_GROUPBY flag is set in the mask passed to sqlite3WhereBegin(), the planner assumes that the specified pOrderBy list is actually a GROUP BY clause - and so any order that groups rows as required satisfies the request.

Normally, in this case it is not possible for the caller to determine whether or not the rows are really being delivered in sorted order, or just in some other order that provides the required grouping. However, if the WHERE_SORTBYGROUP flag is also passed to sqlite3WhereBegin(), then this function may be called on the returned WhereInfo object. It returns true if the rows really will be sorted in the specified order, or false otherwise.

For example, assuming:

CREATE INDEX i1 ON t1(x, Y);

then

SELECT * FROM t1 GROUP BY x,y ORDER BY x,y;   -- IsSorted()==1
SELECT * FROM t1 GROUP BY y,x ORDER BY y,x;   -- IsSorted()==0

func Xsqlite3WhereMinMaxOptEarlyOut

func Xsqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr)

While generating code for the min/max optimization, after handling the aggregate-step call to min() or max(), check to see if any additional looping is required. If the output order is such that we are certain that the correct answer has already been found, then code an OP_Goto to by pass subsequent processing.

Any extra OP_Goto that is coded here is an optimization. The correct answer should be obtained regardless. This OP_Goto just makes the answer appear faster.

func Xsqlite3WhereOkOnePass

func Xsqlite3WhereOkOnePass(tls *libc.TLS, pWInfo uintptr, aiCur uintptr) int32

Return ONEPASS_OFF (0) if an UPDATE or DELETE statement is unable to operate directly on the rowids returned by a WHERE clause. Return ONEPASS_SINGLE (1) if the statement can operation directly because only a single row is to be changed. Return ONEPASS_MULTI (2) if the one-pass optimization can be used on multiple

If the ONEPASS optimization is used (if this routine returns true) then also write the indices of open cursors used by ONEPASS into aiCur[0] and aiCur[1]. iaCur[0] gets the cursor of the data table and iaCur[1] gets the cursor used by an auxiliary index. Either value may be -1, indicating that cursor is not used. Any cursors returned will have been opened for writing.

aiCur[0] and aiCur[1] both get -1 if the where-clause logic is unable to use the ONEPASS optimization.

func Xsqlite3WhereOrderByLimitOptLabel

func Xsqlite3WhereOrderByLimitOptLabel(tls *libc.TLS, pWInfo uintptr) int32

In the ORDER BY LIMIT optimization, if the inner-most loop is known to emit rows in increasing order, and if the last row emitted by the inner-most loop did not fit within the sorter, then we can skip all subsequent rows for the current iteration of the inner loop (because they will not fit in the sorter either) and continue with the second inner loop - the loop immediately outside the inner-most.

When a row does not fit in the sorter (because the sorter already holds LIMIT+OFFSET rows that are smaller), then a jump is made to the label returned by this function.

If the ORDER BY LIMIT optimization applies, the jump destination should be the continuation for the second-inner-most loop. If the ORDER BY LIMIT optimization does not apply, then the jump destination should be the continuation for the inner-most loop.

It is always safe for this routine to return the continuation of the inner-most loop, in the sense that a correct answer will result. Returning the continuation the second inner loop is an optimization that might make the code run a little faster, but should not change the final answer.

func Xsqlite3WhereSplit

func Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8)

This routine identifies subexpressions in the WHERE clause where each subexpression is separated by the AND operator or some other operator specified in the op parameter. The WhereClause structure is filled with pointers to subexpressions. For example:

WHERE  a=='hello' AND coalesce(b,11)<10 AND (c+12!=d OR c==22)
       \________/     \_______________/     \________________/
        slot[0]            slot[1]               slot[2]

The original WHERE clause in pExpr is unaltered. All this routine does is make slot[] entries point to substructure within pExpr.

In the previous sentence and in the diagram, "slot[]" refers to the WhereClause.a[] array. The slot[] array grows as needed to contain all terms of the WHERE clause.

func Xsqlite3WhereTabFuncArgs

func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC uintptr)

For table-valued-functions, transform the function arguments into new WHERE clause terms.

Each function argument translates into an equality constraint against a HIDDEN column in the table.

func Xsqlite3WhereUsesDeferredSeek

func Xsqlite3WhereUsesDeferredSeek(tls *libc.TLS, pWInfo uintptr) int32

Return TRUE if the WHERE loop uses the OP_DeferredSeek opcode to move the data cursor to the row selected by the index cursor.

func Xsqlite3WindowAlloc

func Xsqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int32, pStart uintptr, eEnd int32, pEnd uintptr, eExclude U8) uintptr

Allocate and return a new Window object describing a Window Definition.

func Xsqlite3WindowAssemble

func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartition uintptr, pOrderBy uintptr, pBase uintptr) uintptr

Attach PARTITION and ORDER BY clauses pPartition and pOrderBy to window pWin. Also, if parameter pBase is not NULL, set pWin->zBase to the equivalent nul-terminated string.

func Xsqlite3WindowAttach

func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr)

Attach window object pWin to expression p.

func Xsqlite3WindowChain

func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uintptr)

Window *pWin has just been created from a WINDOW clause. Tokne pBase is the base window. Earlier windows from the same WINDOW clause are stored in the linked list starting at pWin->pNextWin. This function either updates *pWin according to the base specification, or else leaves an error in pParse.

func Xsqlite3WindowCodeInit

func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr)

This is called by code in select.c before it calls sqlite3WhereBegin() to begin iterating through the sub-query results. It is used to allocate and initialize registers and cursors used by sqlite3WindowCodeStep().

func Xsqlite3WindowCodeStep

func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uintptr, regGosub int32, addrGosub int32)

sqlite3WhereBegin() has already been called for the SELECT statement passed as the second argument when this function is invoked. It generates code to populate the Window.regResult register for each window function and invoke the sub-routine at instruction addrGosub once for each row. sqlite3WhereEnd() is always called before returning.

This function handles several different types of window frames, which require slightly different processing. The following pseudo code is used to implement window frames of the form:

ROWS BETWEEN <expr1> PRECEDING AND <expr2> FOLLOWING

Other window frame types use variants of the following:

... loop started by sqlite3WhereBegin() ...
  if( new partition ){
    Gosub flush
  }
  Insert new row into eph table.

  if( first row of partition ){
    // Rewind three cursors, all open on the eph table.
    Rewind(csrEnd);
    Rewind(csrStart);
    Rewind(csrCurrent);

    regEnd = <expr2>          // FOLLOWING expression
    regStart = <expr1>        // PRECEDING expression
  }else{
    // First time this branch is taken, the eph table contains two
    // rows. The first row in the partition, which all three cursors
    // currently point to, and the following row.
    AGGSTEP
    if( (regEnd--)<=0 ){
      RETURN_ROW
      if( (regStart--)<=0 ){
        AGGINVERSE
      }
    }
  }
}
flush:
  AGGSTEP
  while( 1 ){
    RETURN ROW
    if( csrCurrent is EOF ) break;
    if( (regStart--)<=0 ){
      AggInverse(csrStart)
      Next(csrStart)
    }
  }

The pseudo-code above uses the following shorthand:

AGGSTEP:    invoke the aggregate xStep() function for each window function
            with arguments read from the current row of cursor csrEnd, then
            step cursor csrEnd forward one row (i.e. sqlite3BtreeNext()).

RETURN_ROW: return a row to the caller based on the contents of the
            current row of csrCurrent and the current state of all
            aggregates. Then step cursor csrCurrent forward one row.

AGGINVERSE: invoke the aggregate xInverse() function for each window
            functions with arguments read from the current row of cursor
            csrStart. Then step csrStart forward one row.

There are two other ROWS window frames that are handled significantly differently from the above - "BETWEEN <expr> PRECEDING AND <expr> PRECEDING" and "BETWEEN <expr> FOLLOWING AND <expr> FOLLOWING". These are special cases because they change the order in which the three cursors (csrStart, csrCurrent and csrEnd) iterate through the ephemeral table. Cases that use UNBOUNDED or CURRENT ROW are much simpler variations on one of these three.

ROWS BETWEEN <expr1> PRECEDING AND <expr2> PRECEDING

  ... loop started by sqlite3WhereBegin() ...
    if( new partition ){
      Gosub flush
    }
    Insert new row into eph table.
    if( first row of partition ){
      Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
      regEnd = <expr2>
      regStart = <expr1>
    }else{
      if( (regEnd--)<=0 ){
        AGGSTEP
      }
      RETURN_ROW
      if( (regStart--)<=0 ){
        AGGINVERSE
      }
    }
  }
  flush:
    if( (regEnd--)<=0 ){
      AGGSTEP
    }
    RETURN_ROW

ROWS BETWEEN <expr1> FOLLOWING AND <expr2> FOLLOWING

  ... loop started by sqlite3WhereBegin() ...
  if( new partition ){
    Gosub flush
  }
  Insert new row into eph table.
  if( first row of partition ){
    Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
    regEnd = <expr2>
    regStart = regEnd - <expr1>
  }else{
    AGGSTEP
    if( (regEnd--)<=0 ){
      RETURN_ROW
    }
    if( (regStart--)<=0 ){
      AGGINVERSE
    }
  }
}
flush:
  AGGSTEP
  while( 1 ){
    if( (regEnd--)<=0 ){
      RETURN_ROW
      if( eof ) break;
    }
    if( (regStart--)<=0 ){
      AGGINVERSE
      if( eof ) break
    }
  }
  while( !eof csrCurrent ){
    RETURN_ROW
  }

For the most part, the patterns above are adapted to support UNBOUNDED by assuming that it is equivalent to "infinity PRECEDING/FOLLOWING" and CURRENT ROW by assuming that it is equivilent to "0 PRECEDING/FOLLOWING". This is optimized of course - branches that will never be taken and conditions that are always true are omitted from the VM code. The only exceptional case is:

ROWS BETWEEN <expr1> FOLLOWING AND UNBOUNDED FOLLOWING

  ... loop started by sqlite3WhereBegin() ...
  if( new partition ){
    Gosub flush
  }
  Insert new row into eph table.
  if( first row of partition ){
    Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
    regStart = <expr1>
  }else{
    AGGSTEP
  }
}
flush:
  AGGSTEP
  while( 1 ){
    if( (regStart--)<=0 ){
      AGGINVERSE
      if( eof ) break
    }
    RETURN_ROW
  }
  while( !eof csrCurrent ){
    RETURN_ROW
  }

Also requiring special handling are the cases:

ROWS BETWEEN <expr1> PRECEDING AND <expr2> PRECEDING
ROWS BETWEEN <expr1> FOLLOWING AND <expr2> FOLLOWING

when (expr1 < expr2). This is detected at runtime, not by this function. To handle this case, the pseudo-code programs depicted above are modified slightly to be:

... loop started by sqlite3WhereBegin() ...
if( new partition ){
  Gosub flush
}
Insert new row into eph table.
if( first row of partition ){
  Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
  regEnd = <expr2>
  regStart = <expr1>
  if( regEnd < regStart ){
    RETURN_ROW
    delete eph table contents
    continue
  }
...

The new "continue" statement in the above jumps to the next iteration of the outer loop - the one started by sqlite3WhereBegin().

The various GROUPS cases are implemented using the same patterns as ROWS. The VM code is modified slightly so that:

  1. The else branch in the main loop is only taken if the row just added to the ephemeral table is the start of a new group. In other words, it becomes:

    ... loop started by sqlite3WhereBegin() ... if( new partition ){ Gosub flush } Insert new row into eph table. if( first row of partition ){ Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent) regEnd = <expr2> regStart = <expr1> }else if( new group ){ ... } }

  2. Instead of processing a single row, each RETURN_ROW, AGGSTEP or AGGINVERSE step processes the current row of the relevant cursor and all subsequent rows belonging to the same group.

RANGE window frames are a little different again. As for GROUPS, the main loop runs once per group only. And RETURN_ROW, AGGSTEP and AGGINVERSE deal in groups instead of rows. As for ROWS and GROUPS, there are three basic cases:

RANGE BETWEEN <expr1> PRECEDING AND <expr2> FOLLOWING

  ... loop started by sqlite3WhereBegin() ...
    if( new partition ){
      Gosub flush
    }
    Insert new row into eph table.
    if( first row of partition ){
      Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
      regEnd = <expr2>
      regStart = <expr1>
    }else{
      AGGSTEP
      while( (csrCurrent.key + regEnd) < csrEnd.key ){
        RETURN_ROW
        while( csrStart.key + regStart) < csrCurrent.key ){
          AGGINVERSE
        }
      }
    }
  }
  flush:
    AGGSTEP
    while( 1 ){
      RETURN ROW
      if( csrCurrent is EOF ) break;
        while( csrStart.key + regStart) < csrCurrent.key ){
          AGGINVERSE
        }
      }
    }

In the above notation, "csr.key" means the current value of the ORDER BY expression (there is only ever 1 for a RANGE that uses an <expr> FOLLOWING or <expr PRECEDING) read from cursor csr.

RANGE BETWEEN <expr1> PRECEDING AND <expr2> PRECEDING

  ... loop started by sqlite3WhereBegin() ...
    if( new partition ){
      Gosub flush
    }
    Insert new row into eph table.
    if( first row of partition ){
      Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
      regEnd = <expr2>
      regStart = <expr1>
    }else{
      while( (csrEnd.key + regEnd) <= csrCurrent.key ){
        AGGSTEP
      }
      while( (csrStart.key + regStart) < csrCurrent.key ){
        AGGINVERSE
      }
      RETURN_ROW
    }
  }
  flush:
    while( (csrEnd.key + regEnd) <= csrCurrent.key ){
      AGGSTEP
    }
    while( (csrStart.key + regStart) < csrCurrent.key ){
      AGGINVERSE
    }
    RETURN_ROW

RANGE BETWEEN <expr1> FOLLOWING AND <expr2> FOLLOWING

  ... loop started by sqlite3WhereBegin() ...
    if( new partition ){
      Gosub flush
    }
    Insert new row into eph table.
    if( first row of partition ){
      Rewind(csrEnd) ; Rewind(csrStart) ; Rewind(csrCurrent)
      regEnd = <expr2>
      regStart = <expr1>
    }else{
      AGGSTEP
      while( (csrCurrent.key + regEnd) < csrEnd.key ){
        while( (csrCurrent.key + regStart) > csrStart.key ){
          AGGINVERSE
        }
        RETURN_ROW
      }
    }
  }
  flush:
    AGGSTEP
    while( 1 ){
      while( (csrCurrent.key + regStart) > csrStart.key ){
        AGGINVERSE
        if( eof ) break "while( 1 )" loop.
      }
      RETURN_ROW
    }
    while( !eof csrCurrent ){
      RETURN_ROW
    }

The text above leaves out many details. Refer to the code and comments below for a more complete picture.

func Xsqlite3WindowCompare

func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr, bFilter int32) int32

Return 0 if the two window objects are identical, 1 if they are different, or 2 if it cannot be determined if the objects are identical or not. Identical window objects can be processed in a single scan.

func Xsqlite3WindowDelete

func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr)

Free the Window object passed as the second argument.

func Xsqlite3WindowDup

func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uintptr

Allocate and return a duplicate of the Window object indicated by the third argument. Set the Window.pOwner field of the new object to pOwner.

func Xsqlite3WindowFunctions

func Xsqlite3WindowFunctions(tls *libc.TLS)

Register those built-in window functions that are not also aggregates.

func Xsqlite3WindowLink(tls *libc.TLS, pSel uintptr, pWin uintptr)

Possibly link window pWin into the list at pSel->pWin (window functions to be processed as part of SELECT statement pSel). The window is linked in if either (a) there are no other windows already linked to this SELECT, or (b) the windows already linked use a compatible window frame.

func Xsqlite3WindowListDelete

func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr)

Free the linked list of Window objects starting at the second argument.

func Xsqlite3WindowListDup

func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr

Return a copy of the linked list of Window objects passed as the second argument.

func Xsqlite3WindowRewrite

func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32

If the SELECT statement passed as the second argument does not invoke any SQL window functions, this function is a no-op. Otherwise, it rewrites the SELECT statement so that window function xStep functions are invoked in the correct order as described under "SELECT REWRITING" at the top of this file.

func Xsqlite3WindowUnlinkFromSelect

func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr)

Unlink the Window object from the Select to which it is attached, if it is attached.

func Xsqlite3WindowUpdate

func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uintptr, pFunc uintptr)

This function is called immediately after resolving the function name for a window function within a SELECT statement. Argument pList is a linked list of WINDOW definitions for the current SELECT statement. Argument pFunc is the function definition just resolved and pWin is the Window object representing the associated OVER clause. This function updates the contents of pWin as follows:

  • If the OVER clause refered to a named window (as in "max(x) OVER win"), search list pList for a matching WINDOW definition, and update pWin accordingly. If no such WINDOW clause can be found, leave an error in pParse.

  • If the function is a built-in window function that requires the window to be coerced (see "BUILT-IN WINDOW FUNCTIONS" at the top of this file), pWin is updated here.

func Xsqlite3WithAdd

func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr) uintptr

This routine is invoked once per CTE by the parser while parsing a WITH clause. The CTE described by teh third argument is added to the WITH clause of the second argument. If the second argument is NULL, then a new WITH argument is created.

func Xsqlite3WithDelete

func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr)

Free the contents of the With object passed as the second argument.

func Xsqlite3WithDup

func Xsqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) uintptr

Create and return a deep copy of the object passed as the second argument. If an OOM condition is encountered, NULL is returned and the db->mallocFailed flag set.

func Xsqlite3WithPush

func Xsqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree U8) uintptr

The code generator maintains a stack of active WITH clauses with the inner-most WITH clause being at the top of the stack.

This routine pushes the WITH clause passed as the second argument onto the top of the stack. If argument bFree is true, then this WITH clause will never be popped from the stack but should instead be freed along with the Parse object. In other cases, when bFree==0, the With object will be freed along with the SELECT statement with which it is associated.

This routine returns a copy of pWith. Or, if bFree is true and the pWith object is destroyed immediately due to an OOM condition, then this routine return NULL.

If bFree is true, do not continue to use the pWith pointer after calling this routine, Instead, use only the return value.

func Xsqlite3WritableSchema

func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32

True if PRAGMA writable_schema is ON

func Xsqlite3_aggregate_context

func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) uintptr

Allocate or return the aggregate context for a user function. A new context is allocated on the first call. Subsequent calls return the same context that was returned on prior calls.

func Xsqlite3_aggregate_count

func Xsqlite3_aggregate_count(tls *libc.TLS, p uintptr) int32

Return the number of times the Step function of an aggregate has been called.

This function is deprecated. Do not use it for new code. It is provide only to avoid breaking legacy code. New aggregate function implementations should keep their own counts within their aggregate context.

func Xsqlite3_auto_extension

func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32

Register a statically linked extension that is automatically loaded by every new database connection.

func Xsqlite3_backup_finish

func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32

Release all resources associated with an sqlite3_backup* handle.

func Xsqlite3_backup_init

func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb uintptr, zSrcDb uintptr) uintptr

Create an sqlite3_backup process to copy the contents of zSrcDb from connection handle pSrcDb to zDestDb in pDestDb. If successful, return a pointer to the new sqlite3_backup object.

If an error occurs, NULL is returned and an error code and error message stored in database handle pDestDb.

func Xsqlite3_backup_pagecount

func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32

Return the total number of pages in the source database as of the most recent call to sqlite3_backup_step().

func Xsqlite3_backup_remaining

func Xsqlite3_backup_remaining(tls *libc.TLS, p uintptr) int32

Return the number of pages still to be backed up as of the most recent call to sqlite3_backup_step().

func Xsqlite3_backup_step

func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32

Copy nPage pages from the source b-tree to the destination.

func Xsqlite3_bind_blob

func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32

Bind a blob value to an SQL statement variable.

func Xsqlite3_bind_blob64

func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr) int32

func Xsqlite3_bind_double

func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) int32

func Xsqlite3_bind_int

func Xsqlite3_bind_int(tls *libc.TLS, p uintptr, i int32, iValue int32) int32

func Xsqlite3_bind_int64

func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Sqlite_int64) int32

func Xsqlite3_bind_null

func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32

func Xsqlite3_bind_parameter_count

func Xsqlite3_bind_parameter_count(tls *libc.TLS, pStmt uintptr) int32

Return the number of wildcards that can be potentially bound to. This routine is added to support DBD::SQLite.

func Xsqlite3_bind_parameter_index

func Xsqlite3_bind_parameter_index(tls *libc.TLS, pStmt uintptr, zName uintptr) int32

func Xsqlite3_bind_parameter_name

func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr

Return the name of a wildcard parameter. Return NULL if the index is out of range or if the wildcard is unnamed.

The result is always UTF-8.

func Xsqlite3_bind_pointer

func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) int32

func Xsqlite3_bind_text

func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32

func Xsqlite3_bind_text16

func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32

func Xsqlite3_bind_text64

func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32

func Xsqlite3_bind_value

func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) int32

func Xsqlite3_bind_zeroblob

func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) int32

func Xsqlite3_bind_zeroblob64

func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_uint64) int32

func Xsqlite3_blob_bytes

func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32

Query a blob handle for the size of the data.

The Incrblob.nByte field is fixed for the lifetime of the Incrblob so no mutex is required for access.

func Xsqlite3_blob_close

func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32

Close a blob handle that was previously created using sqlite3_blob_open().

func Xsqlite3_blob_open

func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow Sqlite_int64, wrFlag int32, ppBlob uintptr) int32

Open a blob handle.

func Xsqlite3_blob_read

func Xsqlite3_blob_read(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32

Read data from a blob handle.

func Xsqlite3_blob_reopen

func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int32

Move an existing blob handle to point to a different row of the same database table.

If an error occurs, or if the specified row does not exist or does not contain a blob or text value, then an error code is returned and the database handle error code and message set. If this happens, then all subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) immediately return SQLITE_ABORT.

func Xsqlite3_blob_write

func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32

Write data to a blob handle.

func Xsqlite3_busy_handler

func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) int32

This routine sets the busy callback for an Sqlite database to the given callback function with the given argument.

func Xsqlite3_busy_timeout

func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32

This routine installs a default busy handler that waits for the specified number of milliseconds before returning 0.

func Xsqlite3_cancel_auto_extension

func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) int32

Cancel a prior call to sqlite3_auto_extension. Remove xInit from the set of routines that is invoked for each new database connection, if it is currently on the list. If xInit is not on the list, then this routine is a no-op.

Return 1 if xInit was found on the list and removed. Return 0 if xInit was not on the list.

func Xsqlite3_changes

func Xsqlite3_changes(tls *libc.TLS, db uintptr) int32

Return the number of changes in the most recent call to sqlite3_exec().

func Xsqlite3_clear_bindings

func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32

Set all the parameters in the compiled SQL statement to NULL.

func Xsqlite3_close

func Xsqlite3_close(tls *libc.TLS, db uintptr) int32

Two variations on the public interface for closing a database connection. The sqlite3_close() version returns SQLITE_BUSY and leaves the connection open if there are unfinalized prepared statements or unfinished sqlite3_backups. The sqlite3_close_v2() version forces the connection to become a zombie if there are unclosed resources, and arranges for deallocation when the last prepare statement or sqlite3_backup closes.

func Xsqlite3_close_v2

func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32

func Xsqlite3_collation_needed

func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) int32

Register a collation sequence factory callback with the database handle db. Replace any previously installed collation sequence factory.

func Xsqlite3_collation_needed16

func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) int32

Register a collation sequence factory callback with the database handle db. Replace any previously installed collation sequence factory.

func Xsqlite3_column_blob

func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr

*************************** sqlite3_column_ *******************************

The following routines are used to access elements of the current row in the result set.

func Xsqlite3_column_bytes

func Xsqlite3_column_bytes(tls *libc.TLS, pStmt uintptr, i int32) int32

func Xsqlite3_column_bytes16

func Xsqlite3_column_bytes16(tls *libc.TLS, pStmt uintptr, i int32) int32

func Xsqlite3_column_count

func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32

Return the number of columns in the result set for the statement pStmt.

func Xsqlite3_column_database_name

func Xsqlite3_column_database_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr

Return the name of the database from which a result column derives. NULL is returned if the result column is an expression or constant or anything else which is not an unambiguous reference to a database column.

func Xsqlite3_column_database_name16

func Xsqlite3_column_database_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr

func Xsqlite3_column_decltype

func Xsqlite3_column_decltype(tls *libc.TLS, pStmt uintptr, N int32) uintptr

Return the column declaration type (if applicable) of the 'i'th column of the result set of SQL statement pStmt.

func Xsqlite3_column_decltype16

func Xsqlite3_column_decltype16(tls *libc.TLS, pStmt uintptr, N int32) uintptr

func Xsqlite3_column_double

func Xsqlite3_column_double(tls *libc.TLS, pStmt uintptr, i int32) float64

func Xsqlite3_column_int

func Xsqlite3_column_int(tls *libc.TLS, pStmt uintptr, i int32) int32

func Xsqlite3_column_name

func Xsqlite3_column_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr

Return the name of the Nth column of the result set returned by SQL statement pStmt.

func Xsqlite3_column_name16

func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr

func Xsqlite3_column_origin_name

func Xsqlite3_column_origin_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr

Return the name of the table column from which a result column derives. NULL is returned if the result column is an expression or constant or anything else which is not an unambiguous reference to a database column.

func Xsqlite3_column_origin_name16

func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr

func Xsqlite3_column_table_name

func Xsqlite3_column_table_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr

Return the name of the table from which a result column derives. NULL is returned if the result column is an expression or constant or anything else which is not an unambiguous reference to a database column.

func Xsqlite3_column_table_name16

func Xsqlite3_column_table_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr

func Xsqlite3_column_text

func Xsqlite3_column_text(tls *libc.TLS, pStmt uintptr, i int32) uintptr

func Xsqlite3_column_text16

func Xsqlite3_column_text16(tls *libc.TLS, pStmt uintptr, i int32) uintptr

func Xsqlite3_column_type

func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32

func Xsqlite3_column_value

func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) uintptr

func Xsqlite3_commit_hook

func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr

Register a function to be invoked when a transaction commits. If the invoked function returns non-zero, then the commit becomes a rollback.

func Xsqlite3_compileoption_get

func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr

Return the N-th compile-time option string. If N is out of range, return a NULL pointer.

func Xsqlite3_compileoption_used

func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32

Given the name of a compile-time option, return true if that option was used and false if not.

The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix is not required for a match.

func Xsqlite3_complete

func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32

Return TRUE if the given SQL string ends in a semicolon.

Special handling is require for CREATE TRIGGER statements. Whenever the CREATE TRIGGER keywords are seen, the statement must end with ";END;".

This implementation uses a state machine with 8 states:

(0) INVALID   We have not yet seen a non-whitespace character.

(1) START     At the beginning or end of an SQL statement.  This routine
              returns 1 if it ends in the START state and 0 if it ends
              in any other state.

(2) NORMAL    We are in the middle of statement which ends with a single
              semicolon.

(3) EXPLAIN   The keyword EXPLAIN has been seen at the beginning of
              a statement.

(4) CREATE    The keyword CREATE has been seen at the beginning of a
              statement, possibly preceded by EXPLAIN and/or followed by
              TEMP or TEMPORARY

(5) TRIGGER   We are in the middle of a trigger definition that must be
              ended by a semicolon, the keyword END, and another semicolon.

(6) SEMI      We've seen the first semicolon in the ";END;" that occurs at
              the end of a trigger definition.

(7) END       We've seen the ";END" of the ";END;" that occurs at the end
              of a trigger definition.

Transitions between states above are determined by tokens extracted from the input. The following tokens are significant:

(0) tkSEMI      A semicolon.
(1) tkWS        Whitespace.
(2) tkOTHER     Any other SQL token.
(3) tkEXPLAIN   The "explain" keyword.
(4) tkCREATE    The "create" keyword.
(5) tkTEMP      The "temp" or "temporary" keyword.
(6) tkTRIGGER   The "trigger" keyword.
(7) tkEND       The "end" keyword.

Whitespace never causes a state transition and is always ignored. This means that a SQL string of all whitespace is invalid.

If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed to recognize the end of a trigger can be omitted. All we have to do is look for a semicolon that is not part of an string or comment.

func Xsqlite3_complete16

func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32

This routine is the same as the sqlite3_complete() routine described above, except that the parameter is required to be UTF-16 encoded, not UTF-8.

func Xsqlite3_config

func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32

This API allows applications to modify the global configuration of the SQLite library at run-time.

This routine should only be called when there are no outstanding database connections or memory allocations. This routine is not threadsafe. Failure to heed these warnings can lead to unpredictable behavior.

func Xsqlite3_context_db_handle

func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr

Extract the user data from a sqlite3_context structure and return a pointer to it.

IMPLEMENTATION-OF: R-46798-50301 The sqlite3_context_db_handle() interface returns a copy of the pointer to the database connection (the 1st parameter) of the sqlite3_create_function() and sqlite3_create_function16() routines that originally registered the application defined function.

func Xsqlite3_create_collation

func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32

Register a new collation sequence with the database handle db.

func Xsqlite3_create_collation16

func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32

Register a new collation sequence with the database handle db.

func Xsqlite3_create_collation_v2

func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) int32

Register a new collation sequence with the database handle db.

func Xsqlite3_create_filename

func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr, zWal uintptr, nParam int32, azParam uintptr) uintptr

Allocate memory to hold names for a database, journal file, WAL file, and query parameters. The pointer returned is valid for use by sqlite3_filename_database() and sqlite3_uri_parameter() and related functions.

Memory layout must be compatible with that generated by the pager and expected by sqlite3_uri_parameter() and databaseName().

func Xsqlite3_create_function

func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32

Create new user functions.

func Xsqlite3_create_function16

func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32

func Xsqlite3_create_function_v2

func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) int32

func Xsqlite3_create_module

func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr) int32

External API function used to create a new virtual-table module.

func Xsqlite3_create_module_v2

func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32

External API function used to create a new virtual-table module.

func Xsqlite3_create_window_function

func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32

func Xsqlite3_data_count

func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) int32

Return the number of values available from the current row of the currently executing statement pStmt.

func Xsqlite3_database_file_object

func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr

Return the sqlite3_file for the main database given the name of the corresonding WAL or Journal name as passed into xOpen.

func Xsqlite3_db_cacheflush

func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32

Flush any dirty pages in the pager-cache for any attached database to disk.

func Xsqlite3_db_config

func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32

Configuration settings for an individual database connection

func Xsqlite3_db_filename

func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr

Return the filename of the database associated with a database connection.

func Xsqlite3_db_handle

func Xsqlite3_db_handle(tls *libc.TLS, pStmt uintptr) uintptr

Return the sqlite3* database handle to which the prepared statement given in the argument belongs. This is the same database handle that was the first argument to the sqlite3_prepare() that was used to create the statement in the first place.

func Xsqlite3_db_mutex

func Xsqlite3_db_mutex(tls *libc.TLS, db uintptr) uintptr

Return the mutex associated with a database connection.

func Xsqlite3_db_readonly

func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32

Return 1 if database is read-only or 0 if read/write. Return -1 if no such database exists.

func Xsqlite3_db_release_memory

func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32

Free up as much memory as we can from the given database connection.

func Xsqlite3_db_status

func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32

Query status information for a single database connection

func Xsqlite3_declare_vtab

func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int32

This function is used to set the schema of a virtual table. It is only valid to call this function from within the xCreate() or xConnect() of a virtual table module.

func Xsqlite3_deserialize

func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uintptr, szDb Sqlite3_int64, szBuf Sqlite3_int64, mFlags uint32) int32

Convert zSchema to a MemDB and initialize its content.

func Xsqlite3_drop_modules

func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32

External API to drop all virtual-table modules, except those named on the azNames list.

func Xsqlite3_enable_load_extension

func Xsqlite3_enable_load_extension(tls *libc.TLS, db uintptr, onoff int32) int32

Enable or disable extension loading. Extension loading is disabled by default so as not to open security holes in older applications.

func Xsqlite3_enable_shared_cache

func Xsqlite3_enable_shared_cache(tls *libc.TLS, enable int32) int32

Enable or disable the shared pager and schema features.

This routine has no effect on existing database connections. The shared cache setting effects only future calls to sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().

func Xsqlite3_errcode

func Xsqlite3_errcode(tls *libc.TLS, db uintptr) int32

Return the most recent error code generated by an SQLite routine. If NULL is passed to this function, we assume a malloc() failed during sqlite3_open().

func Xsqlite3_errmsg

func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr

Return UTF-8 encoded English language explanation of the most recent error.

func Xsqlite3_errmsg16

func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr

Return UTF-16 encoded English language explanation of the most recent error.

func Xsqlite3_errstr

func Xsqlite3_errstr(tls *libc.TLS, rc int32) uintptr

Return a string that describes the kind of error specified in the argument. For now, this simply calls the internal sqlite3ErrStr() function.

func Xsqlite3_exec

func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_callback, pArg uintptr, pzErrMsg uintptr) int32

Execute SQL code. Return one of the SQLITE_ success/failure codes. Also write an error message into memory obtained from malloc() and make *pzErrMsg point to that message.

If the SQL is a query, then for each row in the query result the xCallback() function is called. pArg becomes the first argument to xCallback(). If xCallback=NULL then no callback is invoked, even for queries.

func Xsqlite3_expanded_sql

func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr

Return the SQL associated with a prepared statement with bound parameters expanded. Space to hold the returned string is obtained from sqlite3_malloc(). The caller is responsible for freeing the returned string by passing it to sqlite3_free().

The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of expanded bound parameters.

func Xsqlite3_expired

func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) int32

Return TRUE (non-zero) of the statement supplied as an argument needs to be recompiled. A statement needs to be recompiled whenever the execution environment changes in a way that would alter the program that sqlite3_prepare() generates. For example, if new functions or collating sequences are registered or if an authorizer function is added or changed.

func Xsqlite3_extended_errcode

func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) int32

func Xsqlite3_extended_result_codes

func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int32

Enable or disable the extended result codes.

func Xsqlite3_file_control

func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, pArg uintptr) int32

Invoke the xFileControl method on a particular database.

func Xsqlite3_filename_database

func Xsqlite3_filename_database(tls *libc.TLS, zFilename uintptr) uintptr

Translate a filename that was handed to a VFS routine into the corresponding database, journal, or WAL file.

It is an error to pass this routine a filename string that was not passed into the VFS from the SQLite core. Doing so is similar to passing free() a pointer that was not obtained from malloc() - it is an error that we cannot easily detect but that will likely cause memory corruption.

func Xsqlite3_filename_journal

func Xsqlite3_filename_journal(tls *libc.TLS, zFilename uintptr) uintptr

func Xsqlite3_filename_wal

func Xsqlite3_filename_wal(tls *libc.TLS, zFilename uintptr) uintptr

func Xsqlite3_finalize

func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32

The following routine destroys a virtual machine that is created by the sqlite3_compile() routine. The integer returned is an SQLITE_ success/failure code that describes the result of executing the virtual machine.

This routine sets the error code and string returned by sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().

func Xsqlite3_free

func Xsqlite3_free(tls *libc.TLS, p uintptr)

Free memory previously obtained from sqlite3Malloc().

func Xsqlite3_free_filename

func Xsqlite3_free_filename(tls *libc.TLS, p uintptr)

Free memory obtained from sqlite3_create_filename(). It is a severe error to call this routine with any parameter other than a pointer previously obtained from sqlite3_create_filename() or a NULL pointer.

func Xsqlite3_free_table

func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr)

This routine frees the space the sqlite3_get_table() malloced.

func Xsqlite3_get_autocommit

func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) int32

Test to see whether or not the database connection is in autocommit mode. Return TRUE if it is and FALSE if not. Autocommit mode is on by default. Autocommit is disabled by a BEGIN statement and reenabled by the next COMMIT or ROLLBACK.

func Xsqlite3_get_auxdata

func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) uintptr

Return the auxiliary data pointer, if any, for the iArg'th argument to the user-function defined by pCtx.

The left-most argument is 0.

Undocumented behavior: If iArg is negative then access a cache of auxiliary data pointers that is available to all functions within a single prepared statement. The iArg values must match.

func Xsqlite3_get_table

func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintptr, pnRow uintptr, pnColumn uintptr, pzErrMsg uintptr) int32

Query the database. But instead of invoking a callback for each row, malloc() for space to hold the result and return the entire results at the conclusion of the call.

The result that is written to ***pazResult is held in memory obtained from malloc(). But the caller cannot free this memory directly. Instead, the entire table should be passed to sqlite3_free_table() when the calling procedure is finished using it.

func Xsqlite3_global_recover

func Xsqlite3_global_recover(tls *libc.TLS) int32

This function is now an anachronism. It used to be used to recover from a malloc() failure, but SQLite now does this automatically.

func Xsqlite3_initialize

func Xsqlite3_initialize(tls *libc.TLS) int32

Initialize SQLite.

This routine must be called to initialize the memory allocation, VFS, and mutex subsystems prior to doing any serious work with SQLite. But as long as you do not compile with SQLITE_OMIT_AUTOINIT this routine will be called automatically by key routines such as sqlite3_open().

This routine is a no-op except on its very first call for the process, or for the first call after a call to sqlite3_shutdown.

The first thread to call this routine runs the initialization to completion. If subsequent threads call this routine before the first thread has finished the initialization process, then the subsequent threads must block until the first thread finishes with the initialization.

The first thread might call this routine recursively. Recursive calls to this routine should not block, of course. Otherwise the initialization process would never complete.

Let X be the first thread to enter this routine. Let Y be some other thread. Then while the initial invocation of this routine by X is incomplete, it is required that:

  • Calls to this routine from Y must block until the outer-most call by X completes.

  • Recursive calls to this routine from thread X return immediately without blocking.

func Xsqlite3_interrupt

func Xsqlite3_interrupt(tls *libc.TLS, db uintptr)

Cause any pending operation to stop at its earliest opportunity.

func Xsqlite3_keyword_check

func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32

func Xsqlite3_keyword_count

func Xsqlite3_keyword_count(tls *libc.TLS) int32

func Xsqlite3_keyword_name

func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintptr) int32

func Xsqlite3_libversion

func Xsqlite3_libversion(tls *libc.TLS) uintptr

IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns a pointer to the to the sqlite3_version[] string constant.

func Xsqlite3_libversion_number

func Xsqlite3_libversion_number(tls *libc.TLS) int32

IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function returns an integer equal to SQLITE_VERSION_NUMBER.

func Xsqlite3_limit

func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) int32

Change the value of a limit. Report the old value. If an invalid limit index is supplied, report -1. Make no changes but still report the old value if the new limit is negative.

A new lower limit does not shrink existing constructs. It merely prevents new constructs that exceed the limit from forming.

func Xsqlite3_load_extension

func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32

func Xsqlite3_log

func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr)

Format and write a message to the log if logging is enabled.

func Xsqlite3_malloc

func Xsqlite3_malloc(tls *libc.TLS, n int32) uintptr

This version of the memory allocation is for use by the application. First make sure the memory subsystem is initialized, then do the allocation.

func Xsqlite3_malloc64

func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr

func Xsqlite3_memory_alarm

func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Sqlite3_int64) int32

Deprecated external interface. It used to set an alarm callback that was invoked when memory usage grew too large. Now it is a no-op.

func Xsqlite3_mprintf

func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr

Print into memory obtained from sqlite3_malloc()(). Omit the internal %-conversion extensions.

func Xsqlite3_mutex_alloc

func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr

Retrieve a pointer to a static mutex or allocate a new dynamic one.

func Xsqlite3_mutex_enter

func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr)

Obtain the mutex p. If some other thread already has the mutex, block until it can be obtained.

func Xsqlite3_mutex_free

func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr)

Free a dynamic mutex.

func Xsqlite3_mutex_leave

func Xsqlite3_mutex_leave(tls *libc.TLS, p uintptr)

The sqlite3_mutex_leave() routine exits a mutex that was previously entered by the same thread. The behavior is undefined if the mutex is not currently entered. If a NULL pointer is passed as an argument this function is a no-op.

func Xsqlite3_mutex_try

func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) int32

Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.

func Xsqlite3_next_stmt

func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr

Return a pointer to the next prepared statement after pStmt associated with database connection pDb. If pStmt is NULL, return the first prepared statement for the database connection. Return NULL if there are no more.

func Xsqlite3_open

func Xsqlite3_open(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32

Open a new database handle.

func Xsqlite3_open16

func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32

Open a new database handle.

func Xsqlite3_open_v2

func Xsqlite3_open_v2(tls *libc.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) int32

func Xsqlite3_os_end

func Xsqlite3_os_end(tls *libc.TLS) int32

Shutdown the operating system interface.

Some operating systems might need to do some cleanup in this routine, to release dynamically allocated objects. But not on unix. This routine is a no-op for unix.

func Xsqlite3_os_init

func Xsqlite3_os_init(tls *libc.TLS) int32

Initialize the operating system interface.

This routine registers all VFS implementations for unix-like operating systems. This routine, and the sqlite3_os_end() routine that follows, should be the only routines in this file that are visible from other files.

This routine is called once during SQLite initialization and by a single thread. The memory allocation and mutex subsystems have not necessarily been initialized when this routine is called, and so they should not be used.

func Xsqlite3_overload_function

func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg int32) int32

Declare that a function has been overloaded by a virtual table.

If the function already exists as a regular global function, then this routine is a no-op. If the function does not exist, then create a new one that always throws a run-time error.

When virtual tables intend to provide an overloaded function, they should call this routine to make sure the global function exists. A global function must exist in order for name resolution to work properly.

func Xsqlite3_prepare

func Xsqlite3_prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32

Two versions of the official API. Legacy and new use. In the legacy version, the original SQL text is not saved in the prepared statement and so if a schema change occurs, SQLITE_SCHEMA is returned by sqlite3_step(). In the new version, the original SQL text is retained and the statement is automatically recompiled if an schema change occurs.

func Xsqlite3_prepare16

func Xsqlite3_prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32

Two versions of the official API. Legacy and new use. In the legacy version, the original SQL text is not saved in the prepared statement and so if a schema change occurs, SQLITE_SCHEMA is returned by sqlite3_step(). In the new version, the original SQL text is retained and the statement is automatically recompiled if an schema change occurs.

func Xsqlite3_prepare16_v2

func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32

func Xsqlite3_prepare16_v3

func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32

func Xsqlite3_prepare_v2

func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32

func Xsqlite3_prepare_v3

func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32

func Xsqlite3_preupdate_blobwrite

func Xsqlite3_preupdate_blobwrite(tls *libc.TLS, db uintptr) int32

This function is designed to be called from within a pre-update callback only.

func Xsqlite3_preupdate_count

func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32

This function is called from within a pre-update callback to retrieve the number of columns in the row being updated, deleted or inserted.

func Xsqlite3_preupdate_depth

func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32

This function is designed to be called from within a pre-update callback only. It returns zero if the change that caused the callback was made immediately by a user SQL statement. Or, if the change was made by a trigger program, it returns the number of trigger programs currently on the stack (1 for a top-level trigger, 2 for a trigger fired by a top-level trigger etc.).

For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL or SET DEFAULT action is considered a trigger.

func Xsqlite3_preupdate_hook

func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr

Register a callback to be invoked each time a row is updated, inserted or deleted using this database connection.

func Xsqlite3_preupdate_new

func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32

This function is called from within a pre-update callback to retrieve a field of the row currently being updated or inserted.

func Xsqlite3_preupdate_old

func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32

This function is called from within a pre-update callback to retrieve a field of the row currently being updated or deleted.

func Xsqlite3_profile

func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) uintptr

Register a profile function. The pArg from the previously registered profile function is returned.

A NULL profile function means that no profiling is executes. A non-NULL profile is a pointer to a function that is invoked at the conclusion of each SQL statement that is run.

func Xsqlite3_progress_handler

func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr)

This routine sets the progress callback for an Sqlite database to the given callback function with the given argument. The progress callback will be invoked every nOps opcodes.

func Xsqlite3_randomness

func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr)

Return N random bytes.

func Xsqlite3_realloc

func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr

The public interface to sqlite3Realloc. Make sure that the memory subsystem is initialized prior to invoking sqliteRealloc.

func Xsqlite3_realloc64

func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr

func Xsqlite3_release_memory

func Xsqlite3_release_memory(tls *libc.TLS, n int32) int32

Attempt to release up to n bytes of non-essential memory currently held by SQLite. An example of non-essential memory is memory used to cache database pages that are not currently in use.

func Xsqlite3_reset

func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32

Terminate the current execution of an SQL statement and reset it back to its starting state so that it can be reused. A success code from the prior execution is returned.

This routine sets the error code and string returned by sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().

func Xsqlite3_reset_auto_extension

func Xsqlite3_reset_auto_extension(tls *libc.TLS)

Reset the automatic extension loading mechanism.

func Xsqlite3_result_blob

func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr)

func Xsqlite3_result_blob64

func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr)

func Xsqlite3_result_double

func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64)

func Xsqlite3_result_error

func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32)

func Xsqlite3_result_error16

func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32)

func Xsqlite3_result_error_code

func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32)

func Xsqlite3_result_error_nomem

func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr)

An SQLITE_NOMEM error.

func Xsqlite3_result_error_toobig

func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr)

Force an SQLITE_TOOBIG error.

func Xsqlite3_result_int

func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32)

func Xsqlite3_result_int64

func Xsqlite3_result_int64(tls *libc.TLS, pCtx uintptr, iVal I64)

func Xsqlite3_result_null

func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr)

func Xsqlite3_result_pointer

func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr)

func Xsqlite3_result_subtype

func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32)

func Xsqlite3_result_text

func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr)

func Xsqlite3_result_text16

func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr)

func Xsqlite3_result_text16be

func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr)

func Xsqlite3_result_text16le

func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr)

func Xsqlite3_result_text64

func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8)

func Xsqlite3_result_value

func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr)

func Xsqlite3_result_zeroblob

func Xsqlite3_result_zeroblob(tls *libc.TLS, pCtx uintptr, n int32)

func Xsqlite3_result_zeroblob64

func Xsqlite3_result_zeroblob64(tls *libc.TLS, pCtx uintptr, n U64) int32

func Xsqlite3_rollback_hook

func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr

Register a callback to be invoked each time a transaction is rolled back by this database connection.

func Xsqlite3_rtree_geometry_callback

func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) int32

Register a new geometry function for use with the r-tree MATCH operator.

func Xsqlite3_rtree_query_callback

func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) int32

Register a new 2nd-generation geometry function for use with the r-tree MATCH operator.

func Xsqlite3_serialize

func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintptr, mFlags uint32) uintptr

Return the serialization of a database

func Xsqlite3_set_authorizer

func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) int32

Set or clear the access authorization function.

The access authorization function is be called during the compilation phase to verify that the user has read and/or write access permission on various fields of the database. The first argument to the auth function is a copy of the 3rd argument to this routine. The second argument to the auth function is one of these constants:

SQLITE_CREATE_INDEX
SQLITE_CREATE_TABLE
SQLITE_CREATE_TEMP_INDEX
SQLITE_CREATE_TEMP_TABLE
SQLITE_CREATE_TEMP_TRIGGER
SQLITE_CREATE_TEMP_VIEW
SQLITE_CREATE_TRIGGER
SQLITE_CREATE_VIEW
SQLITE_DELETE
SQLITE_DROP_INDEX
SQLITE_DROP_TABLE
SQLITE_DROP_TEMP_INDEX
SQLITE_DROP_TEMP_TABLE
SQLITE_DROP_TEMP_TRIGGER
SQLITE_DROP_TEMP_VIEW
SQLITE_DROP_TRIGGER
SQLITE_DROP_VIEW
SQLITE_INSERT
SQLITE_PRAGMA
SQLITE_READ
SQLITE_SELECT
SQLITE_TRANSACTION
SQLITE_UPDATE

The third and fourth arguments to the auth function are the name of the table and the column that are being accessed. The auth function should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE. If SQLITE_OK is returned, it means that access is allowed. SQLITE_DENY means that the SQL statement will never-run - the sqlite3_exec() call will return with an error. SQLITE_IGNORE means that the SQL statement should run but attempts to read the specified column will return NULL and attempts to write the column will be ignored.

Setting the auth function to NULL disables this hook. The default setting of the auth function is NULL.

func Xsqlite3_set_auxdata

func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr)

Set the auxiliary data pointer and delete function, for the iArg'th argument to the user-function defined by pCtx. Any previous value is deleted by calling the delete function specified when it was set.

The left-most argument is 0.

Undocumented behavior: If iArg is negative then make the data available to all functions within the current prepared statement using iArg as an access code.

func Xsqlite3_set_last_insert_rowid

func Xsqlite3_set_last_insert_rowid(tls *libc.TLS, db uintptr, iRowid Sqlite3_int64)

Set the value returned by the sqlite3_last_insert_rowid() API function.

func Xsqlite3_shutdown

func Xsqlite3_shutdown(tls *libc.TLS) int32

Undo the effects of sqlite3_initialize(). Must not be called while there are outstanding database connections or memory allocations or while any part of SQLite is otherwise in use in any thread. This routine is not threadsafe. But it is safe to invoke this routine on when SQLite is already shut down. If SQLite is already shut down when this routine is invoked, then this routine is a harmless no-op.

func Xsqlite3_sleep

func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32

Sleep for a little while. Return the amount of time slept.

func Xsqlite3_snapshot_cmp

func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32

Return a +ve value if snapshot p1 is newer than p2. A -ve value if p1 is older than p2 and zero if p1 and p2 are the same snapshot.

func Xsqlite3_snapshot_free

func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr)

Free a snapshot handle obtained from sqlite3_snapshot_get().

func Xsqlite3_snapshot_get

func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot uintptr) int32

Obtain a snapshot handle for the snapshot of database zDb currently being read by handle db.

func Xsqlite3_snapshot_open

func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot uintptr) int32

Open a read-transaction on the snapshot idendified by pSnapshot.

func Xsqlite3_snapshot_recover

func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32

Recover as many snapshots as possible from the wal file associated with schema zDb of database db.

func Xsqlite3_snprintf

func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va uintptr) uintptr

func Xsqlite3_soft_heap_limit

func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32)

func Xsqlite3_sourceid

func Xsqlite3_sourceid(tls *libc.TLS) uintptr

************* End of stmt.c *********************************************** Return the source-id for this library

func Xsqlite3_sql

func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr

Return the SQL associated with a prepared statement

func Xsqlite3_status

func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32

func Xsqlite3_status64

func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32

Query status information.

func Xsqlite3_step

func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) int32

This is the top-level implementation of sqlite3_step(). Call sqlite3Step() to do most of the work. If a schema error occurs, call sqlite3Reprepare() and try again.

func Xsqlite3_stmt_busy

func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) int32

Return true if the prepared statement is in need of being reset.

func Xsqlite3_stmt_isexplain

func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32

Return 1 if the statement is an EXPLAIN and return 2 if the statement is an EXPLAIN QUERY PLAN

func Xsqlite3_stmt_readonly

func Xsqlite3_stmt_readonly(tls *libc.TLS, pStmt uintptr) int32

Return true if the prepared statement is guaranteed to not modify the database.

func Xsqlite3_stmt_status

func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int32) int32

Return the value of a status counter for a prepared statement

func Xsqlite3_str_append

func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32)

Append N bytes of text from z to the StrAccum object. Increase the size of the memory allocation for StrAccum if necessary.

func Xsqlite3_str_appendall

func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr)

Append the complete text of zero-terminated string z[] to the p string.

func Xsqlite3_str_appendchar

func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8)

Append N copies of character c to the given string buffer.

func Xsqlite3_str_appendf

func Xsqlite3_str_appendf(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr)

variable-argument wrapper around sqlite3_str_vappendf(). The bFlags argument can contain the bit SQLITE_PRINTF_INTERNAL enable internal formats.

func Xsqlite3_str_errcode

func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32

Return any error code associated with p

func Xsqlite3_str_finish

func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr

Finalize a string created using sqlite3_str_new().

func Xsqlite3_str_length

func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32

Return the current length of p in bytes

func Xsqlite3_str_new

func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr

Allocate and initialize a new dynamic string object

func Xsqlite3_str_reset

func Xsqlite3_str_reset(tls *libc.TLS, p uintptr)

Reset an StrAccum string. Reclaim all malloced memory.

func Xsqlite3_str_value

func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr

Return the current value for p

func Xsqlite3_str_vappendf

func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_list)

Render a string given by "fmt" into the StrAccum object.

func Xsqlite3_strglob

func Xsqlite3_strglob(tls *libc.TLS, zGlobPattern uintptr, zString uintptr) int32

The sqlite3_strglob() interface. Return 0 on a match (like strcmp()) and non-zero if there is no match.

func Xsqlite3_stricmp

func Xsqlite3_stricmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32

Some systems have stricmp(). Others have strcasecmp(). Because there is no consistency, we will define our own.

IMPLEMENTATION-OF: R-30243-02494 The sqlite3_stricmp() and sqlite3_strnicmp() APIs allow applications and extensions to compare the contents of two buffers containing UTF-8 strings in a case-independent fashion, using the same definition of "case independence" that SQLite uses internally when comparing identifiers.

func Xsqlite3_strlike

func Xsqlite3_strlike(tls *libc.TLS, zPattern uintptr, zStr uintptr, esc uint32) int32

The sqlite3_strlike() interface. Return 0 on a match and non-zero for a miss - like strcmp().

func Xsqlite3_strnicmp

func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) int32

func Xsqlite3_system_errno

func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32

func Xsqlite3_table_column_metadata

func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, zTableName uintptr, zColumnName uintptr, pzDataType uintptr, pzCollSeq uintptr, pNotNull uintptr, pPrimaryKey uintptr, pAutoinc uintptr) int32

Return meta information about a specific column of a database table. See comment in sqlite3.h (sqlite.h.in) for details.

func Xsqlite3_test_control

func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32

Interface to the testing logic.

func Xsqlite3_thread_cleanup

func Xsqlite3_thread_cleanup(tls *libc.TLS)

This is a convenience routine that makes sure that all thread-specific data for this thread has been deallocated.

SQLite no longer uses thread-specific data so this routine is now a no-op. It is retained for historical compatibility.

func Xsqlite3_threadsafe

func Xsqlite3_threadsafe(tls *libc.TLS) int32

IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns zero if and only if SQLite was compiled with mutexing code omitted due to the SQLITE_THREADSAFE compile-time option being set to 0.

func Xsqlite3_total_changes

func Xsqlite3_total_changes(tls *libc.TLS, db uintptr) int32

Return the number of changes since the database handle was opened.

func Xsqlite3_trace

func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uintptr

Register a trace function. The pArg from the previously registered trace is returned.

A NULL trace function means that no tracing is executes. A non-NULL trace is a pointer to a function that is invoked at the start of each SQL statement.

func Xsqlite3_trace_v2

func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) int32

Register a trace callback using the version-2 interface.

func Xsqlite3_transfer_bindings

func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32

Deprecated external interface. Internal/core SQLite code should call sqlite3TransferBindings.

It is misuse to call this routine with statements from different database connections. But as this is a deprecated interface, we will not bother to check for that condition.

If the two statements contain a different number of bindings, then an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise SQLITE_OK is returned.

func Xsqlite3_txn_state

func Xsqlite3_txn_state(tls *libc.TLS, db uintptr, zSchema uintptr) int32

Return the transaction state for a single databse, or the maximum transaction state over all attached databases if zSchema is null.

func Xsqlite3_unlock_notify

func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uintptr) int32

Register an unlock-notify callback.

This is called after connection "db" has attempted some operation but has received an SQLITE_LOCKED error because another connection (call it pOther) in the same process was busy using the same shared cache. pOther is found by looking at db->pBlockingConnection.

If there is no blocking connection, the callback is invoked immediately, before this routine returns.

If pOther is already blocked on db, then report SQLITE_LOCKED, to indicate a deadlock.

Otherwise, make arrangements to invoke xNotify when pOther drops its locks.

Each call to this routine overrides any prior callbacks registered on the same "db". If xNotify==0 then any prior callbacks are immediately cancelled.

func Xsqlite3_update_hook

func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr

Register a callback to be invoked each time a row is updated, inserted or deleted using this database connection.

func Xsqlite3_uri_boolean

func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt int32) int32

Return a boolean value for a query parameter.

func Xsqlite3_uri_key

func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr

Return a pointer to the name of Nth query parameter of the filename.

func Xsqlite3_uri_parameter

func Xsqlite3_uri_parameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr

This is a utility routine, useful to VFS implementations, that checks to see if a database file was a URI that contained a specific query parameter, and if so obtains the value of the query parameter.

The zFilename argument is the filename pointer passed into the xOpen() method of a VFS implementation. The zParam argument is the name of the query parameter we seek. This routine returns the value of the zParam parameter if it exists. If the parameter does not exist, this routine returns a NULL pointer.

func Xsqlite3_user_data

func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr

Extract the user data from a sqlite3_context structure and return a pointer to it.

func Xsqlite3_value_blob

func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr

*************************** sqlite3_value_ *******************************

The following routines extract information from a Mem or sqlite3_value structure.

func Xsqlite3_value_bytes

func Xsqlite3_value_bytes(tls *libc.TLS, pVal uintptr) int32

func Xsqlite3_value_bytes16

func Xsqlite3_value_bytes16(tls *libc.TLS, pVal uintptr) int32

func Xsqlite3_value_double

func Xsqlite3_value_double(tls *libc.TLS, pVal uintptr) float64

func Xsqlite3_value_dup

func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr

Make a copy of an sqlite3_value object

func Xsqlite3_value_free

func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr)

Destroy an sqlite3_value object previously obtained from sqlite3_value_dup().

func Xsqlite3_value_frombind

func Xsqlite3_value_frombind(tls *libc.TLS, pVal uintptr) int32

Return true if a parameter value originated from an sqlite3_bind()

func Xsqlite3_value_int

func Xsqlite3_value_int(tls *libc.TLS, pVal uintptr) int32

func Xsqlite3_value_nochange

func Xsqlite3_value_nochange(tls *libc.TLS, pVal uintptr) int32

Return true if a parameter to xUpdate represents an unchanged column

func Xsqlite3_value_numeric_type

func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) int32

Try to convert the type of a function argument or a result column into a numeric representation. Use either INTEGER or REAL whichever is appropriate. But only do the conversion if it is possible without loss of information and return the revised type of the argument.

func Xsqlite3_value_pointer

func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr

func Xsqlite3_value_subtype

func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) uint32

func Xsqlite3_value_text

func Xsqlite3_value_text(tls *libc.TLS, pVal uintptr) uintptr

func Xsqlite3_value_text16

func Xsqlite3_value_text16(tls *libc.TLS, pVal uintptr) uintptr

func Xsqlite3_value_text16be

func Xsqlite3_value_text16be(tls *libc.TLS, pVal uintptr) uintptr

func Xsqlite3_value_text16le

func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) uintptr

func Xsqlite3_value_type

func Xsqlite3_value_type(tls *libc.TLS, pVal uintptr) int32

EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five fundamental datatypes: 64-bit signed integer 64-bit IEEE floating point number string BLOB NULL

func Xsqlite3_vfs_find

func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr

Locate a VFS by name. If no name is given, simply return the first VFS on the list.

func Xsqlite3_vfs_register

func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) int32

Register a VFS with the system. It is harmless to register the same VFS multiple times. The new VFS becomes the default if makeDflt is true.

func Xsqlite3_vfs_unregister

func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32

Unregister a VFS so that it is no longer accessible.

func Xsqlite3_vmprintf

func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr

Print into memory obtained from sqlite3_malloc(). Omit the internal %-conversion extensions.

func Xsqlite3_vsnprintf

func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, ap Va_list) uintptr

sqlite3_snprintf() works like snprintf() except that it ignores the current locale settings. This is important for SQLite because we are not able to use a "," as the decimal point in place of "." as specified by some locales.

Oops: The first two arguments of sqlite3_snprintf() are backwards from the snprintf() standard. Unfortunately, it is too late to change this without breaking compatibility, so we just have to live with the mistake.

sqlite3_vsnprintf() is the varargs version.

func Xsqlite3_vtab_collation

func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintptr

If this function is invoked from within an xBestIndex() callback, it returns a pointer to a buffer containing the name of the collation sequence associated with element iCons of the sqlite3_index_info.aConstraint array. Or, if iCons is out of range or there is no active xBestIndex call, return NULL.

func Xsqlite3_vtab_config

func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32

Call from within the xCreate() or xConnect() methods to provide the SQLite core with additional information about the behavior of the virtual table being implemented.

func Xsqlite3_vtab_nochange

func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32

If this routine is invoked from within an xColumn method of a virtual table, then it returns true if and only if the the call is during an UPDATE operation and the value of the column will not be modified by the UPDATE.

If this routine is called from any context other than within the xColumn method of a virtual table, then the return value is meaningless and arbitrary.

Virtual table implements might use this routine to optimize their performance by substituting a NULL result, or some other light-weight value, as a signal to the xUpdate routine that the column is unchanged.

func Xsqlite3_vtab_on_conflict

func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) int32

Return the ON CONFLICT resolution mode in effect for the virtual table update operation currently in progress.

The results of this routine are undefined unless it is called from within an xUpdate method.

func Xsqlite3_wal_autocheckpoint

func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) int32

Configure an sqlite3_wal_hook() callback to automatically checkpoint a database after committing a transaction if there are nFrame or more frames in the log file. Passing zero or a negative value as the nFrame parameter disables automatic checkpoints entirely.

The callback registered by this function replaces any existing callback registered using sqlite3_wal_hook(). Likewise, registering a callback using sqlite3_wal_hook() disables the automatic checkpoint mechanism configured by this function.

func Xsqlite3_wal_checkpoint

func Xsqlite3_wal_checkpoint(tls *libc.TLS, db uintptr, zDb uintptr) int32

Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points to contains a zero-length string, all attached databases are checkpointed.

func Xsqlite3_wal_checkpoint_v2

func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32

Checkpoint database zDb.

func Xsqlite3_wal_hook

func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr

Register a callback to be invoked each time a transaction is written into the write-ahead-log by this database connection.

func Xsqlite3rbu_bp_progress

func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uintptr)

Return permyriadage progress indications for the two main stages of an RBU update.

func Xsqlite3rbu_close

func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32

Close the RBU handle.

func Xsqlite3rbu_create_vfs

func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32

Create an RBU VFS named zName that accesses the underlying file-system via existing VFS zParent. The new object is registered as a non-default VFS with SQLite before returning.

func Xsqlite3rbu_db

func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr

Return the database handle used by pRbu.

func Xsqlite3rbu_destroy_vfs

func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr)

Deregister and destroy an RBU vfs created by an earlier call to sqlite3rbu_create_vfs().

func Xsqlite3rbu_open

func Xsqlite3rbu_open(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr

Open and return a new RBU handle.

func Xsqlite3rbu_savestate

func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32

func Xsqlite3rbu_state

func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32

Return the current state of the RBU vacuum or update operation.

func Xsqlite3rbu_step

func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32

Step the RBU object.

func Xsqlite3rbu_vacuum

func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr

Open a handle to begin or resume an RBU VACUUM operation.

Types

type AggInfo

type AggInfo = AggInfo1 /* sqlite3.c:14884:24 */

Forward references to structures

type AggInfo1

type AggInfo1 = struct {
	FdirectMode    U8
	FuseSortingIdx U8

	FsortingIdx     int32
	FsortingIdxPTab int32
	FnSortingColumn int32
	FmnReg          int32
	FmxReg          int32
	FpGroupBy       uintptr
	FaCol           uintptr
	FnColumn        int32
	FnAccumulator   int32
	FaFunc          uintptr
	FnFunc          int32
	FselId          U32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

Forward references to structures

type AggInfo_col

type AggInfo_col = struct {
	FpTab          uintptr
	FpCExpr        uintptr
	FiTable        int32
	FiMem          int32
	FiColumn       I16
	FiSorterColumn I16
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

An instance of this structure contains information needed to generate code for a SELECT that contains aggregate functions.

If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a pointer to this structure. The Expr.iAgg field is the index in AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate code for that node.

AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the original Select structure that describes the SELECT statement. These fields do not need to be freed when deallocating the AggInfo structure.

type AggInfo_func

type AggInfo_func = struct {
	FpFExpr    uintptr
	FpFunc     uintptr
	FiMem      int32
	FiDistinct int32
	FiDistAddr int32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

An instance of this structure contains information needed to generate code for a SELECT that contains aggregate functions.

If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a pointer to this structure. The Expr.iAgg field is the index in AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate code for that node.

AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the original Select structure that describes the SELECT statement. These fields do not need to be freed when deallocating the AggInfo structure.

type AnalysisInfo

type AnalysisInfo = analysisInfo /* sqlite3.c:111061:29 */

Used to pass information from the analyzer reader through to the callback routine.

type AsciiTokenizer

type AsciiTokenizer = AsciiTokenizer1 /* sqlite3.c:231914:31 */

type AsciiTokenizer1

type AsciiTokenizer1 = struct{ FaTokenChar [128]uint8 } /* sqlite3.c:231914:9 */

type AuthContext

type AuthContext = AuthContext1 /* sqlite3.c:14885:28 */

type AuthContext1

type AuthContext1 = struct {
	FzAuthContext uintptr
	FpParse       uintptr

} /* sqlite3.c:14885:9 */

type AutoincInfo

type AutoincInfo = AutoincInfo1 /* sqlite3.c:14886:28 */

type AutoincInfo1

type AutoincInfo1 = struct {
	FpNext  uintptr
	FpTab   uintptr
	FiDb    int32
	FregCtr int32

} /* sqlite3.c:1331:9 */

type AuxData

type AuxData = AuxData1 /* sqlite3.c:21221:24 */

Elements of the linked list at Vdbe.pAuxData

type AuxData1

type AuxData1 = struct {
	FiAuxOp     int32
	FiAuxArg    int32
	FpAux       uintptr
	FxDeleteAux uintptr
	FpNextAux   uintptr

} /* sqlite3.c:1331:9 */

Elements of the linked list at Vdbe.pAuxData

type BenignMallocHooks

type BenignMallocHooks = BenignMallocHooks1 /* sqlite3.c:23902:34 */

Global variables.

type BenignMallocHooks1

type BenignMallocHooks1 = struct {
	FxBenignBegin uintptr
	FxBenignEnd   uintptr

} /* sqlite3.c:23902:9 */

Global variables.

type Bft

type Bft = uint32 /* sqlite3.c:21509:18 */ // Bit Field Type

A bitfield type for use inside of structures. Always follow with :N where N is the number of bits.

type Bitmask

type Bitmask = U64 /* sqlite3.c:14951:15 */

The bitmask datatype defined below is used for various optimizations.

Changing this from a 64-bit to a 32-bit type limits the number of tables in a join to 32 instead of 64. But it also reduces the size of the library by 738 bytes on ix86.

func Xsqlite3ExprColUsed

func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask

The argument is guaranteed to be a non-NULL Expr node of type TK_COLUMN. return the appropriate colUsed mask.

func Xsqlite3WhereCodeOneLoopStart

func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWInfo uintptr, iLevel int32, pLevel uintptr, notReady Bitmask) Bitmask

Generate code for the start of the iLevel-th loop in the WHERE clause implementation described by pWInfo.

func Xsqlite3WhereExprListUsage

func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr) Bitmask

func Xsqlite3WhereExprUsage

func Xsqlite3WhereExprUsage(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask

func Xsqlite3WhereExprUsageNN

func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask

These routines walk (recursively) an expression tree and generate a bitmask indicating which tables are used in that expression tree.

func Xsqlite3WhereGetMask

func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmask

Return the bitmask for the given cursor number. Return 0 if iCursor is not in the set.

type Bitvec

type Bitvec = Bitvec1 /* sqlite3.c:14887:23 */

type Bitvec1

type Bitvec1 = struct {
	FiSize    U32
	FnSet     U32
	FiDivisor U32

	Fu struct {
		FaBitmap [496]U8
		// contains filtered or unexported fields
	}
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Blkcnt64_t

type Blkcnt64_t = X__blkcnt64_t /* types.h:236:22 */ // Type to count number of disk blocks.

type Blkcnt_t

type Blkcnt_t = X__blkcnt64_t /* types.h:222:22 */ // Type to count number of disk blocks.

Types from the Large File Support interface.

type Blksize_t

type Blksize_t = X__blksize_t /* types.h:202:21 */

type Bool

type Bool = uint32 /* sqlite3.c:21215:18 */

Boolean values

type BtCursor

type BtCursor = BtCursor1 /* sqlite3.c:15268:25 */

type BtCursor1

type BtCursor1 = struct {
	FeState        U8
	FcurFlags      U8
	FcurPagerFlags U8
	Fhints         U8
	FskipNext      int32
	FpBtree        uintptr
	FaOverflow     uintptr
	FpKey          uintptr
	FpBt           uintptr
	FpNext         uintptr
	Finfo          CellInfo
	FnKey          I64
	FpgnoRoot      Pgno
	FiPage         I8
	FcurIntKey     U8
	Fix            U16
	FaiIdx         [19]U16

	FpKeyInfo uintptr
	FpPage    uintptr
	FapPage   [19]uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type BtLock

type BtLock = BtLock1 /* sqlite3.c:64659:23 */

type BtLock1

type BtLock1 = struct {
	FpBtree uintptr
	FiTable Pgno
	FeLock  U8

	FpNext uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type BtShared

type BtShared = BtShared1 /* sqlite3.c:15269:25 */

type BtShared1

type BtShared1 = struct {
	FpPager          uintptr
	Fdb              uintptr
	FpCursor         uintptr
	FpPage1          uintptr
	FopenFlags       U8
	FautoVacuum      U8
	FincrVacuum      U8
	FbDoTruncate     U8
	FinTransaction   U8
	Fmax1bytePayload U8
	FnReserveWanted  U8

	FbtsFlags U16
	FmaxLocal U16
	FminLocal U16
	FmaxLeaf  U16
	FminLeaf  U16

	FpageSize     U32
	FusableSize   U32
	FnTransaction int32
	FnPage        U32

	FpSchema     uintptr
	FxFreeSchema uintptr
	Fmutex       uintptr
	FpHasContent uintptr
	FnRef        int32

	FpNext          uintptr
	FpLock          uintptr
	FpWriter        uintptr
	FpTmpSpace      uintptr
	FnPreformatSize int32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Btree

type Btree = Btree1 /* sqlite3.c:15267:22 */

Forward declarations of structure

type Btree1

type Btree1 = struct {
	Fdb             uintptr
	FpBt            uintptr
	FinTrans        U8
	Fsharable       U8
	Flocked         U8
	FhasIncrblobCur U8
	FwantToLock     int32
	FnBackup        int32
	FiBDataVersion  U32
	FpNext          uintptr
	FpPrev          uintptr
	Flock           BtLock

} /* sqlite3.c:1331:9 */

Forward declarations of structure

type BtreePayload

type BtreePayload = BtreePayload1 /* sqlite3.c:15270:29 */

type BtreePayload1

type BtreePayload1 = struct {
	FpKey  uintptr
	FnKey  Sqlite3_int64
	FpData uintptr
	FaMem  uintptr
	FnMem  U16

	FnData int32
	FnZero int32
	// contains filtered or unexported fields

} /* sqlite3.c:15270:9 */

type Builtin

type Builtin = struct {
	FzFunc     uintptr
	FpUserData uintptr
	FxFunc     Fts5_extension_function
	FxDestroy  uintptr

} /* sqlite3.c:216037:3 */

type BuiltinTokenizer

type BuiltinTokenizer = struct {
	FzName uintptr
	Fx     Fts5_tokenizer

} /* sqlite3.c:233270:3 */

type BusyHandler

type BusyHandler = BusyHandler1 /* sqlite3.c:14788:28 */

An instance of the following structure is used to store the busy-handler callback for a given sqlite handle.

The sqlite.busyHandler member of the sqlite struct contains the busy callback for the database handle. Each pager opened via the sqlite handle is passed a pointer to sqlite.busyHandler. The busy-handler callback is currently invoked only from within pager.c.

type BusyHandler1

type BusyHandler1 = struct {
	FxBusyHandler uintptr
	FpBusyArg     uintptr
	FnBusy        int32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

An instance of the following structure is used to store the busy-handler callback for a given sqlite handle.

The sqlite.busyHandler member of the sqlite struct contains the busy callback for the database handle. Each pager opened via the sqlite handle is passed a pointer to sqlite.busyHandler. The busy-handler callback is currently invoked only from within pager.c.

type Bytecodevtab

type Bytecodevtab = bytecodevtab /* sqlite3.c:98106:29 */

An instance of the bytecode() table-valued function.

type Bytecodevtab_cursor

type Bytecodevtab_cursor = bytecodevtab_cursor /* sqlite3.c:98115:36 */

A cursor for scanning through the bytecode

type CInstIter

type CInstIter = CInstIter1 /* sqlite3.c:215383:26 */

Object used to iterate through all "coalesced phrase instances" in a single column of the current row. If the phrase instances in the column being considered do not overlap, this object simply iterates through them. Or, if they do overlap (share one or more tokens in common), each set of overlapping instances is treated as a single match. See documentation for the highlight() auxiliary function for details.

Usage is:

for(rc = fts5CInstIterNext(pApi, pFts, iCol, &iter);
   (rc==SQLITE_OK && 0==fts5CInstIterEof(&iter);
   rc = fts5CInstIterNext(&iter)
){
  printf("instance starts at %d, ends at %d\n", iter.iStart, iter.iEnd);
}

type CInstIter1

type CInstIter1 = struct {
	FpApi   uintptr
	FpFts   uintptr
	FiCol   int32
	FiInst  int32
	FnInst  int32
	FiStart int32
	FiEnd   int32
	// contains filtered or unexported fields

} /* sqlite3.c:215383:9 */

Object used to iterate through all "coalesced phrase instances" in a single column of the current row. If the phrase instances in the column being considered do not overlap, this object simply iterates through them. Or, if they do overlap (share one or more tokens in common), each set of overlapping instances is treated as a single match. See documentation for the highlight() auxiliary function for details.

Usage is:

for(rc = fts5CInstIterNext(pApi, pFts, iCol, &iter);
   (rc==SQLITE_OK && 0==fts5CInstIterEof(&iter);
   rc = fts5CInstIterNext(&iter)
){
  printf("instance starts at %d, ends at %d\n", iter.iStart, iter.iEnd);
}

type Caddr_t

type Caddr_t = X__caddr_t /* types.h:115:19 */

type CallCount

type CallCount = struct {
	FnValue I64
	FnStep  I64
	FnTotal I64

} /* sqlite3.c:155077:1 */

Context object type used by rank(), dense_rank(), percent_rank() and cume_dist().

type CellArray

type CellArray = CellArray1 /* sqlite3.c:72392:26 */

A CellArray object contains a cache of pointers and sizes for a consecutive sequence of cells that might be held on multiple pages.

The cells in this array are the divider cell or cells from the pParent page plus up to three child pages. There are a total of nCell cells.

pRef is a pointer to one of the pages that contributes cells. This is used to access information such as MemPage.intKey and MemPage.pBt->pageSize which should be common to all pages that contribute cells to this array.

apCell[] and szCell[] hold, respectively, pointers to the start of each cell and the size of each cell. Some of the apCell[] pointers might refer to overflow cells. In other words, some apCel[] pointers might not point to content area of the pages.

A szCell[] of zero means the size of that cell has not yet been computed.

The cells come from as many as four different pages:

           -----------
           | Parent  |
           -----------
          /     |     **           /      |      **  ---------   ---------   ---------
|Child-1|   |Child-2|   |Child-3|
---------   ---------   ---------

The order of cells is in the array is for an index btree is:

  1. All cells from Child-1 in order
  2. The first divider cell from Parent
  3. All cells from Child-2 in order
  4. The second divider cell from Parent
  5. All cells from Child-3 in order

For a table-btree (with rowids) the items 2 and 4 are empty because content exists only in leaves and there are no divider cells.

For an index btree, the apEnd[] array holds pointer to the end of page for Child-1, the Parent, Child-2, the Parent (again), and Child-3, respectively. The ixNx[] array holds the number of cells contained in each of these 5 stages, and all stages to the left. Hence:

ixNx[0] = Number of cells in Child-1.
ixNx[1] = Number of cells in Child-1 plus 1 for first divider.
ixNx[2] = Number of cells in Child-1 and Child-2 + 1 for 1st divider.
ixNx[3] = Number of cells in Child-1 and Child-2 + both divider cells
ixNx[4] = Total number of cells.

For a table-btree, the concept is similar, except only apEnd[0]..apEnd[2] are used and they point to the leaf pages only, and the ixNx value are:

ixNx[0] = Number of cells in Child-1.
ixNx[1] = Number of cells in Child-1 and Child-2.
ixNx[2] = Total number of cells.

Sometimes when deleting, a child page can have zero cells. In those cases, ixNx[] entries with higher indexes, and the corresponding apEnd[] entries, shift down. The end result is that each ixNx[] entry should be larger than the previous

type CellArray1

type CellArray1 = struct {
	FnCell int32

	FpRef   uintptr
	FapCell uintptr
	FszCell uintptr
	FapEnd  [6]uintptr
	FixNx   [6]int32
	// contains filtered or unexported fields

} /* sqlite3.c:72392:9 */

A CellArray object contains a cache of pointers and sizes for a consecutive sequence of cells that might be held on multiple pages.

The cells in this array are the divider cell or cells from the pParent page plus up to three child pages. There are a total of nCell cells.

pRef is a pointer to one of the pages that contributes cells. This is used to access information such as MemPage.intKey and MemPage.pBt->pageSize which should be common to all pages that contribute cells to this array.

apCell[] and szCell[] hold, respectively, pointers to the start of each cell and the size of each cell. Some of the apCell[] pointers might refer to overflow cells. In other words, some apCel[] pointers might not point to content area of the pages.

A szCell[] of zero means the size of that cell has not yet been computed.

The cells come from as many as four different pages:

           -----------
           | Parent  |
           -----------
          /     |     **           /      |      **  ---------   ---------   ---------
|Child-1|   |Child-2|   |Child-3|
---------   ---------   ---------

The order of cells is in the array is for an index btree is:

  1. All cells from Child-1 in order
  2. The first divider cell from Parent
  3. All cells from Child-2 in order
  4. The second divider cell from Parent
  5. All cells from Child-3 in order

For a table-btree (with rowids) the items 2 and 4 are empty because content exists only in leaves and there are no divider cells.

For an index btree, the apEnd[] array holds pointer to the end of page for Child-1, the Parent, Child-2, the Parent (again), and Child-3, respectively. The ixNx[] array holds the number of cells contained in each of these 5 stages, and all stages to the left. Hence:

ixNx[0] = Number of cells in Child-1.
ixNx[1] = Number of cells in Child-1 plus 1 for first divider.
ixNx[2] = Number of cells in Child-1 and Child-2 + 1 for 1st divider.
ixNx[3] = Number of cells in Child-1 and Child-2 + both divider cells
ixNx[4] = Total number of cells.

For a table-btree, the concept is similar, except only apEnd[0]..apEnd[2] are used and they point to the leaf pages only, and the ixNx value are:

ixNx[0] = Number of cells in Child-1.
ixNx[1] = Number of cells in Child-1 and Child-2.
ixNx[2] = Total number of cells.

Sometimes when deleting, a child page can have zero cells. In those cases, ixNx[] entries with higher indexes, and the corresponding apEnd[] entries, shift down. The end result is that each ixNx[] entry should be larger than the previous

type CellInfo

type CellInfo = CellInfo1 /* sqlite3.c:64660:25 */

type CellInfo1

type CellInfo1 = struct {
	FnKey     I64
	FpPayload uintptr
	FnPayload U32
	FnLocal   U16
	FnSize    U16

} /* sqlite3.c:1331:9 */

type Clock_t

type Clock_t = X__clock_t /* clock_t.h:7:19 */

Returned by `clock'.

type Clockid_t

type Clockid_t = X__clockid_t /* clockid_t.h:7:21 */

Clock ID used in clock and timer functions.

type CollSeq

type CollSeq = CollSeq1 /* sqlite3.c:14888:24 */

type CollSeq1

type CollSeq1 = struct {
	FzName uintptr
	Fenc   U8

	FpUser uintptr
	FxCmp  uintptr
	FxDel  uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Column

type Column = Column1 /* sqlite3.c:14889:23 */

type Column1

type Column1 = struct {
	FzName    uintptr
	FpDflt    uintptr
	FzColl    uintptr
	FnotNull  U8
	Faffinity int8
	FszEst    U8
	FhName    U8
	FcolFlags U16
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Comparison_fn_t

type Comparison_fn_t = X__compar_fn_t /* stdlib.h:808:23 */
type Cookie_io_functions_t = _IO_cookie_io_functions_t /* cookie_io_functions_t.h:61:3 */

The structure with the cookie function pointers.

The tag name of this struct is _IO_cookie_io_functions_t to
preserve historic C++ mangled names for functions taking
cookie_io_functions_t arguments.  That name should not be used in
new code.

type CountCtx

type CountCtx = CountCtx1 /* sqlite3.c:120920:25 */

The following structure keeps track of state information for the count() aggregate function.

type CountCtx1

type CountCtx1 = struct{ Fn I64 } /* sqlite3.c:120920:9 */

The following structure keeps track of state information for the count() aggregate function.

type Cpu_set_t

type Cpu_set_t = struct{ F__bits [16]X__cpu_mask } /* cpu-set.h:42:3 */

Data structure to describe CPU mask.

type Cte

type Cte = Cte1 /* sqlite3.c:14890:20 */

type Cte1

type Cte1 = struct {
	FzName   uintptr
	FpCols   uintptr
	FpSelect uintptr
	FzCteErr uintptr
	FpUse    uintptr
	FeM10d   U8
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type CteUse

type CteUse = CteUse1 /* sqlite3.c:14891:23 */

type CteUse1

type CteUse1 = struct {
	FnUse    int32
	FaddrM9e int32
	FregRtn  int32
	FiCur    int32
	FnRowEst LogEst
	FeM10d   U8
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Daddr_t

type Daddr_t = X__daddr_t /* types.h:114:19 */

type DateTime

type DateTime = DateTime1 /* sqlite3.c:22238:25 */

A structure for holding a single date and time.

type DateTime1

type DateTime1 = struct {
	FiJD      Sqlite3_int64
	FY        int32
	FM        int32
	FD        int32
	Fh        int32
	Fm        int32
	Ftz       int32
	Fs        float64
	FvalidJD  int8
	FrawS     int8
	FvalidYMD int8
	FvalidHMS int8
	FvalidTZ  int8
	FtzSet    int8
	FisError  int8
	// contains filtered or unexported fields

} /* sqlite3.c:22238:9 */

A structure for holding a single date and time.

type Db

type Db = Db1 /* sqlite3.c:14892:19 */

type Db1

type Db1 = struct {
	FzDbSName     uintptr
	FpBt          uintptr
	Fsafety_level U8
	FbSyncSet     U8

	FpSchema uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type DbFixer

type DbFixer = DbFixer1 /* sqlite3.c:14893:24 */

type DbFixer1

type DbFixer1 = struct {
	FpParse  uintptr
	Fw       Walker
	FpSchema uintptr
	FbTemp   U8

	FzDb   uintptr
	FzType uintptr
	FpName uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:14893:9 */

type DbPage

type DbPage = PgHdr2 /* sqlite3.c:15024:22 */

Handle type for pages.

type DblquoteStr

type DblquoteStr = DblquoteStr1 /* sqlite3.c:21531:28 */

The DblquoteStr object holds the text of a double-quoted string for a prepared statement. A linked list of these objects is constructed during statement parsing and is held on Vdbe.pDblStr. When computing a normalized SQL statement for an SQL statement, that list is consulted for each double-quoted identifier to see if the identifier should really be a string literal.

type DblquoteStr1

type DblquoteStr1 = struct {
	FpNextStr uintptr
	Fz        [8]int8

} /* sqlite3.c:21531:9 */

The DblquoteStr object holds the text of a double-quoted string for a prepared statement. A linked list of these objects is constructed during statement parsing and is held on Vdbe.pDblStr. When computing a normalized SQL statement for an SQL statement, that list is consulted for each double-quoted identifier to see if the identifier should really be a string literal.

type DbpageCursor

type DbpageCursor = DbpageCursor1 /* sqlite3.c:206263:29 */

type DbpageCursor1

type DbpageCursor1 = struct {
	Fbase   Sqlite3_vtab_cursor
	Fpgno   int32
	FmxPgno int32
	FpPager uintptr
	FpPage1 uintptr
	FiDb    int32
	FszPage int32

} /* sqlite3.c:206263:9 */

type DbpageTable

type DbpageTable = DbpageTable1 /* sqlite3.c:206262:28 */

type DbpageTable1

type DbpageTable1 = struct {
	Fbase Sqlite3_vtab
	Fdb   uintptr

} /* sqlite3.c:206262:9 */

type Dev_t

type Dev_t = X__dev_t /* types.h:59:17 */

type DistinctCtx

type DistinctCtx = DistinctCtx1 /* sqlite3.c:132093:28 */

An instance of the following object is used to record information about how to process the DISTINCT keyword, to simplify passing that information into the selectInnerLoop() routine.

type DistinctCtx1

type DistinctCtx1 = struct {
	FisTnct    U8
	FeTnctType U8

	FtabTnct  int32
	FaddrTnct int32
	// contains filtered or unexported fields

} /* sqlite3.c:132093:9 */

An instance of the following object is used to record information about how to process the DISTINCT keyword, to simplify passing that information into the selectInnerLoop() routine.

type Div_t

type Div_t = struct {
	Fquot int32
	Frem  int32

} /* stdlib.h:62:5 */

Returned by `div'.

type Dl_info

type Dl_info = struct {
	Fdli_fname uintptr
	Fdli_fbase uintptr
	Fdli_sname uintptr
	Fdli_saddr uintptr

} /* dlfcn.h:94:3 */

Structure containing information about object searched using

`dladdr'.

type Dl_serinfo

type Dl_serinfo = struct {
	Fdls_size Size_t
	Fdls_cnt  uint32

	Fdls_serpath [1]Dl_serpath
	// contains filtered or unexported fields

} /* dlfcn.h:184:3 */

This is the structure that must be passed (by reference) to `dlinfo' for

the RTLD_DI_SERINFO and RTLD_DI_SERINFOSIZE requests.

type Dl_serpath

type Dl_serpath = struct {
	Fdls_name  uintptr
	Fdls_flags uint32
	// contains filtered or unexported fields

} /* dlfcn.h:175:3 */

This is the type of elements in `Dl_serinfo', below.

The `dls_name' member points to space in the buffer passed to `dlinfo'.

type Double_t

type Double_t = float64 /* math.h:150:16 */

type EncName

type EncName = struct {
	FzName uintptr
	Fenc   U8
	// contains filtered or unexported fields

} /* sqlite3.c:130282:18 */

type Error_t

type Error_t = int32 /* error_t.h:22:13 */

type EtByte

type EtByte = uint8 /* sqlite3.c:28659:23 */

An "etByte" is an 8-bit unsigned value.

type Et_info

type Et_info = et_info /* sqlite3.c:28672:3 */

Each builtin conversion character (ex: the 'd' in "%d") is described by an instance of the following structure

type Expr

type Expr = Expr1 /* sqlite3.c:14895:21 */

type Expr1

type Expr1 = struct {
	Fop      U8
	FaffExpr int8
	Fop2     U8

	Fflags           U32
	Fu               struct{ FzToken uintptr }
	FpLeft           uintptr
	FpRight          uintptr
	Fx               struct{ FpList uintptr }
	FnHeight         int32
	FiTable          int32
	FiColumn         YnVar
	FiAgg            I16
	FiRightJoinTable int32
	FpAggInfo        uintptr
	Fy               struct{ FpTab uintptr }
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type ExprList

type ExprList = ExprList1 /* sqlite3.c:14896:25 */

type ExprList1

type ExprList1 = struct {
	FnExpr  int32
	FnAlloc int32
	Fa      [1]struct {
		FpExpr     uintptr
		FzEName    uintptr
		FsortFlags U8

		FeEName uint8 /* unsigned eEName: 2, unsigned done: 1, unsigned reusable: 1, unsigned bSorterRef: 1, unsigned bNulls: 1 */

		Fu struct {
			Fx struct {
				FiOrderByCol U16
				FiAlias      U16
			}
			// contains filtered or unexported fields
		}
		// contains filtered or unexported fields
	}

} /* sqlite3.c:1331:9 */

type ExprList_item

type ExprList_item = struct {
	FpExpr     uintptr
	FzEName    uintptr
	FsortFlags U8

	FeEName uint8 /* unsigned eEName: 2, unsigned done: 1, unsigned reusable: 1, unsigned bSorterRef: 1, unsigned bNulls: 1 */

	Fu struct {
		Fx struct {
			FiOrderByCol U16
			FiAlias      U16
		}
		// contains filtered or unexported fields
	}
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

A list of expressions. Each expression may optionally have a name. An expr/name combination can be used in several ways, such as the list of "expr AS ID" fields following a "SELECT" or in the list of "ID = expr" items in an UPDATE. A list of expressions can also be used as the argument to a function, in which case the a.zName field is not used.

In order to try to keep memory usage down, the Expr.a.zEName field is used for multiple purposes:

 eEName          Usage
----------       -------------------------
ENAME_NAME       (1) the AS of result set column
                 (2) COLUMN= of an UPDATE

ENAME_TAB        DB.TABLE.NAME used to resolve names
                 of subqueries

ENAME_SPAN       Text of the original result set
                 expression.

type FILE

type FILE = _IO_FILE /* FILE.h:7:25 */

The opaque type of streams. This is the definition used elsewhere.

type FKey

type FKey = FKey1 /* sqlite3.c:14897:21 */

type FKey1

type FKey1 = struct {
	FpFrom      uintptr
	FpNextFrom  uintptr
	FzTo        uintptr
	FpNextTo    uintptr
	FpPrevTo    uintptr
	FnCol       int32
	FisDeferred U8
	FaAction    [2]U8

	FapTrigger [2]uintptr
	FaCol      [1]struct {
		FiFrom int32

		FzCol uintptr
		// contains filtered or unexported fields
	}
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Fd_mask

type Fd_mask = X__fd_mask /* select.h:77:19 */

Sometimes the fd_set member is assumed to have this type.

type Fd_set

type Fd_set = struct{ Ffds_bits [16]X__fd_mask } /* select.h:70:5 */

fd_set for select and pselect.

type FileChunk

type FileChunk = FileChunk1 /* sqlite3.c:98542:26 */

type FileChunk1

type FileChunk1 = struct {
	FpNext  uintptr
	FzChunk [8]U8

} /* sqlite3.c:98540:9 */

type FilePoint

type FilePoint = FilePoint1 /* sqlite3.c:98541:26 */

type FilePoint1

type FilePoint1 = struct {
	FiOffset Sqlite3_int64
	FpChunk  uintptr

} /* sqlite3.c:98540:9 */

type Finder_type

type Finder_type = uintptr /* sqlite3.c:39667:34 */

An abstract type for a pointer to an IO method finder function:

type Float_t

type Float_t = float32 /* math.h:149:15 */

Define the following typedefs.

    float_t	floating-point type at least as wide as `float' used
		to evaluate `float' expressions
    double_t	floating-point type at least as wide as `double' used
		to evaluate `double' expressions

type Fpos64_t

type Fpos64_t = X__fpos64_t /* stdio.h:89:20 */

type Fpos_t

type Fpos_t = X__fpos64_t /* stdio.h:86:20 */

The type of the second argument to `fgetpos' and `fsetpos'.

type FrameBound

type FrameBound = struct {
	FeType int32

	FpExpr uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:158070:1 */

type Fsblkcnt64_t

type Fsblkcnt64_t = X__fsblkcnt64_t /* types.h:237:24 */ // Type to count file system blocks.

type Fsblkcnt_t

type Fsblkcnt_t = X__fsblkcnt64_t /* types.h:226:24 */ // Type to count file system blocks.

type Fsfilcnt64_t

type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:238:24 */ // Type to count file system inodes.

type Fsfilcnt_t

type Fsfilcnt_t = X__fsfilcnt64_t /* types.h:230:24 */ // Type to count file system inodes.

type Fsid_t

type Fsid_t = X__fsid_t /* types.h:39:18 */

type Fts5Auxdata

type Fts5Auxdata = Fts5Auxdata1 /* sqlite3.c:227820:28 */

type Fts5Auxdata1

type Fts5Auxdata1 = struct {
	FpAux    uintptr
	FpPtr    uintptr
	FxDelete uintptr
	FpNext   uintptr

} /* sqlite3.c:213118:9 */

type Fts5Auxiliary

type Fts5Auxiliary = Fts5Auxiliary1 /* sqlite3.c:227821:30 */

type Fts5Auxiliary1

type Fts5Auxiliary1 = struct {
	FpGlobal   uintptr
	FzFunc     uintptr
	FpUserData uintptr
	FxFunc     Fts5_extension_function
	FxDestroy  uintptr
	FpNext     uintptr

} /* sqlite3.c:213118:9 */

type Fts5Bm25Data

type Fts5Bm25Data = Fts5Bm25Data1 /* sqlite3.c:215879:29 */

The first time the bm25() function is called for a query, an instance of the following structure is allocated and populated.

type Fts5Bm25Data1

type Fts5Bm25Data1 = struct {
	FnPhrase int32

	Favgdl float64
	FaIDF  uintptr
	FaFreq uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:215879:9 */

The first time the bm25() function is called for a query, an instance of the following structure is allocated and populated.

type Fts5Buffer

type Fts5Buffer = Fts5Buffer1 /* sqlite3.c:213265:27 */

Buffer object for the incremental building of string data.

type Fts5Buffer1

type Fts5Buffer1 = struct {
	Fp      uintptr
	Fn      int32
	FnSpace int32

} /* sqlite3.c:213118:9 */

Buffer object for the incremental building of string data.

type Fts5CResult

type Fts5CResult = Fts5CResult1 /* sqlite3.c:221431:28 */

type Fts5CResult1

type Fts5CResult1 = struct {
	FiFirst  U16
	FbTermEq U8
	// contains filtered or unexported fields

} /* sqlite3.c:221314:9 */

type Fts5Colset

type Fts5Colset = Fts5Colset1 /* sqlite3.c:213119:27 */

type Fts5Colset1

type Fts5Colset1 = struct {
	FnCol  int32
	FaiCol [1]int32

} /* sqlite3.c:213118:9 */

type Fts5Config

type Fts5Config = Fts5Config1 /* sqlite3.c:213139:27 */

type Fts5Config1

type Fts5Config1 = struct {
	Fdb    uintptr
	FzDb   uintptr
	FzName uintptr
	FnCol  int32

	FazCol       uintptr
	FabUnindexed uintptr
	FnPrefix     int32

	FaPrefix  uintptr
	FeContent int32

	FzContent         uintptr
	FzContentRowid    uintptr
	FbColumnsize      int32
	FeDetail          int32
	FzContentExprlist uintptr
	FpTok             uintptr
	FpTokApi          uintptr
	FbLock            int32
	FePattern         int32
	FiCookie          int32
	Fpgsz             int32
	FnAutomerge       int32
	FnCrisisMerge     int32
	FnUsermerge       int32
	FnHashSize        int32
	FzRank            uintptr
	FzRankArgs        uintptr
	FpzErrmsg         uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:213118:9 */

type Fts5Cursor

type Fts5Cursor = Fts5Cursor1 /* sqlite3.c:227822:27 */

type Fts5Cursor1

type Fts5Cursor1 = struct {
	Fbase        Sqlite3_vtab_cursor
	FpNext       uintptr
	FaColumnSize uintptr
	FiCsrId      I64
	FePlan       int32
	FbDesc       int32
	FiFirstRowid I64
	FiLastRowid  I64
	FpStmt       uintptr
	FpExpr       uintptr
	FpSorter     uintptr
	Fcsrflags    int32

	FiSpecial  I64
	FzRank     uintptr
	FzRankArgs uintptr
	FpRank     uintptr
	FnRankArg  int32

	FapRankArg    uintptr
	FpRankArgStmt uintptr
	FpAux         uintptr
	FpAuxdata     uintptr
	FaInstIter    uintptr
	FnInstAlloc   int32
	FnInstCount   int32
	FaInst        uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:213118:9 */

type Fts5Data

type Fts5Data = Fts5Data1 /* sqlite3.c:221310:25 */

type Fts5Data1

type Fts5Data1 = struct {
	Fp      uintptr
	Fnn     int32
	FszLeaf int32

} /* sqlite3.c:221310:9 */

type Fts5DlidxIter

type Fts5DlidxIter = Fts5DlidxIter1 /* sqlite3.c:221311:30 */

type Fts5DlidxIter1

type Fts5DlidxIter1 = struct {
	FnLvl   int32
	FiSegid int32
	FaLvl   [1]Fts5DlidxLvl

} /* sqlite3.c:221311:9 */

type Fts5DlidxLvl

type Fts5DlidxLvl = Fts5DlidxLvl1 /* sqlite3.c:221312:29 */

type Fts5DlidxLvl1

type Fts5DlidxLvl1 = struct {
	FpData     uintptr
	FiOff      int32
	FbEof      int32
	FiFirstOff int32
	FiLeafPgno int32
	FiRowid    I64

} /* sqlite3.c:221311:9 */

type Fts5DlidxWriter

type Fts5DlidxWriter = Fts5DlidxWriter1 /* sqlite3.c:221313:32 */

type Fts5DlidxWriter1

type Fts5DlidxWriter1 = struct {
	Fpgno       int32
	FbPrevValid int32
	FiPrev      I64
	Fbuf        Fts5Buffer

} /* sqlite3.c:221313:9 */

type Fts5DoclistIter

type Fts5DoclistIter = Fts5DoclistIter1 /* sqlite3.c:221317:32 */

type Fts5DoclistIter1

type Fts5DoclistIter1 = struct {
	FaEof     uintptr
	FiRowid   I64
	FaPoslist uintptr
	FnPoslist int32
	FnSize    int32

} /* sqlite3.c:221317:9 */

type Fts5Enum

type Fts5Enum = Fts5Enum1 /* sqlite3.c:216674:25 */

type Fts5Enum1

type Fts5Enum1 = struct {
	FzName uintptr
	FeVal  int32
	// contains filtered or unexported fields

} /* sqlite3.c:216670:1 */

type Fts5Expr

type Fts5Expr = Fts5Expr1 /* sqlite3.c:213681:25 */

*************************************************************************

Interface to code in fts5_expr.c.

type Fts5Expr1

type Fts5Expr1 = struct {
	FpIndex       uintptr
	FpConfig      uintptr
	FpRoot        uintptr
	FbDesc        int32
	FnPhrase      int32
	FapExprPhrase uintptr

} /* sqlite3.c:213118:9 */

*************************************************************************

Interface to code in fts5_expr.c.

type Fts5ExprCtx

type Fts5ExprCtx = Fts5ExprCtx1 /* sqlite3.c:220320:28 */

type Fts5ExprCtx1

type Fts5ExprCtx1 = struct {
	FpExpr      uintptr
	FaPopulator uintptr
	FiOff       I64

} /* sqlite3.c:220315:1 */

type Fts5ExprFunc

type Fts5ExprFunc = struct {
	Fz uintptr
	Fx uintptr

} /* sqlite3.c:220222:3 */

type Fts5ExprNearset

type Fts5ExprNearset = Fts5ExprNearset1 /* sqlite3.c:213686:32 */

type Fts5ExprNearset1

type Fts5ExprNearset1 = struct {
	FnNear int32

	FpColset uintptr
	FnPhrase int32

	FapPhrase [1]uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:213118:9 */

type Fts5ExprNode

type Fts5ExprNode = Fts5ExprNode1 /* sqlite3.c:213682:29 */

type Fts5ExprNode1

type Fts5ExprNode1 = struct {
	FeType    int32
	FbEof     int32
	FbNomatch int32

	FxNext  uintptr
	FiRowid I64
	FpNear  uintptr
	FnChild int32

	FapChild [1]uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:213118:9 */

type Fts5ExprPhrase

type Fts5ExprPhrase = Fts5ExprPhrase1 /* sqlite3.c:213685:31 */

type Fts5ExprPhrase1

type Fts5ExprPhrase1 = struct {
	FpNode   uintptr
	Fposlist Fts5Buffer
	FnTerm   int32

	FaTerm [1]Fts5ExprTerm
	// contains filtered or unexported fields

} /* sqlite3.c:213118:9 */

type Fts5ExprTerm

type Fts5ExprTerm = Fts5ExprTerm1 /* sqlite3.c:217459:29 */

type Fts5ExprTerm1

type Fts5ExprTerm1 = struct {
	FbPrefix U8
	FbFirst  U8

	FzTerm    uintptr
	FpIter    uintptr
	FpSynonym uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:213118:9 */

type Fts5ExtensionApi

type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.c:12895:33 */

type Fts5ExtensionApi1

type Fts5ExtensionApi1 = struct {
	FiVersion int32

	FxUserData          uintptr
	FxColumnCount       uintptr
	FxRowCount          uintptr
	FxColumnTotalSize   uintptr
	FxTokenize          uintptr
	FxPhraseCount       uintptr
	FxPhraseSize        uintptr
	FxInstCount         uintptr
	FxInst              uintptr
	FxRowid             uintptr
	FxColumnText        uintptr
	FxColumnSize        uintptr
	FxQueryPhrase       uintptr
	FxSetAuxdata        uintptr
	FxGetAuxdata        uintptr
	FxPhraseFirst       uintptr
	FxPhraseNext        uintptr
	FxPhraseFirstColumn uintptr
	FxPhraseNextColumn  uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:12895:9 */

type Fts5FlushCtx

type Fts5FlushCtx = Fts5FlushCtx1 /* sqlite3.c:225515:29 */

type Fts5FlushCtx1

type Fts5FlushCtx1 = struct {
	FpIdx   uintptr
	Fwriter Fts5SegWriter

} /* sqlite3.c:225515:9 */

type Fts5FullTable

type Fts5FullTable = Fts5FullTable1 /* sqlite3.c:227823:30 */

type Fts5FullTable1

type Fts5FullTable1 = struct {
	Fp        Fts5Table
	FpStorage uintptr
	FpGlobal  uintptr
	FpSortCsr uintptr

} /* sqlite3.c:227823:9 */

type Fts5Global

type Fts5Global = Fts5Global1 /* sqlite3.c:213118:27 */

type Fts5Global1

type Fts5Global1 = struct {
	Fapi      Fts5_api
	Fdb       uintptr
	FiNextId  I64
	FpAux     uintptr
	FpTok     uintptr
	FpDfltTok uintptr
	FpCsr     uintptr

} /* sqlite3.c:213118:9 */

type Fts5Hash

type Fts5Hash = Fts5Hash1 /* sqlite3.c:213582:25 */

*************************************************************************

Interface to code in fts5_hash.c.

type Fts5Hash1

type Fts5Hash1 = struct {
	FeDetail int32

	FpnByte uintptr
	FnEntry int32
	FnSlot  int32
	FpScan  uintptr
	FaSlot  uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:213118:9 */

*************************************************************************

Interface to code in fts5_hash.c.

type Fts5HashEntry

type Fts5HashEntry = Fts5HashEntry1 /* sqlite3.c:220513:30 */

type Fts5HashEntry1

type Fts5HashEntry1 = struct {
	FpHashNext  uintptr
	FpScanNext  uintptr
	FnAlloc     int32
	FiSzPoslist int32
	FnData      int32
	FnKey       int32
	FbDel       U8
	FbContent   U8
	FiCol       I16
	FiPos       int32
	FiRowid     I64

} /* sqlite3.c:213118:9 */

type Fts5Index

type Fts5Index = Fts5Index1 /* sqlite3.c:213356:26 */

type Fts5Index1

type Fts5Index1 = struct {
	FpConfig   uintptr
	FzDataTbl  uintptr
	FnWorkUnit int32

	FpHash        uintptr
	FnPendingData int32

	FiWriteRowid I64
	FbDelete     int32
	Frc          int32
	FpReader     uintptr
	FpWriter     uintptr
	FpDeleter    uintptr
	FpIdxWriter  uintptr
	FpIdxDeleter uintptr
	FpIdxSelect  uintptr
	FnRead       int32

	FpDataVersion   uintptr
	FiStructVersion I64
	FpStruct        uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:213118:9 */

type Fts5IndexIter

type Fts5IndexIter = Fts5IndexIter1 /* sqlite3.c:213357:30 */

type Fts5IndexIter1

type Fts5IndexIter1 = struct {
	FiRowid I64
	FpData  uintptr
	FnData  int32
	FbEof   U8
	// contains filtered or unexported fields

} /* sqlite3.c:213118:9 */

type Fts5InsertCtx

type Fts5InsertCtx = Fts5InsertCtx1 /* sqlite3.c:231075:30 */

type Fts5InsertCtx1

type Fts5InsertCtx1 = struct {
	FpStorage uintptr
	FiCol     int32
	FszCol    int32

} /* sqlite3.c:231075:9 */

type Fts5IntegrityCtx

type Fts5IntegrityCtx = Fts5IntegrityCtx1 /* sqlite3.c:231516:33 */

Context object used by sqlite3Fts5StorageIntegrity().

type Fts5IntegrityCtx1

type Fts5IntegrityCtx1 = struct {
	FiRowid   I64
	FiCol     int32
	FszCol    int32
	Fcksum    U64
	FpTermset uintptr
	FpConfig  uintptr

} /* sqlite3.c:231516:9 */

Context object used by sqlite3Fts5StorageIntegrity().

type Fts5Iter

type Fts5Iter = Fts5Iter1 /* sqlite3.c:221314:25 */

type Fts5Iter1

type Fts5Iter1 = struct {
	Fbase        Fts5IndexIter
	FpIndex      uintptr
	Fposlist     Fts5Buffer
	FpColset     uintptr
	FxSetOutputs uintptr
	FnSeg        int32
	FbRev        int32
	FbSkipEmpty  U8

	FiSwitchRowid I64
	FaFirst       uintptr
	FaSeg         [1]Fts5SegIter
	// contains filtered or unexported fields

} /* sqlite3.c:221314:9 */

type Fts5LookaheadReader

type Fts5LookaheadReader = Fts5LookaheadReader1 /* sqlite3.c:218054:36 */

type Fts5LookaheadReader1

type Fts5LookaheadReader1 = struct {
	Fa          uintptr
	Fn          int32
	Fi          int32
	FiPos       I64
	FiLookahead I64

} /* sqlite3.c:218054:9 */

type Fts5MatchPhrase

type Fts5MatchPhrase = struct {
	FpPoslist uintptr
	FnTerm    int32
	// contains filtered or unexported fields

} /* sqlite3.c:227915:1 */

type Fts5NearTrimmer

type Fts5NearTrimmer = Fts5NearTrimmer1 /* sqlite3.c:218084:32 */

type Fts5NearTrimmer1

type Fts5NearTrimmer1 = struct {
	Freader Fts5LookaheadReader
	Fwriter Fts5PoslistWriter
	FpOut   uintptr

} /* sqlite3.c:218084:9 */

type Fts5PageWriter

type Fts5PageWriter = Fts5PageWriter1 /* sqlite3.c:221315:31 */

type Fts5PageWriter1

type Fts5PageWriter1 = struct {
	Fpgno       int32
	FiPrevPgidx int32
	Fbuf        Fts5Buffer
	Fpgidx      Fts5Buffer
	Fterm       Fts5Buffer

} /* sqlite3.c:221315:9 */

type Fts5Parse

type Fts5Parse = Fts5Parse1 /* sqlite3.c:213683:26 */

type Fts5Parse1

type Fts5Parse1 = struct {
	FpConfig      uintptr
	FzErr         uintptr
	Frc           int32
	FnPhrase      int32
	FapPhrase     uintptr
	FpExpr        uintptr
	FbPhraseToAnd int32
	// contains filtered or unexported fields

} /* sqlite3.c:213683:9 */

type Fts5PhraseIter

type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.c:12897:31 */

type Fts5PhraseIter1

type Fts5PhraseIter1 = struct {
	Fa uintptr
	Fb uintptr

} /* sqlite3.c:12897:9 */

type Fts5PoslistPopulator

type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:213734:37 */

type Fts5PoslistPopulator1

type Fts5PoslistPopulator1 = struct {
	Fwriter Fts5PoslistWriter
	FbOk    int32
	FbMiss  int32

} /* sqlite3.c:213734:9 */

type Fts5PoslistReader

type Fts5PoslistReader = Fts5PoslistReader1 /* sqlite3.c:213301:34 */

type Fts5PoslistReader1

type Fts5PoslistReader1 = struct {
	Fa     uintptr
	Fn     int32
	Fi     int32
	FbFlag U8
	FbEof  U8

	FiPos I64
	// contains filtered or unexported fields

} /* sqlite3.c:213118:9 */

type Fts5PoslistWriter

type Fts5PoslistWriter = Fts5PoslistWriter1 /* sqlite3.c:213320:34 */

type Fts5PoslistWriter1

type Fts5PoslistWriter1 = struct{ FiPrev I64 } /* sqlite3.c:213320:9 */

type Fts5SFinder

type Fts5SFinder = Fts5SFinder1 /* sqlite3.c:215598:28 */

Context object passed to the fts5SentenceFinderCb() function.

type Fts5SFinder1

type Fts5SFinder1 = struct {
	FiPos        int32
	FnFirstAlloc int32
	FnFirst      int32

	FaFirst uintptr
	FzDoc   uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:215598:9 */

Context object passed to the fts5SentenceFinderCb() function.

type Fts5SegIter

type Fts5SegIter = Fts5SegIter1 /* sqlite3.c:221316:28 */

type Fts5SegIter1

type Fts5SegIter1 = struct {
	FpSeg            uintptr
	Fflags           int32
	FiLeafPgno       int32
	FpLeaf           uintptr
	FpNextLeaf       uintptr
	FiLeafOffset     I64
	FxNext           uintptr
	FiTermLeafPgno   int32
	FiTermLeafOffset int32
	FiPgidxOff       int32
	FiEndofDoclist   int32
	FiRowidOffset    int32
	FnRowidOffset    int32
	FaRowidOffset    uintptr
	FpDlidx          uintptr
	Fterm            Fts5Buffer
	FiRowid          I64
	FnPos            int32
	FbDel            U8
	// contains filtered or unexported fields

} /* sqlite3.c:221314:9 */

type Fts5SegWriter

type Fts5SegWriter = Fts5SegWriter1 /* sqlite3.c:221318:30 */

type Fts5SegWriter1

type Fts5SegWriter1 = struct {
	FiSegid int32

	Fwriter               Fts5PageWriter
	FiPrevRowid           I64
	FbFirstRowidInDoclist U8
	FbFirstRowidInPage    U8
	FbFirstTermInPage     U8

	FnLeafWritten int32
	FnEmpty       int32
	FnDlidx       int32
	FaDlidx       uintptr
	Fbtterm       Fts5Buffer
	FiBtPage      int32
	// contains filtered or unexported fields

} /* sqlite3.c:221318:9 */

type Fts5Sorter

type Fts5Sorter = Fts5Sorter1 /* sqlite3.c:227824:27 */

type Fts5Sorter1

type Fts5Sorter1 = struct {
	FpStmt    uintptr
	FiRowid   I64
	FaPoslist uintptr
	FnIdx     int32
	FaIdx     [1]int32

} /* sqlite3.c:213118:9 */

type Fts5Storage

type Fts5Storage = Fts5Storage1 /* sqlite3.c:213638:28 */

type Fts5Storage1

type Fts5Storage1 = struct {
	FpConfig      uintptr
	FpIndex       uintptr
	FbTotalsValid int32

	FnTotalRow  I64
	FaTotalSize uintptr
	FaStmt      [11]uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:213638:9 */

type Fts5Structure

type Fts5Structure = Fts5Structure1 /* sqlite3.c:221319:30 */

type Fts5Structure1

type Fts5Structure1 = struct {
	FnRef int32

	FnWriteCounter U64
	FnSegment      int32
	FnLevel        int32
	FaLevel        [1]Fts5StructureLevel
	// contains filtered or unexported fields

} /* sqlite3.c:213118:9 */

type Fts5StructureLevel

type Fts5StructureLevel = Fts5StructureLevel1 /* sqlite3.c:221320:35 */

type Fts5StructureLevel1

type Fts5StructureLevel1 = struct {
	FnMerge int32
	FnSeg   int32
	FaSeg   uintptr

} /* sqlite3.c:213118:9 */

type Fts5StructureSegment

type Fts5StructureSegment = Fts5StructureSegment1 /* sqlite3.c:221321:37 */

type Fts5StructureSegment1

type Fts5StructureSegment1 = struct {
	FiSegid    int32
	FpgnoFirst int32
	FpgnoLast  int32

} /* sqlite3.c:213118:9 */

type Fts5Table

type Fts5Table = Fts5Table1 /* sqlite3.c:213556:26 */

Virtual-table object.

type Fts5Table1

type Fts5Table1 = struct {
	Fbase    Sqlite3_vtab
	FpConfig uintptr
	FpIndex  uintptr

} /* sqlite3.c:213556:9 */

Virtual-table object.

type Fts5Termset

type Fts5Termset = Fts5Termset1 /* sqlite3.c:213342:28 */

Bucket of terms object used by the integrity-check in offsets=0 mode.

type Fts5Termset1

type Fts5Termset1 = struct{ FapHash [512]uintptr } /* sqlite3.c:213342:9 */

Bucket of terms object used by the integrity-check in offsets=0 mode.

type Fts5TermsetEntry

type Fts5TermsetEntry = Fts5TermsetEntry1 /* sqlite3.c:216390:33 */

************************************************************************

type Fts5TermsetEntry1

type Fts5TermsetEntry1 = struct {
	FpTerm uintptr
	FnTerm int32
	FiIdx  int32
	FpNext uintptr

} /* sqlite3.c:213342:9 */

************************************************************************

type Fts5Token

type Fts5Token = Fts5Token1 /* sqlite3.c:213684:26 */

type Fts5Token1

type Fts5Token1 = struct {
	Fp uintptr
	Fn int32
	// contains filtered or unexported fields

} /* sqlite3.c:213684:9 */

type Fts5TokenizerModule

type Fts5TokenizerModule = Fts5TokenizerModule1 /* sqlite3.c:227825:36 */

type Fts5TokenizerModule1

type Fts5TokenizerModule1 = struct {
	FzName     uintptr
	FpUserData uintptr
	Fx         Fts5_tokenizer
	FxDestroy  uintptr
	FpNext     uintptr

} /* sqlite3.c:213118:9 */

type Fts5TransactionState

type Fts5TransactionState = struct {
	FeState     int32
	FiSavepoint int32

} /* sqlite3.c:227858:1 */

NOTES ON TRANSACTIONS:

SQLite invokes the following virtual table methods as transactions are opened and closed by the user:

xBegin():    Start of a new transaction.
xSync():     Initial part of two-phase commit.
xCommit():   Final part of two-phase commit.
xRollback(): Rollback the transaction.

Anything that is required as part of a commit that may fail is performed in the xSync() callback. Current versions of SQLite ignore any errors returned by xCommit().

And as sub-transactions are opened/closed:

xSavepoint(int S):  Open savepoint S.
xRelease(int S):    Commit and close savepoint S.
xRollbackTo(int S): Rollback to start of savepoint S.

During a write-transaction the fts5_index.c module may cache some data in-memory. It is flushed to disk whenever xSync(), xRelease() or xSavepoint() is called. And discarded whenever xRollback() or xRollbackTo() is called.

Additionally, if SQLITE_DEBUG is defined, an instance of the following structure is used to record the current transaction state. This information is not required, but it is used in the assert() statements executed by function fts5CheckTransactionState() (see below).

type Fts5VocabCursor

type Fts5VocabCursor = Fts5VocabCursor1 /* sqlite3.c:234462:32 */

type Fts5VocabCursor1

type Fts5VocabCursor1 = struct {
	Fbase  Sqlite3_vtab_cursor
	FpStmt uintptr
	FpFts5 uintptr
	FbEof  int32

	FpIter   uintptr
	FnLeTerm int32

	FzLeTerm uintptr
	FiCol    int32

	FaCnt     uintptr
	FaDoc     uintptr
	Frowid    I64
	Fterm     Fts5Buffer
	FiInstPos I64
	FiInstOff int32
	// contains filtered or unexported fields

} /* sqlite3.c:234462:9 */

type Fts5VocabTable

type Fts5VocabTable = Fts5VocabTable1 /* sqlite3.c:234461:31 */

type Fts5VocabTable1

type Fts5VocabTable1 = struct {
	Fbase     Sqlite3_vtab
	FzFts5Tbl uintptr
	FzFts5Db  uintptr
	Fdb       uintptr
	FpGlobal  uintptr
	FeType    int32
	FbBusy    uint32

} /* sqlite3.c:234461:9 */

type Fts5YYMINORTYPE

type Fts5YYMINORTYPE = struct {
	Ffts5yyinit int32
	// contains filtered or unexported fields

} /* sqlite3.c:214010:3 */

The next sections is a series of control #defines. various aspects of the generated parser.

fts5YYCODETYPE         is the data type used to store the integer codes
                   that represent terminal and non-terminal symbols.
                   "unsigned char" is used if there are fewer than
                   256 symbols.  Larger types otherwise.
fts5YYNOCODE           is a number of type fts5YYCODETYPE that is not used for
                   any terminal or nonterminal symbol.
fts5YYFALLBACK         If defined, this indicates that one or more tokens
                   (also known as: "terminal symbols") have fall-back
                   values which should be used if the original symbol
                   would not parse.  This permits keywords to sometimes
                   be used as identifiers, for example.
fts5YYACTIONTYPE       is the data type used for "action codes" - numbers
                   that indicate what to do in response to the next
                   token.
sqlite3Fts5ParserFTS5TOKENTYPE     is the data type used for minor type for terminal
                   symbols.  Background: A "minor type" is a semantic
                   value associated with a terminal or non-terminal
                   symbols.  For example, for an "ID" terminal symbol,
                   the minor type might be the name of the identifier.
                   Each non-terminal can have a different minor type.
                   Terminal symbols all have the same minor type, though.
                   This macros defines the minor type for terminal
                   symbols.
fts5YYMINORTYPE        is the data type used for all minor types.
                   This is typically a union of many types, one of
                   which is sqlite3Fts5ParserFTS5TOKENTYPE.  The entry in the union
                   for terminal symbols is called "fts5yy0".
fts5YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
                   zero the stack is dynamically sized using realloc()
sqlite3Fts5ParserARG_SDECL     A static variable declaration for the %extra_argument
sqlite3Fts5ParserARG_PDECL     A parameter declaration for the %extra_argument
sqlite3Fts5ParserARG_PARAM     Code to pass %extra_argument as a subroutine parameter
sqlite3Fts5ParserARG_STORE     Code to store %extra_argument into fts5yypParser
sqlite3Fts5ParserARG_FETCH     Code to extract %extra_argument from fts5yypParser
sqlite3Fts5ParserCTX_*         As sqlite3Fts5ParserARG_ except for %extra_context
fts5YYERRORSYMBOL      is the code number of the error symbol.  If not
                   defined, then do no error processing.
fts5YYNSTATE           the combined number of states.
fts5YYNRULE            the number of rules in the grammar
fts5YYNFTS5TOKEN           Number of terminal symbols
fts5YY_MAX_SHIFT       Maximum value for shift actions
fts5YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
fts5YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
fts5YY_ERROR_ACTION    The fts5yy_action[] code for syntax error
fts5YY_ACCEPT_ACTION   The fts5yy_action[] code for accept
fts5YY_NO_ACTION       The fts5yy_action[] code for no-op
fts5YY_MIN_REDUCE      Minimum value for reduce actions
fts5YY_MAX_REDUCE      Maximum value for reduce actions

************ Begin control #defines ****************************************

type Fts5_api

type Fts5_api = fts5_api /* sqlite3.c:13394:25 */

************************************************************************

FTS5 EXTENSION REGISTRATION API

type Fts5_extension_function

type Fts5_extension_function = uintptr /* sqlite3.c:12899:14 */

type Fts5_tokenizer

type Fts5_tokenizer = fts5_tokenizer /* sqlite3.c:13358:31 */

type Fts5yyParser

type Fts5yyParser = fts5yyParser /* sqlite3.c:214220:29 */

type Fts5yyStackEntry

type Fts5yyStackEntry = fts5yyStackEntry /* sqlite3.c:214197:33 */

type FuncDef

type FuncDef = FuncDef1 /* sqlite3.c:14899:24 */

type FuncDef1

type FuncDef1 = struct {
	FnArg I8

	FfuncFlags U32
	FpUserData uintptr
	FpNext     uintptr
	FxSFunc    uintptr
	FxFinalize uintptr
	FxValue    uintptr
	FxInverse  uintptr
	FzName     uintptr
	Fu         struct{ FpHash uintptr }
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type FuncDefHash

type FuncDefHash = FuncDefHash1 /* sqlite3.c:14900:28 */
var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:21093:28: */

Hash table for global functions - functions common to all database connections. After initialization, this table is read-only.

type FuncDefHash1

type FuncDefHash1 = struct{ Fa [23]uintptr } /* sqlite3.c:14900:9 */

type FuncDestructor

type FuncDestructor = FuncDestructor1 /* sqlite3.c:14898:31 */

type FuncDestructor1

type FuncDestructor1 = struct {
	FnRef int32

	FxDestroy  uintptr
	FpUserData uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:14898:9 */

type GeoBBox

type GeoBBox = GeoBBox1 /* sqlite3.c:197359:24 */

State vector for the geopoly_group_bbox() aggregate function.

type GeoBBox1

type GeoBBox1 = struct {
	FisInit int32
	Fa      [4]RtreeCoord

} /* sqlite3.c:197359:9 */

State vector for the geopoly_group_bbox() aggregate function.

type GeoCoord

type GeoCoord = float32 /* sqlite3.c:196735:15 */

Datatype for coordinates

type GeoEvent

type GeoEvent = GeoEvent1 /* sqlite3.c:197516:25 */

Objects used by the overlap algorihm.

type GeoEvent1

type GeoEvent1 = struct {
	Fx     float64
	FeType int32

	FpSeg  uintptr
	FpNext uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:197516:9 */

Objects used by the overlap algorihm.

type GeoOverlap

type GeoOverlap = GeoOverlap1 /* sqlite3.c:197518:27 */

type GeoOverlap1

type GeoOverlap1 = struct {
	FaEvent   uintptr
	FaSegment uintptr
	FnEvent   int32
	FnSegment int32

} /* sqlite3.c:197518:9 */

type GeoParse

type GeoParse = GeoParse1 /* sqlite3.c:196782:25 */

State of a parse of a GeoJSON input.

type GeoParse1

type GeoParse1 = struct {
	Fz       uintptr
	FnVertex int32
	FnAlloc  int32
	FnErr    int32

	Fa uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:196782:9 */

State of a parse of a GeoJSON input.

type GeoPoly

type GeoPoly = GeoPoly1 /* sqlite3.c:196759:24 */

Internal representation of a polygon.

The polygon consists of a sequence of vertexes. There is a line segment between each pair of vertexes, and one final segment from the last vertex back to the first. (This differs from the GeoJSON standard in which the final vertex is a repeat of the first.)

The polygon follows the right-hand rule. The area to the right of each segment is "outside" and the area to the left is "inside".

The on-disk representation consists of a 4-byte header followed by the values. The 4-byte header is:

encoding    (1 byte)   0=big-endian, 1=little-endian
nvertex     (3 bytes)  Number of vertexes as a big-endian integer

Enough space is allocated for 4 coordinates, to work around over-zealous warnings coming from some compiler (notably, clang). In reality, the size of each GeoPoly memory allocate is adjusted as necessary so that the GeoPoly.a[] array at the end is the appropriate size.

type GeoPoly1

type GeoPoly1 = struct {
	FnVertex int32
	Fhdr     [4]uint8
	Fa       [8]GeoCoord

} /* sqlite3.c:196759:9 */

Internal representation of a polygon.

The polygon consists of a sequence of vertexes. There is a line segment between each pair of vertexes, and one final segment from the last vertex back to the first. (This differs from the GeoJSON standard in which the final vertex is a repeat of the first.)

The polygon follows the right-hand rule. The area to the right of each segment is "outside" and the area to the left is "inside".

The on-disk representation consists of a 4-byte header followed by the values. The 4-byte header is:

encoding    (1 byte)   0=big-endian, 1=little-endian
nvertex     (3 bytes)  Number of vertexes as a big-endian integer

Enough space is allocated for 4 coordinates, to work around over-zealous warnings coming from some compiler (notably, clang). In reality, the size of each GeoPoly memory allocate is adjusted as necessary so that the GeoPoly.a[] array at the end is the appropriate size.

type GeoSegment

type GeoSegment = GeoSegment1 /* sqlite3.c:197517:27 */

type GeoSegment1

type GeoSegment1 = struct {
	FC    float64
	FB    float64
	Fy    float64
	Fy0   float32
	Fside uint8

	Fidx uint32

	FpNext uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:197516:9 */

type Gid_t

type Gid_t = X__gid_t /* types.h:64:17 */

type Hash

type Hash = Hash1 /* sqlite3.c:14070:21 */

Forward declarations of structures.

type Hash1

type Hash1 = struct {
	Fhtsize uint32
	Fcount  uint32
	Ffirst  uintptr
	Fht     uintptr

} /* sqlite3.c:1331:9 */

Forward declarations of structures.

type HashElem

type HashElem = HashElem1 /* sqlite3.c:14071:25 */

type HashElem1

type HashElem1 = struct {
	Fnext uintptr
	Fprev uintptr
	Fdata uintptr
	FpKey uintptr

} /* sqlite3.c:1331:9 */

type HiddenIndexInfo

type HiddenIndexInfo = HiddenIndexInfo1 /* sqlite3.c:149258:32 */

Extra information appended to the end of sqlite3_index_info but not visible to the xBestIndex function, at least not directly. The sqlite3_vtab_collation() interface knows how to reach it, however.

This object is not an API and can be changed from one release to the next. As long as allocateIndexInfo() and sqlite3_vtab_collation() agree on the structure, all will be well.

type HiddenIndexInfo1

type HiddenIndexInfo1 = struct {
	FpWC    uintptr
	FpParse uintptr

} /* sqlite3.c:149258:9 */

Extra information appended to the end of sqlite3_index_info but not visible to the xBestIndex function, at least not directly. The sqlite3_vtab_collation() interface knows how to reach it, however.

This object is not an API and can be changed from one release to the next. As long as allocateIndexInfo() and sqlite3_vtab_collation() agree on the structure, all will be well.

type HighlightContext

type HighlightContext = HighlightContext1 /* sqlite3.c:215457:33 */

************************************************************************

Start of highlight() implementation.

type HighlightContext1

type HighlightContext1 = struct {
	Fiter        CInstIter
	FiPos        int32
	FiRangeStart int32
	FiRangeEnd   int32

	FzOpen  uintptr
	FzClose uintptr
	FzIn    uintptr
	FnIn    int32
	FiOff   int32
	FzOut   uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:215457:9 */

************************************************************************

Start of highlight() implementation.

type Ht_slot

type Ht_slot = U16 /* sqlite3.c:60848:13 */

Each page of the wal-index mapping contains a hash-table made up of an array of HASHTABLE_NSLOT elements of the following type.

type I16

type I16 = int16 /* sqlite3.c:14546:20 */ // 2-byte signed integer

func Xsqlite3StorageColumnToTable

func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16

Convert a storage column number into a table column number.

The storage column number (0,1,2,....) is the index of the value as it appears in the record on disk. The true column number is the index (0,1,2,...) of the column in the CREATE TABLE statement.

The storage column number is less than the table column number if and only there are VIRTUAL columns to the left.

If SQLITE_OMIT_GENERATED_COLUMNS, this routine is a no-op macro.

func Xsqlite3TableColumnToIndex

func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16

Convert an table column number into a index column number. That is, for the column iCol in the table (as defined by the CREATE TABLE statement) find the (first) offset of that column in index pIdx. Or return -1 if column iCol is not used in index pIdx.

func Xsqlite3TableColumnToStorage

func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16

Convert a table column number into a storage column number.

The storage column number (0,1,2,....) is the index of the value as it appears in the record on disk. Or, if the input column is the N-th virtual column (zero-based) then the storage number is the number of non-virtual columns in the table plus N.

The true column number is the index (0,1,2,...) of the column in the CREATE TABLE statement.

If the input column is a VIRTUAL column, then it should not appear in storage. But the value sometimes is cached in registers that follow the range of registers used to construct storage. This avoids computing the same VIRTUAL column multiple times, and provides values for use by OP_Param opcodes in triggers. Hence, if the input column is a VIRTUAL table, put it after all the other columns.

In the following, N means "normal column", S means STORED, and V means VIRTUAL. Suppose the CREATE TABLE has columns like this:

CREATE TABLE ex(N,S,V,N,S,V,N,S,V);
             -- 0 1 2 3 4 5 6 7 8

Then the mapping from this function is as follows:

INPUTS:     0 1 2 3 4 5 6 7 8
OUTPUTS:    0 1 6 2 3 7 4 5 8

So, in other words, this routine shifts all the virtual columns to the end.

If SQLITE_OMIT_GENERATED_COLUMNS then there are no virtual columns and this routine is a no-op macro. If the pTab does not have any virtual columns, then this routine is no-op that always return iCol. If iCol is negative (indicating the ROWID column) then this routine return iCol.

type I64

type I64 = Sqlite_int64 /* sqlite3.c:14542:22 */ // 8-byte signed integer

Integers of known sizes. These typedefs might change for architectures where the sizes very. Preprocessor macros are available so that the types can be conveniently redefined at compile-type. Like this:

cc '-DUINTPTR_TYPE=long long int' ...

func Xsqlite3BtreeIntegerKey

func Xsqlite3BtreeIntegerKey(tls *libc.TLS, pCur uintptr) I64

Return the value of the integer key or "rowid" for a table btree. This routine is only valid for a cursor that is pointing into a ordinary table btree. If the cursor points to an index btree or is invalid, the result of this routine is undefined.

func Xsqlite3BtreeOffset

func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64

Return the offset into the database file for the start of the payload to which the cursor is pointing.

func Xsqlite3BtreeRowCountEst

func Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64

Return an estimate for the number of rows in the table that pCur is pointing to. Return a negative number if no estimate is currently available.

func Xsqlite3PagerJournalSizeLimit

func Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I64

Get/set the size-limit used for persistent journal files.

Setting the size limit to -1 means no limit is enforced. An attempt to set a limit smaller than -1 is a no-op.

func Xsqlite3VdbeIntValue

func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64

type I8

type I8 = int8 /* sqlite3.c:14548:19 */ // 1-byte signed integer

type IdList

type IdList = IdList1 /* sqlite3.c:14901:23 */

type IdList1

type IdList1 = struct {
	Fa   uintptr
	FnId int32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type IdList_item

type IdList_item = struct {
	FzName uintptr
	Fidx   int32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

An instance of this structure can hold a simple list of identifiers, such as the list "a,b,c" in the following statements:

INSERT INTO t(a,b,c) VALUES ...;
CREATE INDEX idx ON t(a,b,c);
CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...;

The IdList.a.idx field is used when the IdList represents the list of column names after a table name in an INSERT statement. In the statement

INSERT INTO t(a,b,c) ...

If "a" is the k-th column of table "t", then IdList.a[0].idx==k.

type Id_t

type Id_t = X__id_t /* types.h:103:16 */

type Idtype_t

type Idtype_t = uint32 /* waitflags.h:57:3 */

type IdxCover

type IdxCover = struct {
	FpIdx uintptr
	FiCur int32
	// contains filtered or unexported fields

} /* sqlite3.c:19457:5 */

Context pointer passed down through the tree-walk.

type IdxExprTrans

type IdxExprTrans = IdxExprTrans1 /* sqlite3.c:146226:3 */

An instance of the IdxExprTrans object carries information about a mapping from an expression on table columns into a column in an index down through the Walker.

type IdxExprTrans1

type IdxExprTrans1 = struct {
	FpIdxExpr uintptr
	FiTabCur  int32
	FiIdxCur  int32
	FiIdxCol  int32
	FiTabCol  int32
	FpWInfo   uintptr
	Fdb       uintptr

} /* sqlite3.c:19458:5 */

Context pointer passed down through the tree-walk.

type InLoop

type InLoop = struct {
	FiCur       int32
	FaddrInTop  int32
	FiBase      int32
	FnPrefix    int32
	FeEndLoopOp U8
	// contains filtered or unexported fields

} /* sqlite3.c:144567:7 */

This object contains information needed to implement a single nested loop in WHERE clause.

Contrast this object with WhereLoop. This object describes the implementation of the loop. WhereLoop describes the algorithm. This object contains a pointer to the WhereLoop algorithm as one of its elements.

The WhereInfo object contains a single instance of this object for each term in the FROM clause (which is to say, for each of the nested loops as implemented). The order of WhereLevel objects determines the loop nested order, with WhereInfo.a[0] being the outer loop and WhereInfo.a[WhereInfo.nLevel-1] being the inner loop.

type IncrMerger

type IncrMerger = IncrMerger1 /* sqlite3.c:95484:27 */

In-memory list of records

type IncrMerger1

type IncrMerger1 = struct {
	FpTask      uintptr
	FpMerger    uintptr
	FiStartOff  I64
	FmxSz       int32
	FbEof       int32
	FbUseThread int32

	FaFile [2]SorterFile
	// contains filtered or unexported fields

} /* sqlite3.c:21218:9 */

type Incrblob

type Incrblob = Incrblob1 /* sqlite3.c:94829:25 */

Valid sqlite3_blob* handles point to Incrblob structures.

type Incrblob1

type Incrblob1 = struct {
	FnByte   int32
	FiOffset int32
	FiCol    U16

	FpCsr  uintptr
	FpStmt uintptr
	Fdb    uintptr
	FzDb   uintptr
	FpTab  uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:94829:9 */

Valid sqlite3_blob* handles point to Incrblob structures.

type Index

type Index = Index1 /* sqlite3.c:14902:22 */

type Index1

type Index1 = struct {
	FzName         uintptr
	FaiColumn      uintptr
	FaiRowLogEst   uintptr
	FpTable        uintptr
	FzColAff       uintptr
	FpNext         uintptr
	FpSchema       uintptr
	FaSortOrder    uintptr
	FazColl        uintptr
	FpPartIdxWhere uintptr
	FaColExpr      uintptr
	Ftnum          Pgno
	FszIdxRow      LogEst
	FnKeyCol       U16
	FnColumn       U16
	FonError       U8

	FidxType uint16 /* unsigned idxType: 2, unsigned bUnordered: 1, unsigned uniqNotNull: 1, unsigned isResized: 1, unsigned isCovering: 1, unsigned noSkipScan: 1, unsigned hasStat1: 1, unsigned bNoQuery: 1, unsigned bAscKeyBug: 1, unsigned bHasVCol: 1 */

	FnSample    int32
	FnSampleCol int32
	FaAvgEq     uintptr
	FaSample    uintptr
	FaiRowEst   uintptr
	FnRowEst0   TRowcnt

	FcolNotIdxed Bitmask
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type IndexIterator

type IndexIterator = IndexIterator1 /* sqlite3.c:124491:30 */

type IndexIterator1

type IndexIterator1 = struct {
	FeType int32
	Fi     int32
	Fu     struct {
		Flx struct{ FpIdx uintptr }
		// contains filtered or unexported fields
	}

} /* sqlite3.c:124491:9 */

type IndexListTerm

type IndexListTerm = IndexListTerm1 /* sqlite3.c:124490:30 */

The sqlite3GenerateConstraintChecks() routine usually wants to visit the indexes of a table in the order provided in the Table->pIndex list. However, sometimes (rarely - when there is an upsert) it wants to visit the indexes in a different order. The following data structures accomplish this.

The IndexIterator object is used to walk through all of the indexes of a table in either Index.pNext order, or in some other order established by an array of IndexListTerm objects.

type IndexListTerm1

type IndexListTerm1 = struct {
	Fp  uintptr
	Fix int32
	// contains filtered or unexported fields

} /* sqlite3.c:124490:9 */

The sqlite3GenerateConstraintChecks() routine usually wants to visit the indexes of a table in the order provided in the Table->pIndex list. However, sometimes (rarely - when there is an upsert) it wants to visit the indexes in a different order. The following data structures accomplish this.

The IndexIterator object is used to walk through all of the indexes of a table in either Index.pNext order, or in some other order established by an array of IndexListTerm objects.

type IndexSample

type IndexSample = IndexSample1 /* sqlite3.c:14903:28 */

type IndexSample1

type IndexSample1 = struct {
	Fp uintptr
	Fn int32

	FanEq  uintptr
	FanLt  uintptr
	FanDLt uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type InitData

type InitData = struct {
	Fdb         uintptr
	FpzErrMsg   uintptr
	FiDb        int32
	Frc         int32
	FmInitFlags U32
	FnInitRow   U32
	FmxPage     Pgno
	// contains filtered or unexported fields

} /* sqlite3.c:19327:3 */

A pointer to this structure is used to communicate information from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback.

type Ino64_t

type Ino64_t = X__ino64_t /* types.h:54:19 */

type Ino_t

type Ino_t = X__ino64_t /* types.h:49:19 */

type Int16_t

type Int16_t = X__int16_t /* stdint-intn.h:25:19 */

type Int32_t

type Int32_t = X__int32_t /* stdint-intn.h:26:19 */

type Int64_t

type Int64_t = X__int64_t /* stdint-intn.h:27:19 */

type Int8_t

type Int8_t = X__int8_t /* stdint-intn.h:24:18 */

type IntegrityCk

type IntegrityCk = IntegrityCk1 /* sqlite3.c:65118:28 */

This structure is passed around through all the sanity checking routines in order to keep track of some global state information.

The aRef[] array is allocated so that there is 1 bit for each page in the database. As the integrity-check proceeds, for each page used in the database the corresponding bit is set. This allows integrity-check to detect pages that are used twice and orphaned pages (both of which indicate corruption).

type IntegrityCk1

type IntegrityCk1 = struct {
	FpBt       uintptr
	FpPager    uintptr
	FaPgRef    uintptr
	FnPage     Pgno
	FmxErr     int32
	FnErr      int32
	FbOomFault int32
	FzPfx      uintptr
	Fv1        Pgno
	Fv2        int32
	FerrMsg    StrAccum
	Fheap      uintptr
	Fdb        uintptr

} /* sqlite3.c:65118:9 */

This structure is passed around through all the sanity checking routines in order to keep track of some global state information.

The aRef[] array is allocated so that there is 1 bit for each page in the database. As the integrity-check proceeds, for each page used in the database the corresponding bit is set. This allows integrity-check to detect pages that are used twice and orphaned pages (both of which indicate corruption).

type Intptr_t

type Intptr_t = X__intptr_t /* unistd.h:267:20 */

type JsonEachCursor

type JsonEachCursor = JsonEachCursor1 /* sqlite3.c:191683:31 */

***************************************************************************

The json_each virtual table

type JsonEachCursor1

type JsonEachCursor1 = struct {
	Fbase       Sqlite3_vtab_cursor
	FiRowid     U32
	FiBegin     U32
	Fi          U32
	FiEnd       U32
	FeType      U8
	FbRecursive U8

	FzJson  uintptr
	FzRoot  uintptr
	FsParse JsonParse
	// contains filtered or unexported fields

} /* sqlite3.c:191683:9 */

***************************************************************************

The json_each virtual table

type JsonNode

type JsonNode = JsonNode1 /* sqlite3.c:189737:25 */

type JsonNode1

type JsonNode1 = struct {
	FeType   U8
	FjnFlags U8

	Fn U32
	Fu struct{ FzJContent uintptr }
	// contains filtered or unexported fields

} /* sqlite3.c:189737:9 */

type JsonParse

type JsonParse = JsonParse1 /* sqlite3.c:189738:26 */

type JsonParse1

type JsonParse1 = struct {
	FnNode  U32
	FnAlloc U32
	FaNode  uintptr
	FzJson  uintptr
	FaUp    uintptr
	Foom    U8
	FnErr   U8
	FiDepth U16
	FnJson  int32
	FiHold  U32
	// contains filtered or unexported fields

} /* sqlite3.c:189738:9 */

type JsonString

type JsonString = JsonString1 /* sqlite3.c:189736:27 */

Objects

type JsonString1

type JsonString1 = struct {
	FpCtx    uintptr
	FzBuf    uintptr
	FnAlloc  U64
	FnUsed   U64
	FbStatic U8
	FbErr    U8
	FzSpace  [100]int8
	// contains filtered or unexported fields

} /* sqlite3.c:189736:9 */

Objects

type KeyInfo

type KeyInfo = KeyInfo1 /* sqlite3.c:14905:24 */

type KeyInfo1

type KeyInfo1 = struct {
	FnRef U32
	Fenc  U8

	FnKeyField U16
	FnAllField U16

	Fdb         uintptr
	FaSortFlags uintptr
	FaColl      [1]uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Key_t

type Key_t = X__key_t /* types.h:121:17 */

type LastValueCtx

type LastValueCtx = struct {
	FpVal uintptr
	FnVal int32
	// contains filtered or unexported fields

} /* sqlite3.c:155391:1 */

Context object for last_value() window function.

type Ldiv_t

type Ldiv_t = struct {
	Fquot int64
	Frem  int64

} /* stdlib.h:70:5 */

Returned by `ldiv'.

type Lldiv_t

type Lldiv_t = struct {
	Fquot int64
	Frem  int64

} /* stdlib.h:80:5 */

Returned by `lldiv'.

type Lmid_t

type Lmid_t = int64 /* dlfcn.h:44:18 */

Type for namespace indeces.

type Locale_t

type Locale_t = X__locale_t /* locale_t.h:24:20 */

type Loff_t

type Loff_t = X__loff_t /* types.h:42:18 */

type LogEst

type LogEst = int16 /* sqlite3.c:14593:20 */

Estimated quantities used for query planning are stored as 16-bit logarithms. For quantity X, the value stored is 10*log2(X). This gives a possible range of values of approximately 1.0e986 to 1e-986. But the allowed values are "grainy". Not every value is representable. For example, quantities 16 and 17 are both represented by a LogEst of 40. However, since LogEst quantities are suppose to be estimates, not exact values, this imprecision is not a problem.

"LogEst" is short for "Logarithmic Estimate".

Examples:

 1 -> 0              20 -> 43          10000 -> 132
 2 -> 10             25 -> 46          25000 -> 146
 3 -> 16            100 -> 66        1000000 -> 199
 4 -> 20           1000 -> 99        1048576 -> 200
10 -> 33           1024 -> 100    4294967296 -> 320

The LogEst can be negative to indicate fractional values. Examples:

0.5 -> -10           0.1 -> -33        0.0625 -> -40

func Xsqlite3LogEst

func Xsqlite3LogEst(tls *libc.TLS, x U64) LogEst

Convert an integer into a LogEst. In other words, compute an approximation for 10*log2(x).

func Xsqlite3LogEstAdd

func Xsqlite3LogEstAdd(tls *libc.TLS, a LogEst, b LogEst) LogEst

Find (an approximate) sum of two LogEst values. This computation is not a simple "+" operator because LogEst is stored as a logarithmic value.

func Xsqlite3LogEstFromDouble

func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst

Convert a double into a LogEst In other words, compute an approximation for 10*log2(x).

func Xsqlite3WhereOutputRowCount

func Xsqlite3WhereOutputRowCount(tls *libc.TLS, pWInfo uintptr) LogEst

Return the estimated number of output rows from a WHERE clause

type Lookaside

type Lookaside = Lookaside1 /* sqlite3.c:14906:26 */

type Lookaside1

type Lookaside1 = struct {
	FbDisable  U32
	Fsz        U16
	FszTrue    U16
	FbMalloced U8

	FnSlot  U32
	FanStat [3]U32

	FpInit      uintptr
	FpFree      uintptr
	FpSmallInit uintptr
	FpSmallFree uintptr
	FpMiddle    uintptr
	FpStart     uintptr
	FpEnd       uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type LookasideSlot

type LookasideSlot = LookasideSlot1 /* sqlite3.c:14907:30 */

type LookasideSlot1

type LookasideSlot1 = struct{ FpNext uintptr } /* sqlite3.c:1331:9 */

type Max_align_t

type Max_align_t = struct {
	F__max_align_ll int64
	F__max_align_ld float64

} /* stddef.h:437:3 */

Type whose alignment is supported in every context and is at least

as great as that of any standard type not using alignment
specifiers.

type Mem

type Mem = sqlite3_value /* sqlite3.c:15674:30 */

The names of the following types declared in vdbeInt.h are required for the VdbeOp definition.

type Mem0Global

type Mem0Global = struct {
	Fmutex          uintptr
	FalarmThreshold Sqlite3_int64
	FhardLimit      Sqlite3_int64
	FnearlyFull     int32
	// contains filtered or unexported fields

} /* sqlite3.c:27830:19 */

State information local to the memory allocation subsystem.

type MemFS

type MemFS = struct {
	FnMemStore int32

	FapMemStore uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:48617:8 */

File-scope variables for holding the memdb files that are accessible to multiple database connections in separate threads.

Must hold SQLITE_MUTEX_STATIC_VFS1 to access any part of this object.

type MemFile

type MemFile = MemFile1 /* sqlite3.c:48546:24 */

type MemFile1

type MemFile1 = struct {
	Fbase   Sqlite3_file
	FpStore uintptr
	FeLock  int32
	// contains filtered or unexported fields

} /* sqlite3.c:48546:9 */

type MemJournal

type MemJournal = MemJournal1 /* sqlite3.c:98540:27 */

Forward references to internal structures

type MemJournal1

type MemJournal1 = struct {
	FpMethod    uintptr
	FnChunkSize int32
	FnSpill     int32
	FpFirst     uintptr
	Fendpoint   FilePoint
	Freadpoint  FilePoint
	Fflags      int32

	FpVfs     uintptr
	FzJournal uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:98540:9 */

Forward references to internal structures

type MemPage

type MemPage = MemPage1 /* sqlite3.c:64658:24 */

Forward declarations

type MemPage1

type MemPage1 = struct {
	FisInit          U8
	FbBusy           U8
	FintKey          U8
	FintKeyLeaf      U8
	Fpgno            Pgno
	Fleaf            U8
	FhdrOffset       U8
	FchildPtrSize    U8
	Fmax1bytePayload U8
	FnOverflow       U8

	FmaxLocal   U16
	FminLocal   U16
	FcellOffset U16
	FnFree      int32
	FnCell      U16
	FmaskPage   U16
	FaiOvfl     [4]U16

	FapOvfl     [4]uintptr
	FpBt        uintptr
	FaData      uintptr
	FaDataEnd   uintptr
	FaCellIdx   uintptr
	FaDataOfst  uintptr
	FpDbPage    uintptr
	FxCellSize  uintptr
	FxParseCell uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

Forward declarations

type MemStore

type MemStore = MemStore1 /* sqlite3.c:48547:25 */

type MemStore1

type MemStore1 = struct {
	Fsz      Sqlite3_int64
	FszAlloc Sqlite3_int64
	FszMax   Sqlite3_int64
	FaData   uintptr
	FpMutex  uintptr
	FnMmap   int32
	FmFlags  uint32
	FnRdLock int32
	FnWrLock int32
	FnRef    int32

	FzFName uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:48546:9 */

type MemValue

type MemValue = struct{ Fr float64 } /* sqlite3.c:1331:9 */

Internally, the vdbe manipulates nearly all SQL values as Mem structures. Each Mem struct may cache multiple representations (string, integer etc.) of the same value.

type MemVfs

type MemVfs = sqlite3_vfs /* sqlite3.c:48545:28 */

Forward declaration of objects used by this utility

type MergeEngine

type MergeEngine = MergeEngine1 /* sqlite3.c:95477:28 */ // Merge PMAs together

Private objects used by the sorter

type MergeEngine1

type MergeEngine1 = struct {
	FnTree int32

	FpTask  uintptr
	FaTree  uintptr
	FaReadr uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:21218:9 */

Private objects used by the sorter

type Mode_t

type Mode_t = X__mode_t /* types.h:69:18 */

type Module

type Module = Module1 /* sqlite3.c:14908:23 */

type Module1

type Module1 = struct {
	FpModule    uintptr
	FzName      uintptr
	FnRefModule int32

	FpAux     uintptr
	FxDestroy uintptr
	FpEpoTab  uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type NameContext

type NameContext = NameContext1 /* sqlite3.c:14909:28 */

type NameContext1

type NameContext1 = struct {
	FpParse   uintptr
	FpSrcList uintptr
	FuNC      struct{ FpEList uintptr }
	FpNext    uintptr
	FnRef     int32
	FnNcErr   int32
	FncFlags  int32

	FpWinSelect uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:14909:9 */
type Nlink_t = X__nlink_t /* types.h:74:19 */

type NthValueCtx

type NthValueCtx = struct {
	FnStep  I64
	FpValue uintptr

} /* sqlite3.c:155117:1 */

Implementation of built-in window function nth_value(). This implementation is used in "slow mode" only - when the EXCLUDE clause is not set to the default value "NO OTHERS".

type NtileCtx

type NtileCtx = struct {
	FnTotal I64
	FnParam I64
	FiRow   I64

} /* sqlite3.c:155321:1 */

Context object for ntile() window function.

type Off64_t

type Off64_t = X__off64_t /* stdio.h:70:19 */

type Off_t

type Off_t = X__off64_t /* stdio.h:65:19 */

type Op

type Op = VdbeOp1 /* sqlite3.c:21210:23 */

SQL is translated into a sequence of instructions to be executed by a virtual machine. Each instruction is an instance of the following structure.

type Op2

type Op2 = struct {
	FzOp  uintptr
	FeOp2 uint8
	// contains filtered or unexported fields

} /* sqlite3.c:147955:18 */

type OpenMode

type OpenMode = struct {
	Fz    uintptr
	Fmode int32
	// contains filtered or unexported fields

} /* sqlite3.c:168064:9 */

type PCache

type PCache = PCache2 /* sqlite3.c:16290:23 */

type PCache1

type PCache1 = PCache11 /* sqlite3.c:50783:24 */

type PCache11

type PCache11 = struct {
	FpGroup          uintptr
	FpnPurgeable     uintptr
	FszPage          int32
	FszExtra         int32
	FszAlloc         int32
	FbPurgeable      int32
	FnMin            uint32
	FnMax            uint32
	Fn90pct          uint32
	FiMaxKey         uint32
	FnPurgeableDummy uint32
	FnRecyclable     uint32
	FnPage           uint32
	FnHash           uint32
	FapHash          uintptr
	FpFree           uintptr
	FpBulk           uintptr

} /* sqlite3.c:50783:9 */

type PCache2

type PCache2 = struct {
	FpDirty     uintptr
	FpDirtyTail uintptr
	FpSynced    uintptr
	FnRefSum    int32
	FszCache    int32
	FszSpill    int32
	FszPage     int32
	FszExtra    int32
	FbPurgeable U8
	FeCreate    U8

	FxStress uintptr
	FpStress uintptr
	FpCache  uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type PCacheGlobal

type PCacheGlobal = struct {
	Fgrp            PGroup
	FisInit         int32
	FseparateCache  int32
	FnInitPage      int32
	FszSlot         int32
	FnSlot          int32
	FnReserve       int32
	FpStart         uintptr
	FpEnd           uintptr
	Fmutex          uintptr
	FpFree          uintptr
	FnFreeSlot      int32
	FbUnderPressure int32

} /* sqlite3.c:50903:19 */

Global data used by this cache.

type PGroup

type PGroup = PGroup1 /* sqlite3.c:50786:23 */

type PGroup1

type PGroup1 = struct {
	Fmutex      uintptr
	FnMaxPage   uint32
	FnMinPage   uint32
	FmxPinned   uint32
	FnPurgeable uint32
	Flru        PgHdr1

} /* sqlite3.c:50783:9 */

type Pager

type Pager = Pager1 /* sqlite3.c:15019:22 */

Each open file is managed by a separate instance of the "Pager" structure.

type Pager1

type Pager1 = struct {
	FpVfs              uintptr
	FexclusiveMode     U8
	FjournalMode       U8
	FuseJournal        U8
	FnoSync            U8
	FfullSync          U8
	FextraSync         U8
	FsyncFlags         U8
	FwalSyncFlags      U8
	FtempFile          U8
	FnoLock            U8
	FreadOnly          U8
	FmemDb             U8
	FeState            U8
	FeLock             U8
	FchangeCountDone   U8
	FsetSuper          U8
	FdoNotSpill        U8
	FsubjInMemory      U8
	FbUseFetch         U8
	FhasHeldSharedLock U8
	FdbSize            Pgno
	FdbOrigSize        Pgno
	FdbFileSize        Pgno
	FdbHintSize        Pgno
	FerrCode           int32
	FnRec              int32
	FcksumInit         U32
	FnSubRec           U32

	FpInJournal   uintptr
	Ffd           uintptr
	Fjfd          uintptr
	Fsjfd         uintptr
	FjournalOff   I64
	FjournalHdr   I64
	FpBackup      uintptr
	FaSavepoint   uintptr
	FnSavepoint   int32
	FiDataVersion U32
	FdbFileVers   [16]int8
	FnMmapOut     int32

	FszMmap        Sqlite3_int64
	FpMmapFreelist uintptr
	FnExtra        U16
	FnReserve      I16
	FvfsFlags      U32
	FsectorSize    U32
	FpageSize      int32
	FmxPgno        Pgno

	FjournalSizeLimit I64
	FzFilename        uintptr
	FzJournal         uintptr
	FxBusyHandler     uintptr
	FpBusyHandlerArg  uintptr
	FaStat            [4]int32
	FnRead            int32

	FxReiniter uintptr
	FxGet      uintptr
	FpTmpSpace uintptr
	FpPCache   uintptr
	FpWal      uintptr
	FzWal      uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

Each open file is managed by a separate instance of the "Pager" structure.

type PagerSavepoint

type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:53074:31 */

An instance of the following structure is allocated for each active savepoint and statement transaction in the system. All such structures are stored in the Pager.aSavepoint[] array, which is allocated and resized using sqlite3Realloc().

When a savepoint is created, the PagerSavepoint.iHdrOffset field is set to 0. If a journal-header is written into the main journal while the savepoint is active, then iHdrOffset is set to the byte offset immediately following the last journal record written into the main journal before the journal-header. This is required during savepoint rollback (see pagerPlaybackSavepoint()).

type PagerSavepoint1

type PagerSavepoint1 = struct {
	FiOffset            I64
	FiHdrOffset         I64
	FpInSavepoint       uintptr
	FnOrig              Pgno
	FiSubRec            Pgno
	FbTruncateOnRelease int32
	FaWalData           [4]U32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

An instance of the following structure is allocated for each active savepoint and statement transaction in the system. All such structures are stored in the Pager.aSavepoint[] array, which is allocated and resized using sqlite3Realloc().

When a savepoint is created, the PagerSavepoint.iHdrOffset field is set to 0. If a journal-header is written into the main journal while the savepoint is active, then iHdrOffset is set to the byte offset immediately following the last journal record written into the main journal before the journal-header. This is required during savepoint rollback (see pagerPlaybackSavepoint()).

type Parse

type Parse = Parse1 /* sqlite3.c:14910:22 */

type Parse1

type Parse1 = struct {
	Fdb               uintptr
	FzErrMsg          uintptr
	FpVdbe            uintptr
	Frc               int32
	FcolNamesSet      U8
	FcheckSchema      U8
	Fnested           U8
	FnTempReg         U8
	FisMultiWrite     U8
	FmayAbort         U8
	FhasCompound      U8
	FokConstFactor    U8
	FdisableLookaside U8
	FdisableVtab      U8

	FnRangeReg   int32
	FiRangeReg   int32
	FnErr        int32
	FnTab        int32
	FnMem        int32
	FszOpAlloc   int32
	FiSelfTab    int32
	FnLabel      int32
	FnLabelAlloc int32

	FaLabel         uintptr
	FpConstExpr     uintptr
	FconstraintName Token
	FwriteMask      YDbMask
	FcookieMask     YDbMask
	FregRowid       int32
	FregRoot        int32
	FnMaxArg        int32
	FnSelect        int32
	FnTableLock     int32

	FaTableLock   uintptr
	FpAinc        uintptr
	FpToplevel    uintptr
	FpTriggerTab  uintptr
	FpParentParse uintptr
	Fu1           struct {
		FaddrCrTab int32
		// contains filtered or unexported fields
	}
	FnQueryLoop      U32
	Foldmask         U32
	Fnewmask         U32
	FeTriggerOp      U8
	FbReturning      U8
	FeOrconf         U8
	FdisableTriggers U8
	FaTempReg        [8]int32
	FsNameToken      Token
	FsLastToken      Token
	FnVar            YnVar
	FiPkSortOrder    U8
	Fexplain         U8
	FeParseMode      U8

	FnVtabLock   int32
	FnHeight     int32
	FaddrExplain int32

	FpVList       uintptr
	FpReprepare   uintptr
	FzTail        uintptr
	FpNewTable    uintptr
	FpNewIndex    uintptr
	FpNewTrigger  uintptr
	FzAuthContext uintptr
	FsArg         Token
	FapVtabLock   uintptr
	FpTriggerPrg  uintptr
	FpWith        uintptr
	FpCleanup     uintptr
	FpRename      uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type ParseCleanup

type ParseCleanup = ParseCleanup1 /* sqlite3.c:14911:29 */

type ParseCleanup1

type ParseCleanup1 = struct {
	FpNext    uintptr
	FpPtr     uintptr
	FxCleanup uintptr

} /* sqlite3.c:1331:9 */

type PgFreeslot

type PgFreeslot = PgFreeslot1 /* sqlite3.c:50785:27 */

type PgFreeslot1

type PgFreeslot1 = struct{ FpNext uintptr } /* sqlite3.c:50785:9 */

type PgHdr

type PgHdr = PgHdr2 /* sqlite3.c:16289:22 */

type PgHdr1

type PgHdr1 = PgHdr11 /* sqlite3.c:50784:23 */

type PgHdr11

type PgHdr11 = struct {
	Fpage        Sqlite3_pcache_page
	FiKey        uint32
	FisBulkLocal U16
	FisAnchor    U16
	FpNext       uintptr
	FpCache      uintptr
	FpLruNext    uintptr
	FpLruPrev    uintptr

} /* sqlite3.c:50783:9 */

type PgHdr2

type PgHdr2 = struct {
	FpPage      uintptr
	FpData      uintptr
	FpExtra     uintptr
	FpCache     uintptr
	FpDirty     uintptr
	FpPager     uintptr
	Fpgno       Pgno
	Fflags      U16
	FnRef       I16
	FpDirtyNext uintptr
	FpDirtyPrev uintptr

} /* sqlite3.c:1331:9 */

Handle type for pages.

type Pgno

type Pgno = U32 /* sqlite3.c:15014:13 */

The type used to represent a page number. The first page in a file is called page 1. 0 is used to represent "not a page".

func Xsqlite3BtreeLastPage

func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno

func Xsqlite3BtreeMaxPageCount

func Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno

Set the maximum page count for a database if mxPage is positive. No changes are made if mxPage is 0 or negative. Regardless of the value of mxPage, return the maximum page count.

func Xsqlite3PagerMaxPageCount

func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno

Attempt to set the maximum database page count if mxPage is positive. Make no changes if mxPage is zero or negative. And never reduce the maximum page count below the current size of the database.

Regardless of mxPage, return the current maximum page count.

func Xsqlite3PagerPagenumber

func Xsqlite3PagerPagenumber(tls *libc.TLS, pPg uintptr) Pgno

Return the page number for page pPg.

func Xsqlite3WalDbsize

func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno

Return the size of the database in pages (or zero, if unknown).

type Pid_t

type Pid_t = X__pid_t /* types.h:97:17 */

type PmaReader

type PmaReader = PmaReader1 /* sqlite3.c:95478:26 */ // Incrementally read one PMA

Merge PMAs together

type PmaReader1

type PmaReader1 = struct {
	FiReadOff I64
	FiEof     I64
	FnAlloc   int32
	FnKey     int32
	FpFd      uintptr
	FaAlloc   uintptr
	FaKey     uintptr
	FaBuffer  uintptr
	FnBuffer  int32

	FaMap  uintptr
	FpIncr uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:21218:9 */

type PmaWriter

type PmaWriter = PmaWriter1 /* sqlite3.c:95479:26 */ // Incrementally write one PMA

Incrementally read one PMA

type PmaWriter1

type PmaWriter1 = struct {
	FeFWErr int32

	FaBuffer   uintptr
	FnBuffer   int32
	FiBufStart int32
	FiBufEnd   int32

	FiWriteOff I64
	FpFd       uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:95479:9 */

type PorterContext

type PorterContext = PorterContext1 /* sqlite3.c:232487:30 */

type PorterContext1

type PorterContext1 = struct {
	FpCtx   uintptr
	FxToken uintptr
	FaBuf   uintptr

} /* sqlite3.c:232487:9 */

type PorterRule

type PorterRule = PorterRule1 /* sqlite3.c:232494:27 */

type PorterRule1

type PorterRule1 = struct {
	FzSuffix uintptr
	FnSuffix int32

	FxCond   uintptr
	FzOutput uintptr
	FnOutput int32
	// contains filtered or unexported fields

} /* sqlite3.c:232494:9 */

type PorterTokenizer

type PorterTokenizer = PorterTokenizer1 /* sqlite3.c:232428:32 */

type PorterTokenizer1

type PorterTokenizer1 = struct {
	Ftokenizer  Fts5_tokenizer
	FpTokenizer uintptr
	FaBuf       [128]int8

} /* sqlite3.c:232428:9 */

type PoslistCallbackCtx

type PoslistCallbackCtx = PoslistCallbackCtx1 /* sqlite3.c:224008:35 */

type PoslistCallbackCtx1

type PoslistCallbackCtx1 = struct {
	FpBuf    uintptr
	FpColset uintptr
	FeState  int32
	// contains filtered or unexported fields

} /* sqlite3.c:224008:9 */

type PoslistOffsetsCtx

type PoslistOffsetsCtx = PoslistOffsetsCtx1 /* sqlite3.c:224015:34 */

type PoslistOffsetsCtx1

type PoslistOffsetsCtx1 = struct {
	FpBuf    uintptr
	FpColset uintptr
	FiRead   int32
	FiWrite  int32

} /* sqlite3.c:224015:9 */

type PragmaName

type PragmaName = PragmaName1 /* sqlite3.c:127967:3 */

Definitions of all built-in pragmas

type PragmaName1

type PragmaName1 = struct {
	FzName      uintptr
	FePragTyp   U8
	FmPragFlg   U8
	FiPragCName U8
	FnPragCName U8

	FiArg U64
	// contains filtered or unexported fields

} /* sqlite3.c:127960:9 */

Definitions of all built-in pragmas

type PragmaVtab

type PragmaVtab = PragmaVtab1 /* sqlite3.c:130740:27 */

****************************************************************************

Implementation of an eponymous virtual table that runs a pragma.

type PragmaVtab1

type PragmaVtab1 = struct {
	Fbase    Sqlite3_vtab
	Fdb      uintptr
	FpName   uintptr
	FnHidden U8
	FiHidden U8
	// contains filtered or unexported fields

} /* sqlite3.c:130740:9 */

****************************************************************************

Implementation of an eponymous virtual table that runs a pragma.

type PragmaVtabCursor

type PragmaVtabCursor = PragmaVtabCursor1 /* sqlite3.c:130741:33 */

type PragmaVtabCursor1

type PragmaVtabCursor1 = struct {
	Fbase    Sqlite3_vtab_cursor
	FpPragma uintptr
	FiRowid  Sqlite_int64
	FazArg   [2]uintptr

} /* sqlite3.c:130741:9 */

type PreUpdate

type PreUpdate = PreUpdate1 /* sqlite3.c:14912:26 */

type PreUpdate1

type PreUpdate1 = struct {
	Fv    uintptr
	FpCsr uintptr
	Fop   int32

	FaRecord      uintptr
	Fkeyinfo      KeyInfo
	FpUnpacked    uintptr
	FpNewUnpacked uintptr
	FiNewReg      int32
	FiBlobWrite   int32
	FiKey1        I64
	FiKey2        I64
	FaNew         uintptr
	FpTab         uintptr
	FpPk          uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type PrefixMerger

type PrefixMerger = PrefixMerger1 /* sqlite3.c:225988:29 */

type PrefixMerger1

type PrefixMerger1 = struct {
	Fiter Fts5DoclistIter
	FiPos I64
	FiOff int32

	FaPos  uintptr
	FpNext uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:225988:9 */

type PrintfArguments

type PrintfArguments = PrintfArguments1 /* sqlite3.c:14913:32 */

type PrintfArguments1

type PrintfArguments1 = struct {
	FnArg  int32
	FnUsed int32
	FapArg uintptr

} /* sqlite3.c:14913:9 */

type Pthread_attr_t

type Pthread_attr_t = pthread_attr_t /* pthreadtypes.h:62:30 */

type Pthread_barrier_t

type Pthread_barrier_t = struct {
	F__size [32]int8
	// contains filtered or unexported fields

} /* pthreadtypes.h:112:3 */

POSIX barriers data type. The structure of the type is

deliberately not exposed.

type Pthread_barrierattr_t

type Pthread_barrierattr_t = struct {
	F__size [4]int8
	// contains filtered or unexported fields

} /* pthreadtypes.h:118:3 */

type Pthread_cond_t

type Pthread_cond_t = struct{ F__data __pthread_cond_s } /* pthreadtypes.h:80:3 */

type Pthread_condattr_t

type Pthread_condattr_t = struct {
	F__size [4]int8
	// contains filtered or unexported fields

} /* pthreadtypes.h:45:3 */

Data structure for condition variable handling. The structure of

the attribute type is not exposed on purpose.

type Pthread_key_t

type Pthread_key_t = uint32 /* pthreadtypes.h:49:22 */

Keys for thread-specific data

type Pthread_mutex_t

type Pthread_mutex_t = struct{ F__data __pthread_mutex_s } /* pthreadtypes.h:72:3 */

type Pthread_mutexattr_t

type Pthread_mutexattr_t = struct {
	F__size [4]int8
	// contains filtered or unexported fields

} /* pthreadtypes.h:36:3 */

Data structures for mutex handling. The structure of the attribute

type is not exposed on purpose.

type Pthread_once_t

type Pthread_once_t = int32 /* pthreadtypes.h:53:30 */

Once-only execution

type Pthread_rwlock_t

type Pthread_rwlock_t = struct{ F__data __pthread_rwlock_arch_t } /* pthreadtypes.h:91:3 */

Data structure for reader-writer lock variable handling. The

structure of the attribute type is deliberately not exposed.

type Pthread_rwlockattr_t

type Pthread_rwlockattr_t = struct {
	F__size [8]int8
	// contains filtered or unexported fields

} /* pthreadtypes.h:97:3 */

type Pthread_spinlock_t

type Pthread_spinlock_t = int32 /* pthreadtypes.h:103:22 */

POSIX spinlock data type.

type Pthread_t

type Pthread_t = uint64 /* pthreadtypes.h:27:27 */

Thread identifiers. The structure of the attribute type is not

exposed on purpose.

type Ptrdiff_t

type Ptrdiff_t = int64 /* <builtin>:3:26 */

type Quad_t

type Quad_t = X__quad_t /* types.h:37:18 */

type RbuFrame

type RbuFrame = RbuFrame1 /* sqlite3.c:200253:25 */

type RbuFrame1

type RbuFrame1 = struct {
	FiDbPage   U32
	FiWalFrame U32

} /* sqlite3.c:199829:9 */

type RbuObjIter

type RbuObjIter = RbuObjIter1 /* sqlite3.c:200254:27 */

type RbuObjIter1

type RbuObjIter1 = struct {
	FpTblIter uintptr
	FpIdxIter uintptr
	FnTblCol  int32

	FazTblCol   uintptr
	FazTblType  uintptr
	FaiSrcOrder uintptr
	FabTblPk    uintptr
	FabNotNull  uintptr
	FabIndexed  uintptr
	FeType      int32
	FbCleanup   int32
	FzTbl       uintptr
	FzDataTbl   uintptr
	FzIdx       uintptr
	FiTnum      int32
	FiPkTnum    int32
	FbUnique    int32
	FnIndex     int32
	FnCol       int32

	FpSelect    uintptr
	FpInsert    uintptr
	FpDelete    uintptr
	FpTmpInsert uintptr
	FnIdxCol    int32

	FaIdxCol    uintptr
	FzIdxSql    uintptr
	FpRbuUpdate uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:199829:9 */

type RbuSpan

type RbuSpan = RbuSpan1 /* sqlite3.c:200256:24 */

type RbuSpan1

type RbuSpan1 = struct {
	FzSpan uintptr
	FnSpan int32
	// contains filtered or unexported fields

} /* sqlite3.c:199829:9 */

type RbuState

type RbuState = RbuState1 /* sqlite3.c:200255:25 */

type RbuState1

type RbuState1 = struct {
	FeStage int32

	FzTbl      uintptr
	FzDataTbl  uintptr
	FzIdx      uintptr
	FiWalCksum I64
	FnRow      int32

	FnProgress I64
	FiCookie   U32

	FiOalSz        I64
	FnPhaseOneStep I64
	// contains filtered or unexported fields

} /* sqlite3.c:200255:9 */

type RbuUpdateStmt

type RbuUpdateStmt = RbuUpdateStmt1 /* sqlite3.c:200259:30 */

type RbuUpdateStmt1

type RbuUpdateStmt1 = struct {
	FzMask   uintptr
	FpUpdate uintptr
	FpNext   uintptr

} /* sqlite3.c:199829:9 */

type Rbu_file

type Rbu_file = rbu_file /* sqlite3.c:200258:25 */

type Rbu_vfs

type Rbu_vfs = rbu_vfs /* sqlite3.c:200257:24 */

type RecordCompare

type RecordCompare = uintptr /* sqlite3.c:16156:13 */

func Xsqlite3VdbeFindCompare

func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare

Return a pointer to an sqlite3VdbeRecordCompare() compatible function suitable for comparing serialized records to the unpacked record passed as the only argument.

type Register_t

type Register_t = int32 /* types.h:182:13 */

type RenameCtx

type RenameCtx = RenameCtx1 /* sqlite3.c:108095:26 */

The context of an ALTER TABLE RENAME COLUMN operation that gets passed down into the Walker.

type RenameCtx1

type RenameCtx1 = struct {
	FpList uintptr
	FnList int32
	FiCol  int32
	FpTab  uintptr
	FzOld  uintptr

} /* sqlite3.c:19463:5 */

Context pointer passed down through the tree-walk.

type RenameToken

type RenameToken = RenameToken1 /* sqlite3.c:14914:28 */

type RenameToken1

type RenameToken1 = struct {
	Fp     uintptr
	Ft     Token
	FpNext uintptr

} /* sqlite3.c:1331:9 */

type Returning

type Returning = Returning1 /* sqlite3.c:14915:26 */

type Returning1

type Returning1 = struct {
	FpParse    uintptr
	FpReturnEL uintptr
	FretTrig   Trigger
	FretTStep  TriggerStep
	FiRetCur   int32
	FnRetCol   int32
	FiRetReg   int32
	// contains filtered or unexported fields

} /* sqlite3.c:14915:9 */

type ReusableSpace

type ReusableSpace = struct {
	FpSpace  uintptr
	FnFree   Sqlite3_int64
	FnNeeded Sqlite3_int64

} /* sqlite3.c:81154:1 */

An instance of this object describes bulk memory available for use by subcomponents of a prepared statement. Space is allocated out of a ReusableSpace object by the allocSpace() routine below.

type RowLoadInfo

type RowLoadInfo = RowLoadInfo1 /* sqlite3.c:132605:28 */

An instance of this object holds information (beyond pParse and pSelect) needed to load the next result row that is to be added to the sorter.

type RowLoadInfo1

type RowLoadInfo1 = struct {
	FregResult int32
	FecelFlags U8
	// contains filtered or unexported fields

} /* sqlite3.c:132119:9 */

type RowSet

type RowSet = RowSet1 /* sqlite3.c:14916:23 */

type RowSet1

type RowSet1 = struct {
	FpChunk  uintptr
	Fdb      uintptr
	FpEntry  uintptr
	FpLast   uintptr
	FpFresh  uintptr
	FpForest uintptr
	FnFresh  U16
	FrsFlags U16
	FiBatch  int32

} /* sqlite3.c:14916:9 */

type RowSetChunk

type RowSetChunk = struct {
	FpNextChunk uintptr
	FaEntry     [42]struct {
		Fv      I64
		FpRight uintptr
		FpLeft  uintptr
	}

} /* sqlite3.c:14916:9 */

RowSetEntry objects are allocated in large chunks (instances of the following structure) to reduce memory allocation overhead. The chunks are kept on a linked list so that they can be deallocated when the RowSet is destroyed.

type RowSetEntry

type RowSetEntry = struct {
	Fv      I64
	FpRight uintptr
	FpLeft  uintptr

} /* sqlite3.c:14916:9 */

Each entry in a RowSet is an instance of the following object.

This same object is reused to store a linked list of trees of RowSetEntry objects. In that alternative use, pRight points to the next entry in the list, pLeft points to the tree, and v is unused. The RowSet.pForest value points to the head of this forest list.

type Rtree

type Rtree = Rtree1 /* sqlite3.c:192362:22 */

type Rtree1

type Rtree1 = struct {
	Fbase          Sqlite3_vtab
	Fdb            uintptr
	FiNodeSize     int32
	FnDim          U8
	FnDim2         U8
	FeCoordType    U8
	FnBytesPerCell U8
	FinWrTrans     U8
	FnAux          U8
	FnAuxNotNull   U8

	FiDepth int32
	FzDb    uintptr
	FzName  uintptr
	FnBusy  U32

	FnRowEst         I64
	FnCursor         U32
	FnNodeRef        U32
	FzReadAuxSql     uintptr
	FpDeleted        uintptr
	FiReinsertHeight int32

	FpNodeBlob     uintptr
	FpWriteNode    uintptr
	FpDeleteNode   uintptr
	FpReadRowid    uintptr
	FpWriteRowid   uintptr
	FpDeleteRowid  uintptr
	FpReadParent   uintptr
	FpWriteParent  uintptr
	FpDeleteParent uintptr
	FpWriteAux     uintptr
	FaHash         [97]uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:192362:9 */

type RtreeCell

type RtreeCell = RtreeCell1 /* sqlite3.c:192365:26 */

type RtreeCell1

type RtreeCell1 = struct {
	FiRowid I64
	FaCoord [10]RtreeCoord

} /* sqlite3.c:192365:9 */

type RtreeCheck

type RtreeCheck = RtreeCheck1 /* sqlite3.c:196179:27 */

Context object passed between the various routines that make up the implementation of integrity-check function rtreecheck().

type RtreeCheck1

type RtreeCheck1 = struct {
	Fdb            uintptr
	FzDb           uintptr
	FzTab          uintptr
	FbInt          int32
	FnDim          int32
	FpGetNode      uintptr
	FaCheckMapping [2]uintptr
	FnLeaf         int32
	FnNonLeaf      int32
	Frc            int32

	FzReport uintptr
	FnErr    int32
	// contains filtered or unexported fields

} /* sqlite3.c:196179:9 */

Context object passed between the various routines that make up the implementation of integrity-check function rtreecheck().

type RtreeConstraint

type RtreeConstraint = RtreeConstraint1 /* sqlite3.c:192366:32 */

type RtreeConstraint1

type RtreeConstraint1 = struct {
	FiCoord int32
	Fop     int32
	Fu      struct{ FrValue RtreeDValue }
	FpInfo  uintptr

} /* sqlite3.c:192363:9 */

type RtreeCoord

type RtreeCoord = RtreeCoord1 /* sqlite3.c:192369:26 */

type RtreeCoord1

type RtreeCoord1 = struct{ Ff RtreeValue } /* sqlite3.c:192365:9 */

type RtreeCursor

type RtreeCursor = RtreeCursor1 /* sqlite3.c:192363:28 */

type RtreeCursor1

type RtreeCursor1 = struct {
	Fbase      Sqlite3_vtab_cursor
	FatEOF     U8
	FbPoint    U8
	FbAuxValid U8

	FiStrategy   int32
	FnConstraint int32

	FaConstraint uintptr
	FnPointAlloc int32
	FnPoint      int32
	FmxLevel     int32

	FaPoint   uintptr
	FpReadAux uintptr
	FsPoint   RtreeSearchPoint
	FaNode    [5]uintptr
	FanQueue  [41]U32
	// contains filtered or unexported fields

} /* sqlite3.c:192363:9 */

type RtreeDValue

type RtreeDValue = float64 /* sqlite3.c:192465:18 */ // High accuracy coordinate

If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will only deal with integer coordinates. No floating point operations will be done.

type RtreeGeomCallback

type RtreeGeomCallback = RtreeGeomCallback1 /* sqlite3.c:192368:34 */

type RtreeGeomCallback1

type RtreeGeomCallback1 = struct {
	FxGeom       uintptr
	FxQueryFunc  uintptr
	FxDestructor uintptr
	FpContext    uintptr

} /* sqlite3.c:192367:9 */

type RtreeMatchArg

type RtreeMatchArg = RtreeMatchArg1 /* sqlite3.c:192367:30 */

type RtreeMatchArg1

type RtreeMatchArg1 = struct {
	FiSize U32

	Fcb     RtreeGeomCallback
	FnParam int32

	FapSqlParam uintptr
	FaParam     [1]RtreeDValue
	// contains filtered or unexported fields

} /* sqlite3.c:192367:9 */

type RtreeNode

type RtreeNode = RtreeNode1 /* sqlite3.c:192364:26 */

type RtreeNode1

type RtreeNode1 = struct {
	FpParent uintptr
	FiNode   I64
	FnRef    int32
	FisDirty int32
	FzData   uintptr
	FpNext   uintptr

} /* sqlite3.c:192362:9 */

type RtreeSearchPoint

type RtreeSearchPoint = RtreeSearchPoint1 /* sqlite3.c:192370:33 */

type RtreeSearchPoint1

type RtreeSearchPoint1 = struct {
	FrScore  RtreeDValue
	Fid      Sqlite3_int64
	FiLevel  U8
	FeWithin U8
	FiCell   U8
	// contains filtered or unexported fields

} /* sqlite3.c:192363:9 */

type RtreeValue

type RtreeValue = float32 /* sqlite3.c:192466:17 */

type SQLiteThread

type SQLiteThread = SQLiteThread1 /* sqlite3.c:14919:29 */

type SQLiteThread1

type SQLiteThread1 = struct {
	Ftid  Pthread_t
	Fdone int32

	FpOut  uintptr
	FxTask uintptr
	FpIn   uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:14919:9 */

type Savepoint

type Savepoint = Savepoint1 /* sqlite3.c:14917:26 */

type Savepoint1

type Savepoint1 = struct {
	FzName            uintptr
	FnDeferredCons    I64
	FnDeferredImmCons I64
	FpNext            uintptr

} /* sqlite3.c:1331:9 */

type ScanStatus

type ScanStatus = ScanStatus1 /* sqlite3.c:21514:27 */

The ScanStatus object holds a single value for the sqlite3_stmt_scanstatus() interface.

type ScanStatus1

type ScanStatus1 = struct {
	FaddrExplain int32
	FaddrLoop    int32
	FaddrVisit   int32
	FiSelectID   int32
	FnEst        LogEst

	FzName uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:21514:9 */

The ScanStatus object holds a single value for the sqlite3_stmt_scanstatus() interface.

type Schema

type Schema = Schema1 /* sqlite3.c:14894:23 */

type Schema1

type Schema1 = struct {
	Fschema_cookie int32
	FiGeneration   int32
	FtblHash       Hash
	FidxHash       Hash
	FtrigHash      Hash
	FfkeyHash      Hash
	FpSeqTab       uintptr
	Ffile_format   U8
	Fenc           U8
	FschemaFlags   U16
	Fcache_size    int32

} /* sqlite3.c:1331:9 */

type Select

type Select = Select1 /* sqlite3.c:14918:23 */

type Select1

type Select1 = struct {
	Fop U8

	FnSelectRow   LogEst
	FselFlags     U32
	FiLimit       int32
	FiOffset      int32
	FselId        U32
	FaddrOpenEphm [2]int32

	FpEList   uintptr
	FpSrc     uintptr
	FpWhere   uintptr
	FpGroupBy uintptr
	FpHaving  uintptr
	FpOrderBy uintptr
	FpPrior   uintptr
	FpNext    uintptr
	FpLimit   uintptr
	FpWith    uintptr
	FpWin     uintptr
	FpWinDefn uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type SelectDest

type SelectDest = SelectDest1 /* sqlite3.c:14920:27 */

type SelectDest1

type SelectDest1 = struct {
	FeDest U8

	FiSDParm  int32
	FiSDParm2 int32
	FiSdst    int32
	FnSdst    int32

	FzAffSdst uintptr
	FpOrderBy uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:14920:9 */

type Sigset_t

type Sigset_t = X__sigset_t /* sigset_t.h:7:20 */

A set of signals to be blocked, unblocked, or waited for.

type Size_t

type Size_t = uint64 /* <builtin>:9:23 */

type Socklen_t

type Socklen_t = X__socklen_t /* unistd.h:274:21 */

type SortCtx

type SortCtx = SortCtx1 /* sqlite3.c:132119:24 */

An instance of the following object is used to record information about the ORDER BY (or GROUP BY) clause of query is being coded.

The aDefer[] array is used by the sorter-references optimization. For example, assuming there is no index that can be used for the ORDER BY, for the query:

SELECT a, bigblob FROM t1 ORDER BY a LIMIT 10;

it may be more efficient to add just the "a" values to the sorter, and retrieve the associated "bigblob" values directly from table t1 as the 10 smallest "a" values are extracted from the sorter.

When the sorter-reference optimization is used, there is one entry in the aDefer[] array for each database table that may be read as values are extracted from the sorter.

type SortCtx1

type SortCtx1 = struct {
	FpOrderBy      uintptr
	FnOBSat        int32
	FiECursor      int32
	FregReturn     int32
	FlabelBkOut    int32
	FaddrSortIndex int32
	FlabelDone     int32
	FlabelOBLopt   int32
	FsortFlags     U8

	FpDeferredRowLoad uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:132119:9 */

An instance of the following object is used to record information about the ORDER BY (or GROUP BY) clause of query is being coded.

The aDefer[] array is used by the sorter-references optimization. For example, assuming there is no index that can be used for the ORDER BY, for the query:

SELECT a, bigblob FROM t1 ORDER BY a LIMIT 10;

it may be more efficient to add just the "a" values to the sorter, and retrieve the associated "bigblob" values directly from table t1 as the 10 smallest "a" values are extracted from the sorter.

When the sorter-reference optimization is used, there is one entry in the aDefer[] array for each database table that may be read as values are extracted from the sorter.

type SortSubtask

type SortSubtask = SortSubtask1 /* sqlite3.c:95481:28 */ // A sub-task in the sort process

A record being sorted

type SortSubtask1

type SortSubtask1 = struct {
	FpThread uintptr
	FbDone   int32

	FpSorter   uintptr
	FpUnpacked uintptr
	Flist      SorterList
	FnPMA      int32

	FxCompare SorterCompare
	Ffile     SorterFile
	Ffile2    SorterFile
	// contains filtered or unexported fields

} /* sqlite3.c:21218:9 */

type SorterCompare

type SorterCompare = uintptr /* sqlite3.c:95611:13 */

This object represents a single thread of control in a sort operation. Exactly VdbeSorter.nTask instances of this object are allocated as part of each VdbeSorter object. Instances are never allocated any other way. VdbeSorter.nTask is set to the number of worker threads allowed (see SQLITE_CONFIG_WORKER_THREADS) plus one (the main thread). Thus for single-threaded operation, there is exactly one instance of this object and for multi-threaded operation there are two or more instances.

Essentially, this structure contains all those fields of the VdbeSorter structure for which each thread requires a separate instance. For example, each thread requries its own UnpackedRecord object to unpack records in as part of comparison operations.

Before a background thread is launched, variable bDone is set to 0. Then, right before it exits, the thread itself sets bDone to 1. This is used for two purposes:

  1. When flushing the contents of memory to a level-0 PMA on disk, to attempt to select a SortSubtask for which there is not already an active background thread (since doing so causes the main thread to block until it finishes).

  2. If SQLITE_DEBUG_SORTER_THREADS is defined, to determine if a call to sqlite3ThreadJoin() is likely to block. Cases that are likely to block provoke debugging output.

In both cases, the effects of the main thread seeing (bDone==0) even after the thread has finished are not dire. So we don't worry about memory barriers and such here.

type SorterFile

type SorterFile = SorterFile1 /* sqlite3.c:95482:27 */ // Temporary file object wrapper

A sub-task in the sort process

type SorterFile1

type SorterFile1 = struct {
	FpFd  uintptr
	FiEof I64

} /* sqlite3.c:21218:9 */

type SorterList

type SorterList = SorterList1 /* sqlite3.c:95483:27 */ // In-memory list of records

Temporary file object wrapper

type SorterList1

type SorterList1 = struct {
	FpList   uintptr
	FaMemory uintptr
	FszPMA   int32
	// contains filtered or unexported fields

} /* sqlite3.c:21218:9 */

type SorterRecord

type SorterRecord = SorterRecord1 /* sqlite3.c:95480:29 */ // A record being sorted

Incrementally write one PMA

type SorterRecord1

type SorterRecord1 = struct {
	FnVal int32

	Fu struct{ FpNext uintptr }
	// contains filtered or unexported fields

} /* sqlite3.c:21218:9 */

type Sqlite3

type Sqlite3 = sqlite3 /* sqlite3.c:1331:24 */

CAPI3REF: Database Connection Handle KEYWORDS: {database connection} {database connections}

Each open SQLite database is represented by a pointer to an instance of the opaque structure named "sqlite3". It is useful to think of an sqlite3 pointer as an object. The [sqlite3_open()], [sqlite3_open16()], and [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()] and [sqlite3_close_v2()] are its destructors. There are many other interfaces (such as [sqlite3_prepare_v2()], [sqlite3_create_function()], and [sqlite3_busy_timeout()] to name but three) that are methods on an sqlite3 object.

type Sqlite3AutoExtList

type Sqlite3AutoExtList = sqlite3AutoExtList /* sqlite3.c:127641:35 */

The following object holds the list of automatically loaded extensions.

This list is shared across threads. The SQLITE_MUTEX_STATIC_MAIN mutex must be held while accessing this list.

type Sqlite3Config

type Sqlite3Config = struct {
	FbMemstat           int32
	FbCoreMutex         U8
	FbFullMutex         U8
	FbOpenUri           U8
	FbUseCis            U8
	FbSmallMalloc       U8
	FbExtraSchemaChecks U8

	FmxStrlen     int32
	FneverCorrupt int32
	FszLookaside  int32
	FnLookaside   int32
	FnStmtSpill   int32
	Fm            Sqlite3_mem_methods
	Fmutex        Sqlite3_mutex_methods
	Fpcache2      Sqlite3_pcache_methods2
	FpHeap        uintptr
	FnHeap        int32
	FmnReq        int32
	FmxReq        int32

	FszMmap             Sqlite3_int64
	FmxMmap             Sqlite3_int64
	FpPage              uintptr
	FszPage             int32
	FnPage              int32
	FmxParserStack      int32
	FsharedCacheEnabled int32
	FszPma              U32
	FisInit             int32
	FinProgress         int32
	FisMutexInit        int32
	FisMallocInit       int32
	FisPCacheInit       int32
	FnRefInitMutex      int32

	FpInitMutex          uintptr
	FxLog                uintptr
	FpLogArg             uintptr
	FmxMemdbSize         Sqlite3_int64
	FxTestCallback       uintptr
	FbLocaltimeFault     int32
	FiOnceResetThreshold int32
	FszSorterRef         U32
	FiPrngSeed           uint32
	// contains filtered or unexported fields

} /* sqlite3.c:19356:1 */

Structure containing global configuration data for the SQLite library.

This structure also contains some state information.

type Sqlite3StatType

type Sqlite3StatType = sqlite3StatType /* sqlite3.c:21803:32 */

type Sqlite3StatValueType

type Sqlite3StatValueType = Sqlite3_int64 /* sqlite3.c:21799:23 */

Variables in which to record status information.

type Sqlite3_api_routines

type Sqlite3_api_routines = sqlite3_api_routines /* sqlite3.c:2298:37 */

CAPI3REF: Loadable Extension Thunk

A pointer to the opaque sqlite3_api_routines structure is passed as the third parameter to entry points of [loadable extensions]. This structure must be typedefed in order to work around compiler warnings on some platforms.

type Sqlite3_backup

type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9671:31 */

CAPI3REF: Online Backup Object

The sqlite3_backup object records state information about an ongoing online backup operation. ^The sqlite3_backup object is created by a call to [sqlite3_backup_init()] and is destroyed by a call to [sqlite3_backup_finish()].

See Also: [Using the SQLite Online Backup API]

type Sqlite3_callback

type Sqlite3_callback = uintptr /* sqlite3.c:1420:13 */

The type for a callback function. This is legacy and deprecated. It is included for historical compatibility and is not documented.

type Sqlite3_context

type Sqlite3_context = sqlite3_context /* sqlite3.c:5382:32 */

CAPI3REF: SQL Function Context Object

The context in which an SQL function executes is stored in an sqlite3_context object. ^A pointer to an sqlite3_context object is always first parameter to [application-defined SQL functions]. The application-defined SQL function implementation will pass this pointer through into calls to [sqlite3_result_int | sqlite3_result()], [sqlite3_aggregate_context()], [sqlite3_user_data()], [sqlite3_context_db_handle()], [sqlite3_get_auxdata()], and/or [sqlite3_set_auxdata()].

type Sqlite3_destructor_type

type Sqlite3_destructor_type = uintptr /* sqlite3.c:6747:14 */

CAPI3REF: Constants Defining Special Destructor Behavior

These are special values for the destructor that is passed in as the final argument to routines like [sqlite3_result_blob()]. ^If the destructor argument is SQLITE_STATIC, it means that the content pointer is constant and will never change. It does not need to be destroyed. ^The SQLITE_TRANSIENT value means that the content will likely change in the near future and that SQLite should make its own private copy of the content before returning.

The typedef is necessary to work around problems in certain C++ compilers.

type Sqlite3_file

type Sqlite3_file = sqlite3_file /* sqlite3.c:1766:29 */

CAPI3REF: OS Interface Open File Handle

An [sqlite3_file] object represents an open file in the [sqlite3_vfs | OS interface layer]. Individual OS interface implementations will want to subclass this object by appending additional fields for their own use. The pMethods entry is a pointer to an [sqlite3_io_methods] object that defines methods for performing I/O operations on the open file.

type Sqlite3_index_info

type Sqlite3_index_info = sqlite3_index_info /* sqlite3.c:7867:35 */

type Sqlite3_int64

type Sqlite3_int64 = Sqlite_int64 /* sqlite3.c:1363:22 */

func Xsqlite3BtreeMaxRecordSize

func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64

Return an upper bound on the size of any record for the table that the cursor is pointing into.

This is an optimization. Everything will still work if this routine always returns 2147483647 (which is the largest record that SQLite can handle) or more. But returning a smaller value might prevent large memory allocations when trying to interpret a corrupt datrabase.

The current implementation merely returns the size of the underlying database file.

func Xsqlite3StatusValue

func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64

Return the current value of a status parameter. The caller must be holding the appropriate mutex.

func Xsqlite3StmtCurrentTime

func Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64

Return the current time for a statement. If the current time is requested more than once within the same run of a single prepared statement, the exact same time is returned for each invocation regardless of the amount of time that elapses between invocations. In other words, the time returned is always the time of the first call.

func Xsqlite3_hard_heap_limit64

func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64

Set the hard heap-size limit for the library. An argument of zero disables the hard heap limit. A negative argument is a no-op used to obtain the return value without affecting the hard heap limit.

The return value is the value of the hard heap limit just prior to calling this interface.

Setting the hard heap limit will also activate the soft heap limit and constrain the soft heap limit to be no more than the hard heap limit.

func Xsqlite3_memory_highwater

func Xsqlite3_memory_highwater(tls *libc.TLS, resetFlag int32) Sqlite3_int64

Return the maximum amount of memory that has ever been checked out since either the beginning of this process or since the most recent reset.

func Xsqlite3_memory_used

func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64

Return the amount of memory currently checked out.

func Xsqlite3_soft_heap_limit64

func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64

Set the soft heap-size limit for the library. An argument of zero disables the limit. A negative argument is a no-op used to obtain the return value.

The return value is the value of the heap limit just before this interface was called.

If the hard heap limit is enabled, then the soft heap limit cannot be disabled nor raised above the hard heap limit.

func Xsqlite3_uri_int64

func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt Sqlite3_int64) Sqlite3_int64

Return a 64-bit integer value for a query parameter.

func Xsqlite3rbu_progress

func Xsqlite3rbu_progress(tls *libc.TLS, pRbu uintptr) Sqlite3_int64

Return the total number of key-value operations (inserts, deletes or updates) that have been performed on the target database since the current RBU update was started.

func Xsqlite3rbu_temp_size

func Xsqlite3rbu_temp_size(tls *libc.TLS, pRbu uintptr) Sqlite3_int64

func Xsqlite3rbu_temp_size_limit

func Xsqlite3rbu_temp_size_limit(tls *libc.TLS, pRbu uintptr, n Sqlite3_int64) Sqlite3_int64

Configure the aggregate temp file size limit for this RBU handle.

type Sqlite3_io_methods

type Sqlite3_io_methods = sqlite3_io_methods /* sqlite3.c:1865:35 */

CAPI3REF: OS Interface File Virtual Methods Object

Every file opened by the [sqlite3_vfs.xOpen] method populates an [sqlite3_file] object (or, more commonly, a subclass of the [sqlite3_file] object) with a pointer to an instance of this object. This object defines the methods used to perform various operations against the open file represented by the [sqlite3_file] object.

If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element to a non-NULL pointer, then the sqlite3_io_methods.xClose method may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed. The only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen] is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element to NULL.

The flags argument to xSync may be one of SQLITE_SYNC_NORMAL or SQLITE_SYNC_FULL. The first choice is the normal fsync(). The second choice is a Mac OS X style fullsync. The SQLITE_SYNC_DATAONLY flag may be ORed in to indicate that only the data of the file and not its inode needs to be synced.

The integer values to xLock() and xUnlock() are one of <ul> <li> SQLITE_LOCK_NONE, <li> SQLITE_LOCK_SHARED, <li> SQLITE_LOCK_RESERVED, <li> SQLITE_LOCK_PENDING, or <li> SQLITE_LOCK_EXCLUSIVE. </ul> xLock() increases the lock. xUnlock() decreases the lock. The xCheckReservedLock() method checks whether any database connection, either in this process or in some other process, is holding a RESERVED, PENDING, or EXCLUSIVE lock on the file. It returns true if such a lock exists and false otherwise.

The xFileControl() method is a generic interface that allows custom VFS implementations to directly control an open file using the [sqlite3_file_control()] interface. The second "op" argument is an integer opcode. The third argument is a generic pointer intended to point to a structure that may contain arguments or space in which to write return values. Potential uses for xFileControl() might be functions to enable blocking locks with timeouts, to change the locking strategy (for example to use dot-file locks), to inquire about the status of a lock, or to break stale locks. The SQLite core reserves all opcodes less than 100 for its own use. A [file control opcodes | list of opcodes] less than 100 is available. Applications that define a custom xFileControl method should use opcodes greater than 100 to avoid conflicts. VFS implementations should return SQLITE_NOTFOUND for file control opcodes that they do not recognize.

The xSectorSize() method returns the sector size of the device that underlies the file. The sector size is the minimum write that can be performed without disturbing other bytes in the file. The xDeviceCharacteristics() method returns a bit vector describing behaviors of the underlying device:

<ul> <li> SQLITE_IOCAP_ATOMIC <li> SQLITE_IOCAP_ATOMIC512 <li> SQLITE_IOCAP_ATOMIC1K <li> SQLITE_IOCAP_ATOMIC2K <li> SQLITE_IOCAP_ATOMIC4K <li> SQLITE_IOCAP_ATOMIC8K <li> SQLITE_IOCAP_ATOMIC16K <li> SQLITE_IOCAP_ATOMIC32K <li> SQLITE_IOCAP_ATOMIC64K <li> SQLITE_IOCAP_SAFE_APPEND <li> SQLITE_IOCAP_SEQUENTIAL <li> SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN <li> SQLITE_IOCAP_POWERSAFE_OVERWRITE <li> SQLITE_IOCAP_IMMUTABLE <li> SQLITE_IOCAP_BATCH_ATOMIC </ul>

The SQLITE_IOCAP_ATOMIC property means that all writes of any size are atomic. The SQLITE_IOCAP_ATOMICnnn values mean that writes of blocks that are nnn bytes in size and are aligned to an address which is an integer multiple of nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means that when data is appended to a file, the data is appended first then the size of the file is extended, never the other way around. The SQLITE_IOCAP_SEQUENTIAL property means that information is written to disk in the same order as calls to xWrite().

If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill in the unread portions of the buffer with zeros. A VFS that fails to zero-fill short reads might seem to work. However, failure to zero-fill short reads will eventually lead to database corruption.

type Sqlite3_loadext_entry

type Sqlite3_loadext_entry = uintptr /* sqlite3.c:126633:13 */

This is the function signature used for all extension entry points. It is also defined in the file "loadext.c".

type Sqlite3_mem_methods

type Sqlite3_mem_methods = sqlite3_mem_methods /* sqlite3.c:2767:36 */

CAPI3REF: Memory Allocation Routines

An instance of this object defines the interface between SQLite and low-level memory allocation routines.

This object is used in only one place in the SQLite interface. A pointer to an instance of this object is the argument to [sqlite3_config()] when the configuration option is SQLITE_CONFIG_MALLOC or SQLITE_CONFIG_GETMALLOC. By creating an instance of this object and passing it to [sqlite3_config](SQLITE_CONFIG_MALLOC) during configuration, an application can specify an alternative memory allocation subsystem for SQLite to use for all of its dynamic memory needs.

Note that SQLite comes with several [built-in memory allocators] that are perfectly adequate for the overwhelming majority of applications and that this object is only useful to a tiny minority of applications with specialized memory allocation requirements. This object is also used during testing of SQLite in order to specify an alternative memory allocator that simulates memory out-of-memory conditions in order to verify that SQLite recovers gracefully from such conditions.

The xMalloc, xRealloc, and xFree methods must work like the malloc(), realloc() and free() functions from the standard C library. ^SQLite guarantees that the second argument to xRealloc is always a value returned by a prior call to xRoundup.

xSize should return the allocated size of a memory allocation previously obtained from xMalloc or xRealloc. The allocated size is always at least as big as the requested size but may be larger.

The xRoundup method returns what would be the allocated size of a memory allocation given a particular requested size. Most memory allocators round up memory allocations at least to the next multiple of 8. Some allocators round up to a larger multiple or to a power of 2. Every memory allocation request coming in through [sqlite3_malloc()] or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, that causes the corresponding memory allocation to fail.

The xInit method initializes the memory allocator. For example, it might allocate any required mutexes or initialize internal data structures. The xShutdown method is invoked (indirectly) by [sqlite3_shutdown()] and should deallocate any resources acquired by xInit. The pAppData pointer is used as the only parameter to xInit and xShutdown.

SQLite holds the SQLITE_MUTEX_STATIC_MAIN mutex when it invokes the xInit method, so the xInit method need not be threadsafe. The xShutdown method is only called from [sqlite3_shutdown()] so it does not need to be threadsafe either. For all other methods, SQLite holds the SQLITE_MUTEX_STATIC_MEM mutex as long as the SQLITE_CONFIG_MEMSTATUS configuration option is turned on (which it is by default) and so the methods are automatically serialized. However, if SQLITE_CONFIG_MEMSTATUS is disabled, then the other methods must be threadsafe or else make their own arrangements for serialization.

SQLite will never invoke xInit() more than once without an intervening call to xShutdown().

type Sqlite3_module

type Sqlite3_module = sqlite3_module /* sqlite3.c:7869:31 */

type Sqlite3_mutex

type Sqlite3_mutex = sqlite3_mutex /* sqlite3.c:2288:30 */

CAPI3REF: Mutex Handle

The mutex module within SQLite defines [sqlite3_mutex] to be an abstract type for a mutex object. The SQLite core never looks at the internal representation of an [sqlite3_mutex]. It only deals with pointers to the [sqlite3_mutex] object.

Mutexes are created using [sqlite3_mutex_alloc()].

type Sqlite3_mutex_methods

type Sqlite3_mutex_methods = sqlite3_mutex_methods /* sqlite3.c:8701:38 */

CAPI3REF: Mutex Methods Object

An instance of this structure defines the low-level routines used to allocate and use mutexes.

Usually, the default mutex implementations provided by SQLite are sufficient, however the application has the option of substituting a custom implementation for specialized deployments or systems for which SQLite does not provide a suitable implementation. In this case, the application creates and populates an instance of this structure to pass to sqlite3_config() along with the SQLITE_CONFIG_MUTEX option. Additionally, an instance of this structure can be used as an output variable when querying the system for the current mutex implementation, using the SQLITE_CONFIG_GETMUTEX option.

^The xMutexInit method defined by this structure is invoked as part of system initialization by the sqlite3_initialize() function. ^The xMutexInit routine is called by SQLite exactly once for each effective call to [sqlite3_initialize()].

^The xMutexEnd method defined by this structure is invoked as part of system shutdown by the sqlite3_shutdown() function. The implementation of this method is expected to release all outstanding resources obtained by the mutex methods implementation, especially those obtained by the xMutexInit method. ^The xMutexEnd() interface is invoked exactly once for each call to [sqlite3_shutdown()].

^(The remaining seven methods defined by this structure (xMutexAlloc, xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and xMutexNotheld) implement the following interfaces (respectively):

<ul>

<li>  [sqlite3_mutex_alloc()] </li>
<li>  [sqlite3_mutex_free()] </li>
<li>  [sqlite3_mutex_enter()] </li>
<li>  [sqlite3_mutex_try()] </li>
<li>  [sqlite3_mutex_leave()] </li>
<li>  [sqlite3_mutex_held()] </li>
<li>  [sqlite3_mutex_notheld()] </li>

</ul>)^

The only difference is that the public sqlite3_XXX functions enumerated above silently ignore any invocations that pass a NULL pointer instead of a valid mutex handle. The implementations of the methods defined by this structure are not required to handle this case. The results of passing a NULL pointer instead of a valid mutex handle are undefined (i.e. it is acceptable to provide an implementation that segfaults if it is passed a NULL pointer).

The xMutexInit() method must be threadsafe. It must be harmless to invoke xMutexInit() multiple times within the same process and without intervening calls to xMutexEnd(). Second and subsequent calls to xMutexInit() must be no-ops.

xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] and its associates). Similarly, xMutexAlloc() must not use SQLite memory allocation for a static mutex. ^However xMutexAlloc() may use SQLite memory allocation for a fast or recursive mutex.

^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is called, but only if the prior call to xMutexInit returned SQLITE_OK. If xMutexInit fails in any way, it is expected to clean up after itself prior to returning.

type Sqlite3_pcache_methods

type Sqlite3_pcache_methods = sqlite3_pcache_methods /* sqlite3.c:9645:39 */

This is the obsolete pcache_methods object that has now been replaced by sqlite3_pcache_methods2. This object is not used by SQLite. It is retained in the header file for backwards compatibility only.

type Sqlite3_pcache_methods2

type Sqlite3_pcache_methods2 = sqlite3_pcache_methods2 /* sqlite3.c:9622:40 */

CAPI3REF: Application Defined Page Cache. KEYWORDS: {page cache}

^(The [sqlite3_config](SQLITE_CONFIG_PCACHE2, ...) interface can register an alternative page cache implementation by passing in an instance of the sqlite3_pcache_methods2 structure.)^ In many applications, most of the heap memory allocated by SQLite is used for the page cache. By implementing a custom page cache using this API, an application can better control the amount of memory consumed by SQLite, the way in which that memory is allocated and released, and the policies used to determine exactly which parts of a database file are cached and for how long.

The alternative page cache mechanism is an extreme measure that is only needed by the most demanding applications. The built-in page cache is recommended for most uses.

^(The contents of the sqlite3_pcache_methods2 structure are copied to an internal buffer by SQLite within the call to [sqlite3_config]. Hence the application may discard the parameter after the call to [sqlite3_config()] returns.)^

[[the xInit() page cache method]] ^(The xInit() method is called once for each effective call to [sqlite3_initialize()])^ (usually only once during the lifetime of the process). ^(The xInit() method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^ The intent of the xInit() method is to set up global data structures required by the custom page cache implementation. ^(If the xInit() method is NULL, then the built-in default page cache is used instead of the application defined page cache.)^

[[the xShutdown() page cache method]] ^The xShutdown() method is called by [sqlite3_shutdown()]. It can be used to clean up any outstanding resources before process shutdown, if required. ^The xShutdown() method may be NULL.

^SQLite automatically serializes calls to the xInit method, so the xInit method need not be threadsafe. ^The xShutdown method is only called from [sqlite3_shutdown()] so it does not need to be threadsafe either. All other methods must be threadsafe in multithreaded applications.

^SQLite will never invoke xInit() more than once without an intervening call to xShutdown().

[[the xCreate() page cache methods]] ^SQLite invokes the xCreate() method to construct a new cache instance. SQLite will typically create one cache instance for each open database file, though this is not guaranteed. ^The first parameter, szPage, is the size in bytes of the pages that must be allocated by the cache. ^szPage will always a power of two. ^The second parameter szExtra is a number of bytes of extra storage associated with each page cache entry. ^The szExtra parameter will a number less than 250. SQLite will use the extra szExtra bytes on each page to store metadata about the underlying database page on disk. The value passed into szExtra depends on the SQLite version, the target platform, and how SQLite was compiled. ^The third argument to xCreate(), bPurgeable, is true if the cache being created will be used to cache database pages of a file stored on disk, or false if it is used for an in-memory database. The cache implementation does not have to do anything special based with the value of bPurgeable; it is purely advisory. ^On a cache where bPurgeable is false, SQLite will never invoke xUnpin() except to deliberately delete a page. ^In other words, calls to xUnpin() on a cache with bPurgeable set to false will always have the "discard" flag set to true. ^Hence, a cache created with bPurgeable false will never contain any unpinned pages.

[[the xCachesize() page cache method]] ^(The xCachesize() method may be called at any time by SQLite to set the suggested maximum cache-size (number of pages stored by) the cache instance passed as the first argument. This is the value configured using the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable parameter, the implementation is not required to do anything with this value; it is advisory only.

[[the xPagecount() page cache methods]] The xPagecount() method must return the number of pages currently stored in the cache, both pinned and unpinned.

[[the xFetch() page cache methods]] The xFetch() method locates a page in the cache and returns a pointer to an sqlite3_pcache_page object associated with that page, or a NULL pointer. The pBuf element of the returned sqlite3_pcache_page object will be a pointer to a buffer of szPage bytes used to store the content of a single database page. The pExtra element of sqlite3_pcache_page will be a pointer to the szExtra bytes of extra storage that SQLite has requested for each entry in the page cache.

The page to be fetched is determined by the key. ^The minimum key value is 1. After it has been retrieved using xFetch, the page is considered to be "pinned".

If the requested page is already in the page cache, then the page cache implementation must return a pointer to the page buffer with its content intact. If the requested page is not already in the cache, then the cache implementation should use the value of the createFlag parameter to help it determined what action to take:

<table border=1 width=85% align=center> <tr><th> createFlag <th> Behavior when page is not already in cache <tr><td> 0 <td> Do not allocate a new page. Return NULL. <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so.

Otherwise return NULL.

<tr><td> 2 <td> Make every effort to allocate a new page. Only return

NULL if allocating a new page is effectively impossible.

</table>

^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1. SQLite will only use a createFlag of 2 after a prior call with a createFlag of 1 failed.)^ In between the xFetch() calls, SQLite may attempt to unpin one or more cache pages by spilling the content of pinned pages to disk and synching the operating system disk cache.

[[the xUnpin() page cache method]] ^xUnpin() is called by SQLite with a pointer to a currently pinned page as its second argument. If the third parameter, discard, is non-zero, then the page must be evicted from the cache. ^If the discard parameter is zero, then the page may be discarded or retained at the discretion of page cache implementation. ^The page cache implementation may choose to evict unpinned pages at any time.

The cache must not perform any reference counting. A single call to xUnpin() unpins the page regardless of the number of prior calls to xFetch().

[[the xRekey() page cache methods]] The xRekey() method is used to change the key value associated with the page passed as the second argument. If the cache previously contains an entry associated with newKey, it must be discarded. ^Any prior cache entry associated with newKey is guaranteed not to be pinned.

When SQLite calls the xTruncate() method, the cache must discard all existing cache entries with page numbers (keys) greater than or equal to the value of the iLimit parameter passed to xTruncate(). If any of these pages are pinned, they are implicitly unpinned, meaning that they can be safely discarded.

[[the xDestroy() page cache method]] ^The xDestroy() method is used to delete a cache allocated by xCreate(). All resources associated with the specified cache should be freed. ^After calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] handle invalid, and will not use it with any other sqlite3_pcache_methods2 functions.

[[the xShrink() page cache method]] ^SQLite invokes the xShrink() method when it wants the page cache to free up as much of heap memory as possible. The page cache implementation is not obligated to free any memory, but well-behaved implementations should do their best.

type Sqlite3_pcache_page

type Sqlite3_pcache_page = sqlite3_pcache_page /* sqlite3.c:9457:36 */

CAPI3REF: Custom Page Cache Object

The sqlite3_pcache_page object represents a single page in the page cache. The page cache will allocate instances of this object. Various methods of the page cache use pointers to instances of this object as parameters or as their return value.

See [sqlite3_pcache_methods2] for additional information.

type Sqlite3_rtree_dbl

type Sqlite3_rtree_dbl = float64 /* sqlite3.c:11048:18 */

The double-precision datatype used by RTree depends on the SQLITE_RTREE_INT_ONLY compile-time option.

type Sqlite3_rtree_geometry

type Sqlite3_rtree_geometry = sqlite3_rtree_geometry /* sqlite3.c:11039:39 */

type Sqlite3_rtree_query_info

type Sqlite3_rtree_query_info = sqlite3_rtree_query_info /* sqlite3.c:11040:41 */

type Sqlite3_snapshot

type Sqlite3_snapshot = sqlite3_snapshot /* sqlite3.c:10714:3 */

CAPI3REF: Database Snapshot KEYWORDS: {snapshot} {sqlite3_snapshot}

An instance of the snapshot object records the state of a [WAL mode] database for some specific point in history.

In [WAL mode], multiple [database connections] that are open on the same database file can each be reading a different historical version of the database file. When a [database connection] begins a read transaction, that connection sees an unchanging copy of the database as it existed for the point in time when the transaction first started. Subsequent changes to the database from other connections are not seen by the reader until a new read transaction is started.

The sqlite3_snapshot object records state information about an historical version of the database file so that it is possible to later open a new read transaction that sees that historical version of the database rather than the most recent version.

type Sqlite3_str

type Sqlite3_str = sqlite3_str /* sqlite3.c:8964:28 */

CAPI3REF: Dynamic String Object KEYWORDS: {dynamic string}

An instance of the sqlite3_str object contains a dynamically-sized string under construction.

The lifecycle of an sqlite3_str object is as follows: <ol> <li> ^The sqlite3_str object is created using [sqlite3_str_new()]. <li> ^Text is appended to the sqlite3_str object using various methods, such as [sqlite3_str_appendf()]. <li> ^The sqlite3_str object is destroyed and the string it created is returned using the [sqlite3_str_finish()] interface. </ol>

type Sqlite3_syscall_ptr

type Sqlite3_syscall_ptr = uintptr /* sqlite3.c:2470:14 */

type Sqlite3_uint64

type Sqlite3_uint64 = Sqlite_uint64 /* sqlite3.c:1364:23 */

func Xsqlite3_msize

func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64

type Sqlite3_value

type Sqlite3_value = sqlite3_value /* sqlite3.c:5368:30 */

CAPI3REF: Dynamically Typed Value Object KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}

SQLite uses the sqlite3_value object to represent all values that can be stored in a database table. SQLite uses dynamic typing for the values it stores. ^Values stored in sqlite3_value objects can be integers, floating point values, strings, BLOBs, or NULL.

An sqlite3_value object may be either "protected" or "unprotected". Some interfaces require a protected sqlite3_value. Other interfaces will accept either a protected or an unprotected sqlite3_value. Every interface that accepts sqlite3_value arguments specifies whether or not it requires a protected sqlite3_value. The [sqlite3_value_dup()] interface can be used to construct a new protected sqlite3_value from an unprotected sqlite3_value.

The terms "protected" and "unprotected" refer to whether or not a mutex is held. An internal mutex is held for a protected sqlite3_value object but no mutex is held for an unprotected sqlite3_value object. If SQLite is compiled to be single-threaded (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) or if SQLite is run in one of reduced mutex modes SQLITE_CONFIG_SINGLETHREAD or SQLITE_CONFIG_MULTITHREAD then there is no distinction between protected and unprotected sqlite3_value objects and they can be used interchangeably. However, for maximum code portability it is recommended that applications still make the distinction between protected and unprotected sqlite3_value objects even when not strictly required.

^The sqlite3_value objects that are passed as parameters into the implementation of [application-defined SQL functions] are protected. ^The sqlite3_value object returned by [sqlite3_column_value()] is unprotected. Unprotected sqlite3_value objects may only be used as arguments to [sqlite3_result_value()], [sqlite3_bind_value()], and [sqlite3_value_dup()]. The [sqlite3_value_blob | sqlite3_value_type()] family of interfaces require protected sqlite3_value objects.

type Sqlite3_vfs

type Sqlite3_vfs = sqlite3_vfs /* sqlite3.c:2469:28 */

CAPI3REF: OS Interface Object

An instance of the sqlite3_vfs object defines the interface between the SQLite core and the underlying operating system. The "vfs" in the name of the object stands for "virtual file system". See the [VFS | VFS documentation] for further information.

The VFS interface is sometimes extended by adding new methods onto the end. Each time such an extension occurs, the iVersion field is incremented. The iVersion value started out as 1 in SQLite [version 3.5.0] on [dateof:3.5.0], then increased to 2 with SQLite [version 3.7.0] on [dateof:3.7.0], and then increased to 3 with SQLite [version 3.7.6] on [dateof:3.7.6]. Additional fields may be appended to the sqlite3_vfs object and the iVersion value may increase again in future versions of SQLite. Note that due to an oversight, the structure of the sqlite3_vfs object changed in the transition from SQLite [version 3.5.9] to [version 3.6.0] on [dateof:3.6.0] and yet the iVersion field was not increased.

The szOsFile field is the size of the subclassed [sqlite3_file] structure used by this VFS. mxPathname is the maximum length of a pathname in this VFS.

Registered sqlite3_vfs objects are kept on a linked list formed by the pNext pointer. The [sqlite3_vfs_register()] and [sqlite3_vfs_unregister()] interfaces manage this list in a thread-safe way. The [sqlite3_vfs_find()] interface searches the list. Neither the application code nor the VFS implementation should use the pNext pointer.

The pNext field is the only field in the sqlite3_vfs structure that SQLite will ever modify. SQLite will only access or modify this field while holding a particular static mutex. The application should never modify anything within the sqlite3_vfs object once the object has been registered.

The zName field holds the name of the VFS module. The name must be unique across all VFS modules.

[[sqlite3_vfs.xOpen]] ^SQLite guarantees that the zFilename parameter to xOpen is either a NULL pointer or string obtained from xFullPathname() with an optional suffix added. ^If a suffix is added to the zFilename parameter, it will consist of a single "-" character followed by no more than 11 alphanumeric and/or "-" characters. ^SQLite further guarantees that the string will be valid and unchanged until xClose() is called. Because of the previous sentence, the [sqlite3_file] can safely store a pointer to the filename if it needs to remember the filename for some reason. If the zFilename parameter to xOpen is a NULL pointer then xOpen must invent its own temporary name for the file. ^Whenever the xFilename parameter is NULL it will also be the case that the flags parameter will include SQLITE_OPEN_DELETEONCLOSE.

The flags argument to xOpen() includes all bits set in the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()] or [sqlite3_open16()] is used, then flags includes at least SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE. If xOpen() opens a file read-only then it sets *pOutFlags to include SQLITE_OPEN_READONLY. Other bits in *pOutFlags may be set.

^(SQLite will also add one of the following flags to the xOpen() call, depending on the object being opened:

<ul> <li> SQLITE_OPEN_MAIN_DB <li> SQLITE_OPEN_MAIN_JOURNAL <li> SQLITE_OPEN_TEMP_DB <li> SQLITE_OPEN_TEMP_JOURNAL <li> SQLITE_OPEN_TRANSIENT_DB <li> SQLITE_OPEN_SUBJOURNAL <li> SQLITE_OPEN_SUPER_JOURNAL <li> SQLITE_OPEN_WAL </ul>)^

The file I/O implementation can use the object type flags to change the way it deals with files. For example, an application that does not care about crash recovery or rollback might make the open of a journal file a no-op. Writes to this journal would also be no-ops, and any attempt to read the journal would return SQLITE_IOERR. Or the implementation might recognize that a database file will be doing page-aligned sector reads and writes in a random order and set up its I/O subsystem accordingly.

SQLite might also add one of the following flags to the xOpen method:

<ul> <li> SQLITE_OPEN_DELETEONCLOSE <li> SQLITE_OPEN_EXCLUSIVE </ul>

The SQLITE_OPEN_DELETEONCLOSE flag means the file should be deleted when it is closed. ^The SQLITE_OPEN_DELETEONCLOSE will be set for TEMP databases and their journals, transient databases, and subjournals.

^The SQLITE_OPEN_EXCLUSIVE flag is always used in conjunction with the SQLITE_OPEN_CREATE flag, which are both directly analogous to the O_EXCL and O_CREAT flags of the POSIX open() API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the SQLITE_OPEN_CREATE, is used to indicate that file should always be created, and that it is an error if it already exists. It is <i>not</i> used to indicate the file should be opened for exclusive access.

^At least szOsFile bytes of memory are allocated by SQLite to hold the [sqlite3_file] structure passed as the third argument to xOpen. The xOpen method does not have to allocate the structure; it should just fill it in. Note that the xOpen method must set the sqlite3_file.pMethods to either a valid [sqlite3_io_methods] object or to NULL. xOpen must do this even if the open fails. SQLite expects that the sqlite3_file.pMethods element will be valid after xOpen returns regardless of the success or failure of the xOpen call.

[[sqlite3_vfs.xAccess]] ^The flags argument to xAccess() may be SQLITE_ACCESS_EXISTS to test for the existence of a file, or SQLITE_ACCESS_READWRITE to test whether a file is readable and writable, or SQLITE_ACCESS_READ to test whether a file is at least readable. The SQLITE_ACCESS_READ flag is never actually used and is not implemented in the built-in VFSes of SQLite. The file is named by the second argument and can be a directory. The xAccess method returns SQLITE_OK on success or some non-zero error code if there is an I/O error or if the name of the file given in the second argument is illegal. If SQLITE_OK is returned, then non-zero or zero is written into *pResOut to indicate whether or not the file is accessible.

^SQLite will always allocate at least mxPathname+1 bytes for the output buffer xFullPathname. The exact size of the output buffer is also passed as a parameter to both methods. If the output buffer is not large enough, SQLITE_CANTOPEN should be returned. Since this is handled as a fatal error by SQLite, vfs implementations should endeavor to prevent this by setting mxPathname to a sufficiently large value.

The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64() interfaces are not strictly a part of the filesystem, but they are included in the VFS structure for completeness. The xRandomness() function attempts to return nBytes bytes of good-quality randomness into zOut. The return value is the actual number of bytes of randomness obtained. The xSleep() method causes the calling thread to sleep for at least the number of microseconds given. ^The xCurrentTime() method returns a Julian Day Number for the current date and time as a floating point value. ^The xCurrentTimeInt64() method returns, as an integer, the Julian Day Number multiplied by 86400000 (the number of milliseconds in a 24-hour day). ^SQLite will use the xCurrentTimeInt64() method to get the current date and time if that method is available (if iVersion is 2 or greater and the function pointer is not NULL) and will fall back to xCurrentTime() if xCurrentTimeInt64() is unavailable.

^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces are not used by the SQLite core. These optional interfaces are provided by some VFSes to facilitate testing of the VFS code. By overriding system calls with functions under its control, a test program can simulate faults and error conditions that would otherwise be difficult or impossible to induce. The set of system calls that can be overridden varies from one VFS to another, and from one version of the same VFS to the next. Applications that use these interfaces must be prepared for any or all of these interfaces to be NULL or for their behavior to change from one release to the next. Applications must not attempt to access any of these methods if the iVersion of the VFS is less than 3.

type Sqlite3_vtab

type Sqlite3_vtab = sqlite3_vtab /* sqlite3.c:7866:29 */

Structures used by the virtual table interface

type Sqlite3_vtab_cursor

type Sqlite3_vtab_cursor = sqlite3_vtab_cursor /* sqlite3.c:7868:36 */

type Sqlite3_xauth

type Sqlite3_xauth = uintptr /* sqlite3.c:17058:15 */

typedef for the authorization callback function.

type Sqlite3rbu

type Sqlite3rbu = sqlite3rbu /* sqlite3.c:199829:27 */

type Sqlite_int64

type Sqlite_int64 = int64 /* sqlite3.c:1360:25 */

CAPI3REF: 64-Bit Integer Types KEYWORDS: sqlite_int64 sqlite_uint64

Because there is no cross-platform way to specify 64-bit integer types SQLite includes typedefs for 64-bit signed and unsigned integers.

The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions. The sqlite_int64 and sqlite_uint64 types are supported for backwards compatibility only.

^The sqlite3_int64 and sqlite_int64 types can store integer values between -9223372036854775808 and +9223372036854775807 inclusive. ^The sqlite3_uint64 and sqlite_uint64 types can store integer values between 0 and +18446744073709551615 inclusive.

func Xsqlite3_column_int64

func Xsqlite3_column_int64(tls *libc.TLS, pStmt uintptr, i int32) Sqlite_int64

func Xsqlite3_last_insert_rowid

func Xsqlite3_last_insert_rowid(tls *libc.TLS, db uintptr) Sqlite_int64

Return the ROWID of the most recent insert

func Xsqlite3_value_int64

func Xsqlite3_value_int64(tls *libc.TLS, pVal uintptr) Sqlite_int64

type Sqlite_uint64

type Sqlite_uint64 = uint64 /* sqlite3.c:1361:34 */

type SrcCount

type SrcCount = struct {
	FpSrc      uintptr
	FiSrcInner int32
	FnThis     int32
	FnOther    int32
	// contains filtered or unexported fields

} /* sqlite3.c:19454:5 */

Context pointer passed down through the tree-walk.

type SrcItem

type SrcItem = SrcItem1 /* sqlite3.c:14921:24 */

type SrcItem1

type SrcItem1 = struct {
	FpSchema     uintptr
	FzDatabase   uintptr
	FzName       uintptr
	FzAlias      uintptr
	FpTab        uintptr
	FpSelect     uintptr
	FaddrFillSub int32
	FregReturn   int32
	FregResult   int32
	Ffg          struct {
		Fjointype U8

		FnotIndexed uint16 /* unsigned notIndexed: 1, unsigned isIndexedBy: 1, unsigned isTabFunc: 1, unsigned isCorrelated: 1, unsigned viaCoroutine: 1, unsigned isRecursive: 1, unsigned fromDDL: 1, unsigned isCte: 1, unsigned notCte: 1 */
		// contains filtered or unexported fields
	}
	FiCursor int32
	FpOn     uintptr
	FpUsing  uintptr
	FcolUsed Bitmask
	Fu1      struct{ FzIndexedBy uintptr }
	Fu2      struct{ FpIBIndex uintptr }

} /* sqlite3.c:1331:9 */

type SrcList

type SrcList = SrcList1 /* sqlite3.c:14922:24 */

type SrcList1

type SrcList1 = struct {
	FnSrc   int32
	FnAlloc U32
	Fa      [1]SrcItem

} /* sqlite3.c:1331:9 */

type Ssize_t

type Ssize_t = X__ssize_t /* stdio.h:77:19 */

type StatAccum

type StatAccum = StatAccum1 /* sqlite3.c:109861:26 */

Three SQL functions - stat_init(), stat_push(), and stat_get() - share an instance of the following structure to hold their state information.

type StatAccum1

type StatAccum1 = struct {
	Fdb         uintptr
	FnEst       TRowcnt
	FnRow       TRowcnt
	FnLimit     int32
	FnCol       int32
	FnKeyCol    int32
	FnSkipAhead U8

	Fcurrent  StatSample
	FnPSample TRowcnt
	FmxSample int32
	FiPrn     U32

	FaBest      uintptr
	FiMin       int32
	FnSample    int32
	FnMaxEqZero int32
	FiGet       int32
	Fa          uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:109861:9 */

Three SQL functions - stat_init(), stat_push(), and stat_get() - share an instance of the following structure to hold their state information.

type StatCell

type StatCell = StatCell1 /* sqlite3.c:205448:25 */

type StatCell1

type StatCell1 = struct {
	FnLocal   int32
	FiChildPg U32
	FnOvfl    int32

	FaOvfl     uintptr
	FnLastOvfl int32
	FiOvfl     int32
	// contains filtered or unexported fields

} /* sqlite3.c:205446:9 */

type StatCursor

type StatCursor = StatCursor1 /* sqlite3.c:205446:27 */

type StatCursor1

type StatCursor1 = struct {
	Fbase  Sqlite3_vtab_cursor
	FpStmt uintptr
	FisEof U8
	FisAgg U8

	FiDb        int32
	FaPage      [32]StatPage
	FiPage      int32
	FiPageno    U32
	FzName      uintptr
	FzPath      uintptr
	FzPagetype  uintptr
	FnPage      int32
	FnCell      int32
	FnMxPayload int32

	FnUnused  I64
	FnPayload I64
	FiOffset  I64
	FszPage   I64
	// contains filtered or unexported fields

} /* sqlite3.c:205446:9 */

type StatPage

type StatPage = StatPage1 /* sqlite3.c:205447:25 */

type StatPage1

type StatPage1 = struct {
	FiPgno U32

	FpPg   uintptr
	FiCell int32

	FzPath uintptr
	Fflags U8

	FnCell   int32
	FnUnused int32

	FaCell         uintptr
	FiRightChildPg U32
	FnMxPayload    int32
	// contains filtered or unexported fields

} /* sqlite3.c:205446:9 */

type StatSample

type StatSample = StatSample1 /* sqlite3.c:109862:27 */

type StatSample1

type StatSample1 = struct {
	FanEq      uintptr
	FanDLt     uintptr
	FanLt      uintptr
	Fu         struct{ FiRowid I64 }
	FnRowid    U32
	FisPSample U8

	FiCol  int32
	FiHash U32
	// contains filtered or unexported fields

} /* sqlite3.c:109861:9 */

type StatTable

type StatTable = StatTable1 /* sqlite3.c:205445:26 */

Forward reference to data structured used in this module

type StatTable1

type StatTable1 = struct {
	Fbase Sqlite3_vtab
	Fdb   uintptr
	FiDb  int32
	// contains filtered or unexported fields

} /* sqlite3.c:205445:9 */

Forward reference to data structured used in this module

type Stmt_cursor

type Stmt_cursor = stmt_cursor /* sqlite3.c:235254:28 */

stmt_cursor is a subclass of sqlite3_vtab_cursor which will serve as the underlying representation of a cursor that scans over rows of the result

type Stmt_vtab

type Stmt_vtab = stmt_vtab /* sqlite3.c:235244:26 */

stmt_vtab is a subclass of sqlite3_vtab which will serve as the underlying representation of a stmt virtual table

type StrAccum

type StrAccum = sqlite3_str /* sqlite3.c:14923:28 */ // Internal alias for sqlite3_str

type SubProgram

type SubProgram = SubProgram1 /* sqlite3.c:15675:27 */

type SubProgram1

type SubProgram1 = struct {
	FaOp  uintptr
	FnOp  int32
	FnMem int32
	FnCsr int32

	FaOnce uintptr
	Ftoken uintptr
	FpNext uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Sublist

type Sublist = struct {
	FnList int32

	FaList uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:61957:3 */

type SubstContext

type SubstContext = SubstContext1 /* sqlite3.c:135649:3 */

An instance of the SubstContext object describes an substitution edit to be performed on a parse tree.

All references to columns in table iTable are to be replaced by corresponding expressions in pEList.

type SubstContext1

type SubstContext1 = struct {
	FpParse     uintptr
	FiTable     int32
	FiNewTable  int32
	FisLeftJoin int32

	FpEList uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:135643:9 */

An instance of the SubstContext object describes an substitution edit to be performed on a parse tree.

All references to columns in table iTable are to be replaced by corresponding expressions in pEList.

type SumCtx

type SumCtx = SumCtx1 /* sqlite3.c:120823:23 */

An instance of the following structure holds the context of a sum() or avg() aggregate computation.

type SumCtx1

type SumCtx1 = struct {
	FrSum     float64
	FiSum     I64
	Fcnt      I64
	Foverflow U8
	Fapprox   U8
	// contains filtered or unexported fields

} /* sqlite3.c:120823:9 */

An instance of the following structure holds the context of a sum() or avg() aggregate computation.

type Suseconds_t

type Suseconds_t = X__suseconds_t /* types.h:138:23 */

type TRowcnt

type TRowcnt = U32 /* sqlite3.c:14567:14 */ // 32-bit is the default

The datatype used to store estimates of the number of rows in a table or index. This is an unsigned integer type. For 99.9% of the world, a 32-bit integer is sufficient. But a 64-bit integer can be used at compile-time if desired.

type TabResult

type TabResult = TabResult1 /* sqlite3.c:139506:3 */

This structure is used to pass data from sqlite3_get_table() through to the callback function is uses to build the result.

type TabResult1

type TabResult1 = struct {
	FazResult uintptr
	FzErrMsg  uintptr
	FnAlloc   U32
	FnRow     U32
	FnColumn  U32
	FnData    U32
	Frc       int32
	// contains filtered or unexported fields

} /* sqlite3.c:139498:9 */

This structure is used to pass data from sqlite3_get_table() through to the callback function is uses to build the result.

type Table

type Table = Table1 /* sqlite3.c:14924:22 */

Internal alias for sqlite3_str

type Table1

type Table1 = struct {
	FzName      uintptr
	FaCol       uintptr
	FpIndex     uintptr
	FpSelect    uintptr
	FpFKey      uintptr
	FzColAff    uintptr
	FpCheck     uintptr
	Ftnum       Pgno
	FnTabRef    U32
	FtabFlags   U32
	FiPKey      I16
	FnCol       I16
	FnNVCol     I16
	FnRowLogEst LogEst
	FszTabRow   LogEst
	FkeyConf    U8

	FaddColOffset int32
	FnModuleArg   int32
	FazModuleArg  uintptr
	FpVTable      uintptr
	FpTrigger     uintptr
	FpSchema      uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type TableEntry

type TableEntry = struct {
	FiCode  uint16
	Fflags  uint8
	FnRange uint8

} /* sqlite3.c:233429:16 */

Each entry in the following array defines a rule for folding a range of codepoints to lower case. The rule applies to a range of nRange codepoints starting at codepoint iCode.

If the least significant bit in flags is clear, then the rule applies to all nRange codepoints (i.e. all nRange codepoints are upper case and need to be folded). Or, if it is set, then the rule only applies to every second codepoint in the range, starting with codepoint C.

The 7 most significant bits in flags are an index into the aiOff[] array. If a specific codepoint C does require folding, then its lower case equivalent is ((C + aiOff[flags>>1]) & 0xFFFF).

The contents of this array are generated by parsing the CaseFolding.txt file distributed as part of the "Unicode Character Database". See http://www.unicode.org for details.

type TableLock

type TableLock = TableLock1 /* sqlite3.c:14925:26 */

type TableLock1

type TableLock1 = struct {
	FiDb         int32
	FiTab        Pgno
	FisWriteLock U8

	FzLockName uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Time_t

type Time_t = X__time_t /* time_t.h:7:18 */

Returned by `time'.

type Timer_t

type Timer_t = X__timer_t /* timer_t.h:7:19 */

Timer ID returned by `timer_create'.

type Token

type Token = Token1 /* sqlite3.c:14926:22 */

type Token1

type Token1 = struct {
	Fz uintptr
	Fn uint32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type TokenCtx

type TokenCtx = TokenCtx1 /* sqlite3.c:219078:25 */

type TokenCtx1

type TokenCtx1 = struct {
	FpPhrase uintptr
	Frc      int32
	// contains filtered or unexported fields

} /* sqlite3.c:219078:9 */

type TrigEvent

type TrigEvent = struct {
	Fa int32

	Fb uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:158068:1 */

An instance of the following structure describes the event of a TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, TK_DELETE, or TK_INSTEAD. If the event is of the form

UPDATE ON (a,b,c)

Then the "b" IdList records the list "a,b,c".

type Trigger

type Trigger = Trigger1 /* sqlite3.c:14928:24 */

type Trigger1

type Trigger1 = struct {
	FzName      uintptr
	Ftable      uintptr
	Fop         U8
	Ftr_tm      U8
	FbReturning U8

	FpWhen      uintptr
	FpColumns   uintptr
	FpSchema    uintptr
	FpTabSchema uintptr
	Fstep_list  uintptr
	FpNext      uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type TriggerPrg

type TriggerPrg = TriggerPrg1 /* sqlite3.c:14929:27 */

type TriggerPrg1

type TriggerPrg1 = struct {
	FpTrigger uintptr
	FpNext    uintptr
	FpProgram uintptr
	Forconf   int32
	FaColmask [2]U32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type TriggerStep

type TriggerStep = TriggerStep1 /* sqlite3.c:14930:28 */

type TriggerStep1

type TriggerStep1 = struct {
	Fop     U8
	Forconf U8

	FpTrig     uintptr
	FpSelect   uintptr
	FzTarget   uintptr
	FpFrom     uintptr
	FpWhere    uintptr
	FpExprList uintptr
	FpIdList   uintptr
	FpUpsert   uintptr
	FzSpan     uintptr
	FpNext     uintptr
	FpLast     uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type TrigramTokenizer

type TrigramTokenizer = TrigramTokenizer1 /* sqlite3.c:233142:33 */

*************************************************************************

Start of trigram implementation.

type TrigramTokenizer1

type TrigramTokenizer1 = struct{ FbFold int32 } /* sqlite3.c:233142:9 */

*************************************************************************

Start of trigram implementation.

type U16

type U16 = uint16 /* sqlite3.c:14545:21 */ // 2-byte unsigned integer

type U32

type U32 = uint32 /* sqlite3.c:14544:21 */ // 4-byte unsigned integer
var Xsqlite3SelectTrace U32 = U32(0) /* sqlite3.c:21128:20 */

Tracing flags set by SQLITE_TESTCTRL_TRACEFLAGS.

var Xsqlite3WhereTrace U32 = U32(0) /* sqlite3.c:21129:20 */

func Xsqlite3BitvecSize

func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32

Return the value of the iSize parameter specified when Bitvec *p was created.

func Xsqlite3BtreePayloadSize

func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32

Return the number of bytes of payload for the entry that pCur is currently pointing to. For table btrees, this will be the amount of data. For index btrees, this will be the size of the key.

The caller must guarantee that the cursor is pointing to a non-NULL valid entry. In other words, the calling procedure must guarantee that the cursor has Cursor.eState==CURSOR_VALID.

func Xsqlite3ExprListFlags

func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32

Return the bitwise-OR of all Expr.flags fields in the given ExprList.

func Xsqlite3FkOldmask

func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32

This function is called before generating code to update or delete a row contained in table pTab.

func Xsqlite3Get4byte

func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32

Read or write a four-byte big-endian integer value.

func Xsqlite3IsTrueOrFalse

func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32

Check the input string to see if it is "true" or "false" (in any case).

If the string is....           Return
  "true"                         EP_IsTrue
  "false"                        EP_IsFalse
  anything else                  0

func Xsqlite3PagerDataVersion

func Xsqlite3PagerDataVersion(tls *libc.TLS, pPager uintptr) U32

Return the pPager->iDataVersion value

func Xsqlite3TriggerColmask

func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pChanges uintptr, isNew int32, tr_tm int32, pTab uintptr, orconf int32) U32

Triggers may access values stored in the old.* or new.* pseudo-table. This function returns a 32-bit bitmask indicating which columns of the old.* or new.* tables actually are used by triggers. This information may be used by the caller, for example, to avoid having to load the entire old.* record into memory when executing an UPDATE or DELETE command.

Bit 0 of the returned mask is set if the left-most column of the table may be accessed using an [old|new].<col> reference. Bit 1 is set if the second leftmost column value is required, and so on. If there are more than 32 columns in the table, and at least one of the columns with an index greater than 32 may be accessed, 0xffffffff is returned.

It is not possible to determine if the old.rowid or new.rowid column is accessed by triggers. The caller must always assume that it is.

Parameter isNew must be either 1 or 0. If it is 0, then the mask returned applies to the old.* table. If 1, the new.* table.

Parameter tr_tm must be a mask with one or both of the TRIGGER_BEFORE and TRIGGER_AFTER bits set. Values accessed by BEFORE triggers are only included in the returned mask if the TRIGGER_BEFORE bit is set in the tr_tm parameter. Similarly, values accessed by AFTER triggers are only included in the returned mask if the TRIGGER_AFTER bit is set in tr_tm.

func Xsqlite3Utf8Read

func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32

Translate a single UTF-8 character. Return the unicode value.

During translation, assume that the byte that zTerm points is a 0x00.

Write a pointer to the next unread byte back into *pzNext.

Notes On Invalid UTF-8:

  • This routine never allows a 7-bit character (0x00 through 0x7f) to be encoded as a multi-byte character. Any multi-byte character that attempts to encode a value between 0x00 and 0x7f is rendered as 0xfffd.

  • This routine never allows a UTF16 surrogate value to be encoded. If a multi-byte character attempts to encode a value between 0xd800 and 0xe000 then it is rendered as 0xfffd.

  • Bytes in the range of 0x80 through 0xbf which occur as the first byte of a character are interpreted as single-byte characters and rendered as themselves even though they are technically invalid characters.

  • This routine accepts over-length UTF8 encodings for unicode values 0x80 and greater. It does not change over-length encodings to 0xfffd as some systems recommend.

func Xsqlite3VdbeSerialGet

func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32

func Xsqlite3VdbeSerialPut

func Xsqlite3VdbeSerialPut(tls *libc.TLS, buf uintptr, pMem uintptr, serial_type U32) U32

Write the serialized data blob for the value stored in pMem into buf. It is assumed that the caller has allocated sufficient space. Return the number of bytes written.

nBuf is the amount of space left in buf[]. The caller is responsible for allocating enough space to buf[] to hold the entire field, exclusive of the pMem->u.nZero bytes for a MEM_Zero value.

Return the number of bytes actually written into buf[]. The number of bytes in the zero-filled tail is included in the return value only if those bytes were zeroed in buf[].

func Xsqlite3VdbeSerialTypeLen

func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32

Return the length of the data corresponding to the supplied serial-type.

type U64

type U64 = Sqlite_uint64 /* sqlite3.c:14543:23 */ // 8-byte unsigned integer

func Xsqlite3LogEstToInt

func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64

Convert a LogEst into an integer.

Note that this routine is only used when one or more of various non-standard compile-time options is enabled.

type U8

type U8 = uint8 /* sqlite3.c:14547:20 */ // 1-byte unsigned integer

func Xsqlite3GetBoolean

func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8

Interpret the given string as a boolean value.

func Xsqlite3GetVarint

func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8

Read a 64-bit variable-length integer from memory starting at p[0]. Return the number of bytes read. The value is stored in *v.

func Xsqlite3GetVarint32

func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8

Read a 32-bit variable-length integer from memory starting at p[0]. Return the number of bytes read. The value is stored in *v.

If the varint stored in p[0] is larger than can fit in a 32-bit unsigned integer, then set *v to 0xffffffff.

A MACRO version, getVarint32, is provided which inlines the single-byte case. All code should use the MACRO version as this function assumes the single-byte case has already been handled.

func Xsqlite3HexToInt

func Xsqlite3HexToInt(tls *libc.TLS, h int32) U8

Translate a single byte of Hex into an integer. This routine only works if h really is a valid hexadecimal character: 0..9a..fA..F

func Xsqlite3PagerIsreadonly

func Xsqlite3PagerIsreadonly(tls *libc.TLS, pPager uintptr) U8

Return TRUE if the database file is opened read-only. Return FALSE if the database is (in theory) writable.

func Xsqlite3StrIHash

func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8

Compute an 8-bit hash on a string that is insensitive to case differences

func Xsqlite3VdbeOneByteSerialTypeLen

func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8

func Xsqlite3VdbePrepareFlags

func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8

Return the SQLITE_PREPARE flags for a Vdbe.

type U_char

type U_char = X__u_char /* types.h:33:18 */

type U_int

type U_int = X__u_int /* types.h:35:17 */

type U_int16_t

type U_int16_t = uint32 /* types.h:178:1 */

type U_int32_t

type U_int32_t = uint32 /* types.h:179:1 */

type U_int64_t

type U_int64_t = uint32 /* types.h:180:1 */

type U_int8_t

type U_int8_t = uint32 /* types.h:177:1 */

type U_long

type U_long = X__u_long /* types.h:36:18 */

type U_quad_t

type U_quad_t = X__u_quad_t /* types.h:38:20 */

type U_short

type U_short = X__u_short /* types.h:34:19 */

type Uid_t

type Uid_t = X__uid_t /* types.h:79:17 */

type Uint

type Uint = uint32 /* types.h:150:22 */

type Ulong

type Ulong = uint64 /* types.h:148:27 */

Old compatibility names for C types.

type Unicode61Tokenizer

type Unicode61Tokenizer = Unicode61Tokenizer1 /* sqlite3.c:232110:35 */

type Unicode61Tokenizer1

type Unicode61Tokenizer1 = struct {
	FaTokenChar       [128]uint8
	FaFold            uintptr
	FnFold            int32
	FeRemoveDiacritic int32
	FnException       int32

	FaiException uintptr
	FaCategory   [32]uint8
	// contains filtered or unexported fields

} /* sqlite3.c:232110:9 */

type UnixFile

type UnixFile = unixFile /* sqlite3.c:34078:25 */

The unixFile structure is subclass of sqlite3_file specific to the unix VFS implementations.

type UnixInodeInfo

type UnixInodeInfo = unixInodeInfo /* sqlite3.c:34059:30 */ // An i-node

Shared memory instance

type UnixShm

type UnixShm = unixShm /* sqlite3.c:34057:24 */ // Connection shared memory

Forward references

type UnixShmNode

type UnixShmNode = unixShmNode /* sqlite3.c:34058:28 */ // Shared memory instance

Connection shared memory

type UnixUnusedFd

type UnixUnusedFd = UnixUnusedFd1 /* sqlite3.c:34060:29 */

An i-node

type UnixUnusedFd1

type UnixUnusedFd1 = struct {
	Ffd    int32
	Fflags int32
	FpNext uintptr

} /* sqlite3.c:34057:9 */

type UnpackedRecord

type UnpackedRecord = UnpackedRecord1 /* sqlite3.c:14931:31 */

type UnpackedRecord1

type UnpackedRecord1 = struct {
	FpKeyInfo   uintptr
	FaMem       uintptr
	FnField     U16
	Fdefault_rc I8
	FerrCode    U8
	Fr1         I8
	Fr2         I8
	FeqSeen     U8
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Upsert

type Upsert = Upsert1 /* sqlite3.c:14932:23 */

type Upsert1

type Upsert1 = struct {
	FpUpsertTarget      uintptr
	FpUpsertTargetWhere uintptr
	FpUpsertSet         uintptr
	FpUpsertWhere       uintptr
	FpNextUpsert        uintptr
	FisDoUpdate         U8

	FpToFree    uintptr
	FpUpsertIdx uintptr
	FpUpsertSrc uintptr
	FregData    int32
	FiDataCur   int32
	FiIdxCur    int32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Uptr

type Uptr = U64 /* sqlite3.c:14617:15 */

The uptr type is an unsigned integer large enough to hold a pointer

type Useconds_t

type Useconds_t = X__useconds_t /* types.h:134:22 */

type Ushort

type Ushort = uint16 /* types.h:149:28 */

type VList

type VList = int32 /* sqlite3.c:14973:13 */

A VList object records a mapping between parameters/variables/wildcards in the SQL statement (such as $abc, @pqr, or :xyz) and the integer variable number associated with that parameter. See the format description on the sqlite3VListAdd() routine for more information. A VList is really just an array of integers.

type VTable

type VTable = VTable1 /* sqlite3.c:14933:23 */

type VTable1

type VTable1 = struct {
	Fdb          uintptr
	FpMod        uintptr
	FpVtab       uintptr
	FnRef        int32
	FbConstraint U8
	FeVtabRisk   U8

	FiSavepoint int32

	FpNext uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Va_list

type Va_list = X__gnuc_va_list /* stdarg.h:99:24 */

The macro _VA_LIST_ is the same thing used by this file in Ultrix.

But on BSD NET2 we must not test or define or undef it.
(Note that the comments in NET 2's ansi.h
are incorrect for _VA_LIST_--see stdio.h!)

The macro _VA_LIST_DEFINED is used in Windows NT 3.5 The macro _VA_LIST is used in SCO Unix 3.2. The macro _VA_LIST_T_H is used in the Bull dpx2 The macro __va_list__ is used by BeOS.

type ValueNewStat4Ctx

type ValueNewStat4Ctx = struct {
	FpParse uintptr
	FpIdx   uintptr
	FppRec  uintptr
	FiVal   int32
	// contains filtered or unexported fields

} /* sqlite3.c:78306:1 */

Context object passed by sqlite3Stat4ProbeSetValue() through to valueNew(). See comments above valueNew() for details.

type Vdbe

type Vdbe = Vdbe1 /* sqlite3.c:15668:21 */

A single VDBE is an opaque structure named "Vdbe". Only routines in the source file sqliteVdbe.c are allowed to see the insides of this structure.

type Vdbe1

type Vdbe1 = struct {
	Fdb     uintptr
	FpPrev  uintptr
	FpNext  uintptr
	FpParse uintptr
	FnVar   YnVar

	FiVdbeMagic U32
	FnMem       int32
	FnCursor    int32
	FcacheCtr   U32
	Fpc         int32
	Frc         int32
	FnChange    int32
	FiStatement int32

	FiCurrentTime       I64
	FnFkConstraint      I64
	FnStmtDefCons       I64
	FnStmtDefImmCons    I64
	FaMem               uintptr
	FapArg              uintptr
	FapCsr              uintptr
	FaVar               uintptr
	FaOp                uintptr
	FnOp                int32
	FnOpAlloc           int32
	FaColName           uintptr
	FpResultSet         uintptr
	FzErrMsg            uintptr
	FpVList             uintptr
	FstartTime          I64
	FnResColumn         U16
	FerrorAction        U8
	FminWriteFileFormat U8
	FprepFlags          U8
	FdoingRerun         U8

	Fexpired uint16 /* bft expired: 2, bft explain: 2, bft changeCntOn: 1, bft runOnlyOnce: 1, bft usesStmtJournal: 1, bft readOnly: 1, bft bIsReader: 1 */

	FbtreeMask YDbMask
	FlockMask  YDbMask
	FaCounter  [7]U32
	FzSql      uintptr
	FpFree     uintptr
	FpFrame    uintptr
	FpDelFrame uintptr
	FnFrame    int32
	Fexpmask   U32
	FpProgram  uintptr
	FpAuxData  uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

A single VDBE is an opaque structure named "Vdbe". Only routines in the source file sqliteVdbe.c are allowed to see the insides of this structure.

type VdbeCursor

type VdbeCursor = VdbeCursor1 /* sqlite3.c:21239:27 */

A VdbeCursor is an superclass (a wrapper) for various cursor objects:

  • A b-tree cursor
  • In the main database or in an ephemeral database
  • On either an index or a table
  • A sorter
  • A virtual table
  • A one-row "pseudotable" stored in a single register

type VdbeCursor1

type VdbeCursor1 = struct {
	FeCurType       U8
	FiDb            I8
	FnullRow        U8
	FdeferredMoveto U8
	FisTable        U8

	FisEphemeral uint8 /* Bool isEphemeral: 1, Bool useRandomRowid: 1, Bool isOrdered: 1, Bool hasBeenDuped: 1 */

	FseekHit U16

	FpBtx        uintptr
	FseqCount    I64
	FaAltMap     uintptr
	FcacheStatus U32
	FseekResult  int32
	FpAltCursor  uintptr
	Fuc          struct{ FpCursor uintptr }
	FpKeyInfo    uintptr
	FiHdrOffset  U32
	FpgnoRoot    Pgno
	FnField      I16
	FnHdrParsed  U16

	FmovetoTarget I64
	FaOffset      uintptr
	FaRow         uintptr
	FpayloadSize  U32
	FszRow        U32
	FaType        [1]U32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

A VdbeCursor is an superclass (a wrapper) for various cursor objects:

  • A b-tree cursor
  • In the main database or in an ephemeral database
  • On either an index or a table
  • A sorter
  • A virtual table
  • A one-row "pseudotable" stored in a single register

type VdbeFrame

type VdbeFrame = VdbeFrame1 /* sqlite3.c:21326:26 */

When a sub-program is executed (OP_Program), a structure of this type is allocated to store the current value of the program counter, as well as the current memory cell array and various other frame specific values stored in the Vdbe struct. When the sub-program is finished, these values are copied back to the Vdbe from the VdbeFrame structure, restoring the state of the VM to as it was before the sub-program began executing.

The memory for a VdbeFrame object is allocated and managed by a memory cell in the parent (calling) frame. When the memory cell is deleted or overwritten, the VdbeFrame object is not freed immediately. Instead, it is linked into the Vdbe.pDelFrame list. The contents of the Vdbe.pDelFrame list is deleted when the VM is reset in VdbeHalt(). The reason for doing this instead of deleting the VdbeFrame immediately is to avoid recursive calls to sqlite3VdbeMemRelease() when the memory cells belonging to the child frame are released.

The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is set to NULL if the currently executing frame is the main program.

type VdbeFrame1

type VdbeFrame1 = struct {
	Fv         uintptr
	FpParent   uintptr
	FaOp       uintptr
	FanExec    uintptr
	FaMem      uintptr
	FapCsr     uintptr
	FaOnce     uintptr
	Ftoken     uintptr
	FlastRowid I64
	FpAuxData  uintptr
	FnCursor   int32
	Fpc        int32
	FnOp       int32
	FnMem      int32
	FnChildMem int32
	FnChildCsr int32
	FnChange   int32
	FnDbChange int32

} /* sqlite3.c:1331:9 */

When a sub-program is executed (OP_Program), a structure of this type is allocated to store the current value of the program counter, as well as the current memory cell array and various other frame specific values stored in the Vdbe struct. When the sub-program is finished, these values are copied back to the Vdbe from the VdbeFrame structure, restoring the state of the VM to as it was before the sub-program began executing.

The memory for a VdbeFrame object is allocated and managed by a memory cell in the parent (calling) frame. When the memory cell is deleted or overwritten, the VdbeFrame object is not freed immediately. Instead, it is linked into the Vdbe.pDelFrame list. The contents of the Vdbe.pDelFrame list is deleted when the VM is reset in VdbeHalt(). The reason for doing this instead of deleting the VdbeFrame immediately is to avoid recursive calls to sqlite3VdbeMemRelease() when the memory cells belonging to the child frame are released.

The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is set to NULL if the currently executing frame is the main program.

type VdbeOp

type VdbeOp = VdbeOp1 /* sqlite3.c:15721:23 */

type VdbeOp1

type VdbeOp1 = struct {
	Fopcode U8
	Fp4type int8
	Fp5     U16
	Fp1     int32
	Fp2     int32
	Fp3     int32
	Fp4     struct {
		Fi int32
		// contains filtered or unexported fields
	}
	FzComment uintptr

} /* sqlite3.c:1331:9 */

A single instruction of the virtual machine has an opcode and as many as three operands. The instruction is recorded as an instance of the following structure:

type VdbeOpList

type VdbeOpList = VdbeOpList1 /* sqlite3.c:15747:27 */

type VdbeOpList1

type VdbeOpList1 = struct {
	Fopcode U8
	Fp1     int8
	Fp2     int8
	Fp3     int8

} /* sqlite3.c:15741:1 */

A smaller version of VdbeOp used for the VdbeAddOpList() function because it takes up less space.

type VdbeSorter

type VdbeSorter = VdbeSorter1 /* sqlite3.c:21218:27 */

Opaque type used by code in vdbesort.c

type VdbeSorter1

type VdbeSorter1 = struct {
	FmnPmaSize   int32
	FmxPmaSize   int32
	FmxKeysize   int32
	Fpgsz        int32
	FpReader     uintptr
	FpMerger     uintptr
	Fdb          uintptr
	FpKeyInfo    uintptr
	FpUnpacked   uintptr
	Flist        SorterList
	FiMemory     int32
	FnMemory     int32
	FbUsePMA     U8
	FbUseThreads U8
	FiPrev       U8
	FnTask       U8
	FtypeMask    U8

	FaTask [1]SortSubtask
	// contains filtered or unexported fields

} /* sqlite3.c:21218:9 */

Opaque type used by code in vdbesort.c

type VtabCtx

type VtabCtx = VtabCtx1 /* sqlite3.c:14934:24 */

type VtabCtx1

type VtabCtx1 = struct {
	FpVTable   uintptr
	FpTab      uintptr
	FpPrior    uintptr
	FbDeclared int32
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type Wal

type Wal = Wal1 /* sqlite3.c:52563:20 */

Connection to a write-ahead log (WAL) file. There is one object of this type for each pager.

type Wal1

type Wal1 = struct {
	FpVfs      uintptr
	FpDbFd     uintptr
	FpWalFd    uintptr
	FiCallback U32

	FmxWalSize           I64
	FnWiData             int32
	FszFirstBlock        int32
	FapWiData            uintptr
	FszPage              U32
	FreadLock            I16
	FsyncFlags           U8
	FexclusiveMode       U8
	FwriteLock           U8
	FckptLock            U8
	FreadOnly            U8
	FtruncateOnCommit    U8
	FsyncHeader          U8
	FpadToSectorBoundary U8
	FbShmUnreliable      U8

	Fhdr      WalIndexHdr
	FminFrame U32
	FiReCksum U32
	FzWalName uintptr
	FnCkpt    U32

	FpSnapshot uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

Connection to a write-ahead log (WAL) file. There is one object of this type for each pager.

type WalCkptInfo

type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:60657:28 */

type WalCkptInfo1

type WalCkptInfo1 = struct {
	FnBackfill          U32
	FaReadMark          [5]U32
	FaLock              [8]U8
	FnBackfillAttempted U32
	FnotUsed0           U32

} /* sqlite3.c:60657:9 */

type WalHashLoc

type WalHashLoc = WalHashLoc1 /* sqlite3.c:61267:27 */

An instance of the WalHashLoc object is used to describe the location of a page hash table in the wal-index. This becomes the return value from walHashGet().

type WalHashLoc1

type WalHashLoc1 = struct {
	FaHash uintptr
	FaPgno uintptr
	FiZero U32
	// contains filtered or unexported fields

} /* sqlite3.c:61267:9 */

An instance of the WalHashLoc object is used to describe the location of a page hash table in the wal-index. This becomes the return value from walHashGet().

type WalIndexHdr

type WalIndexHdr = WalIndexHdr1 /* sqlite3.c:60655:28 */

Object declarations

type WalIndexHdr1

type WalIndexHdr1 = struct {
	FiVersion    U32
	Funused      U32
	FiChange     U32
	FisInit      U8
	FbigEndCksum U8
	FszPage      U16
	FmxFrame     U32
	FnPage       U32
	FaFrameCksum [2]U32
	FaSalt       [2]U32
	FaCksum      [2]U32

} /* sqlite3.c:1331:9 */

Object declarations

type WalIterator

type WalIterator = WalIterator1 /* sqlite3.c:60656:28 */

type WalIterator1

type WalIterator1 = struct {
	FiPrior   U32
	FnSegment int32
	FaSegment [1]struct {
		FiNext int32

		FaIndex uintptr
		FaPgno  uintptr
		FnEntry int32
		FiZero  int32
		// contains filtered or unexported fields
	}

} /* sqlite3.c:60656:9 */

type WalSegment

type WalSegment = struct {
	FiNext int32

	FaIndex uintptr
	FaPgno  uintptr
	FnEntry int32
	FiZero  int32
	// contains filtered or unexported fields

} /* sqlite3.c:60656:9 */

This structure is used to implement an iterator that loops through all frames in the WAL in database page order. Where two or more frames correspond to the same database page, the iterator visits only the frame most recently written to the WAL (in other words, the frame with the largest index).

The internals of this structure are only accessed by:

walIteratorInit() - Create a new iterator,
walIteratorNext() - Step an iterator,
walIteratorFree() - Free an iterator.

This functionality is used by the checkpoint code (see walCheckpoint()).

type WalWriter

type WalWriter = WalWriter1 /* sqlite3.c:63743:3 */

Information about the current state of the WAL file and where the next fsync should occur - passed from sqlite3WalFrames() into walWriteToLog().

type WalWriter1

type WalWriter1 = struct {
	FpWal       uintptr
	FpFd        uintptr
	FiSyncPoint Sqlite3_int64
	FsyncFlags  int32
	FszPage     int32

} /* sqlite3.c:63737:9 */

Information about the current state of the WAL file and where the next fsync should occur - passed from sqlite3WalFrames() into walWriteToLog().

type Walker

type Walker = Walker1 /* sqlite3.c:14935:23 */

type Walker1

type Walker1 = struct {
	FpParse           uintptr
	FxExprCallback    uintptr
	FxSelectCallback  uintptr
	FxSelectCallback2 uintptr
	FwalkerDepth      int32
	FeCode            U16

	Fu struct{ FpNC uintptr }
	// contains filtered or unexported fields

} /* sqlite3.c:14893:9 */

type Wchar_t

type Wchar_t = int32 /* <builtin>:15:24 */

type WhereAndInfo

type WhereAndInfo = WhereAndInfo1 /* sqlite3.c:144520:29 */

type WhereAndInfo1

type WhereAndInfo1 = struct{ Fwc WhereClause } /* sqlite3.c:144520:9 */

type WhereClause

type WhereClause = WhereClause1 /* sqlite3.c:144517:28 */

Forward references

type WhereClause1

type WhereClause1 = struct {
	FpWInfo uintptr
	FpOuter uintptr
	Fop     U8
	FhasOr  U8

	FnTerm int32
	FnSlot int32

	Fa       uintptr
	FaStatic [8]WhereTerm
	// contains filtered or unexported fields

} /* sqlite3.c:14936:9 */

Forward references

type WhereConst

type WhereConst = WhereConst1 /* sqlite3.c:136486:27 */

A structure to keep track of all of the column values that are fixed to a known value due to WHERE clause constraints of the form COLUMN=VALUE.

type WhereConst1

type WhereConst1 = struct {
	FpParse      uintptr
	FpOomFault   uintptr
	FnConst      int32
	FnChng       int32
	FbHasAffBlob int32

	FapExpr uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:19462:5 */

Context pointer passed down through the tree-walk.

type WhereExprMod

type WhereExprMod = WhereExprMod1 /* sqlite3.c:144931:29 */

Each instance of this object records a change to a single node in an expression tree to cause that node to point to a column of an index rather than an expression or a virtual column. All such transformations need to be undone at the end of WHERE clause processing.

type WhereExprMod1

type WhereExprMod1 = struct {
	FpNext uintptr
	FpExpr uintptr
	Forig  Expr

} /* sqlite3.c:14936:9 */

Each instance of this object records a change to a single node in an expression tree to cause that node to point to a column of an index rather than an expression or a virtual column. All such transformations need to be undone at the end of WHERE clause processing.

type WhereInfo

type WhereInfo = WhereInfo1 /* sqlite3.c:14936:26 */

type WhereInfo1

type WhereInfo1 = struct {
	FpParse          uintptr
	FpTabList        uintptr
	FpOrderBy        uintptr
	FpResultSet      uintptr
	FpWhere          uintptr
	FaiCurOnePass    [2]int32
	FiContinue       int32
	FiBreak          int32
	FsavedNQueryLoop int32
	FwctrlFlags      U16
	FiLimit          LogEst
	FnLevel          U8
	FnOBSat          I8
	FeOnePass        U8
	FeDistinct       U8
	FbDeferredSeek   uint8 /* unsigned bDeferredSeek: 1, unsigned untestedTerms: 1, unsigned bOrderedInnerLoop: 1, unsigned sorted: 1 */

	FnRowOut   LogEst
	FiTop      int32
	FiEndWhere int32
	FpLoops    uintptr
	FpExprMods uintptr
	FrevMask   Bitmask
	FsWC       WhereClause
	FsMaskSet  WhereMaskSet
	Fa         [1]WhereLevel
	// contains filtered or unexported fields

} /* sqlite3.c:14936:9 */

type WhereLevel

type WhereLevel = WhereLevel1 /* sqlite3.c:144521:27 */

type WhereLevel1

type WhereLevel1 = struct {
	FiLeftJoin   int32
	FiTabCur     int32
	FiIdxCur     int32
	FaddrBrk     int32
	FaddrNxt     int32
	FaddrSkip    int32
	FaddrCont    int32
	FaddrFirst   int32
	FaddrBody    int32
	FregBignull  int32
	FaddrBignull int32
	FiFrom       U8
	Fop          U8
	Fp3          U8
	Fp5          U8
	Fp1          int32
	Fp2          int32
	Fu           struct {
		Fin struct {
			FnIn int32

			FaInLoop uintptr
			// contains filtered or unexported fields
		}
	}
	FpWLoop   uintptr
	FnotReady Bitmask

} /* sqlite3.c:14936:9 */

type WhereLoop

type WhereLoop = WhereLoop1 /* sqlite3.c:144522:26 */

type WhereLoop1

type WhereLoop1 = struct {
	Fprereq   Bitmask
	FmaskSelf Bitmask
	FiTab     U8
	FiSortIdx U8
	FrSetup   LogEst
	FrRun     LogEst
	FnOut     LogEst
	Fu        struct {
		Fbtree struct {
			FnEq          U16
			FnBtm         U16
			FnTop         U16
			FnDistinctCol U16
			FpIndex       uintptr
		}
	}
	FwsFlags U32
	FnLTerm  U16
	FnSkip   U16
	FnLSlot  U16

	FaLTerm      uintptr
	FpNextLoop   uintptr
	FaLTermSpace [3]uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:14936:9 */

type WhereLoopBuilder

type WhereLoopBuilder = WhereLoopBuilder1 /* sqlite3.c:144525:33 */

type WhereLoopBuilder1

type WhereLoopBuilder1 = struct {
	FpWInfo    uintptr
	FpWC       uintptr
	FpOrderBy  uintptr
	FpNew      uintptr
	FpOrSet    uintptr
	FpRec      uintptr
	FnRecValid int32
	FbldFlags1 uint8
	FbldFlags2 uint8

	FiPlanLimit uint32
	// contains filtered or unexported fields

} /* sqlite3.c:144525:9 */

type WhereMaskSet

type WhereMaskSet = WhereMaskSet1 /* sqlite3.c:144518:29 */

type WhereMaskSet1

type WhereMaskSet1 = struct {
	FbVarSelect int32
	Fn          int32
	Fix         [64]int32

} /* sqlite3.c:14936:9 */

type WhereOrCost

type WhereOrCost = WhereOrCost1 /* sqlite3.c:144527:28 */

type WhereOrCost1

type WhereOrCost1 = struct {
	Fprereq Bitmask
	FrRun   LogEst
	FnOut   LogEst
	// contains filtered or unexported fields

} /* sqlite3.c:144525:9 */

type WhereOrInfo

type WhereOrInfo = WhereOrInfo1 /* sqlite3.c:144519:28 */

type WhereOrInfo1

type WhereOrInfo1 = struct {
	Fwc        WhereClause
	Findexable Bitmask

} /* sqlite3.c:144519:9 */

type WhereOrSet

type WhereOrSet = WhereOrSet1 /* sqlite3.c:144528:27 */

type WhereOrSet1

type WhereOrSet1 = struct {
	Fn U16

	Fa [3]WhereOrCost
	// contains filtered or unexported fields

} /* sqlite3.c:144525:9 */

type WherePath

type WherePath = WherePath1 /* sqlite3.c:144523:26 */

type WherePath1

type WherePath1 = struct {
	FmaskLoop  Bitmask
	FrevLoop   Bitmask
	FnRow      LogEst
	FrCost     LogEst
	FrUnsorted LogEst
	FisOrdered I8

	FaLoop uintptr
	// contains filtered or unexported fields

} /* sqlite3.c:144523:9 */

type WhereScan

type WhereScan = WhereScan1 /* sqlite3.c:144526:26 */

type WhereScan1

type WhereScan1 = struct {
	FpOrigWC   uintptr
	FpWC       uintptr
	FzCollName uintptr
	FpIdxExpr  uintptr
	Fidxaff    int8
	FnEquiv    uint8
	FiEquiv    uint8

	FopMask   U32
	Fk        int32
	FaiCur    [11]int32
	FaiColumn [11]I16
	// contains filtered or unexported fields

} /* sqlite3.c:144526:9 */

type WhereTerm

type WhereTerm = WhereTerm1 /* sqlite3.c:144524:26 */

type WhereTerm1

type WhereTerm1 = struct {
	FpExpr      uintptr
	FpWC        uintptr
	FtruthProb  LogEst
	FwtFlags    U16
	FeOperator  U16
	FnChild     U8
	FeMatchOp   U8
	FiParent    int32
	FleftCursor int32
	Fu          struct {
		Fx struct {
			FleftColumn int32
			FiField     int32
		}
		// contains filtered or unexported fields
	}
	FprereqRight Bitmask
	FprereqAll   Bitmask

} /* sqlite3.c:14936:9 */

type Window

type Window = Window1 /* sqlite3.c:14937:23 */

type Window1

type Window1 = struct {
	FzName          uintptr
	FzBase          uintptr
	FpPartition     uintptr
	FpOrderBy       uintptr
	FeFrmType       U8
	FeStart         U8
	FeEnd           U8
	FbImplicitFrame U8
	FeExclude       U8

	FpStart        uintptr
	FpEnd          uintptr
	FppThis        uintptr
	FpNextWin      uintptr
	FpFilter       uintptr
	FpFunc         uintptr
	FiEphCsr       int32
	FregAccum      int32
	FregResult     int32
	FcsrApp        int32
	FregApp        int32
	FregPart       int32
	FpOwner        uintptr
	FnBufferCol    int32
	FiArgCol       int32
	FregOne        int32
	FregStartRowid int32
	FregEndRowid   int32
	FbExprArgs     U8
	// contains filtered or unexported fields

} /* sqlite3.c:1331:9 */

type WindowCodeArg

type WindowCodeArg = WindowCodeArg1 /* sqlite3.c:156423:30 */

type WindowCodeArg1

type WindowCodeArg1 = struct {
	FpParse    uintptr
	FpMWin     uintptr
	FpVdbe     uintptr
	FaddrGosub int32
	FregGosub  int32
	FregArg    int32
	FeDelete   int32
	FregRowid  int32
	Fstart     WindowCsrAndReg
	Fcurrent   WindowCsrAndReg
	Fend       WindowCsrAndReg
	// contains filtered or unexported fields

} /* sqlite3.c:156423:9 */

type WindowCsrAndReg

type WindowCsrAndReg = WindowCsrAndReg1 /* sqlite3.c:156424:32 */

type WindowCsrAndReg1

type WindowCsrAndReg1 = struct {
	Fcsr int32
	Freg int32

} /* sqlite3.c:156423:9 */

type WindowRewrite

type WindowRewrite = WindowRewrite1 /* sqlite3.c:155645:30 */

Context object passed through sqlite3WalkExprList() to selectWindowRewriteExprCb() by selectWindowRewriteEList().

type WindowRewrite1

type WindowRewrite1 = struct {
	FpWin       uintptr
	FpSrc       uintptr
	FpSub       uintptr
	FpTab       uintptr
	FpSubSelect uintptr

} /* sqlite3.c:19461:5 */

Context pointer passed down through the tree-walk.

type WindowUpdate

type WindowUpdate = struct {
	FzFunc    uintptr
	FeFrmType int32
	FeStart   int32
	FeEnd     int32
	// contains filtered or unexported fields

} /* sqlite3.c:155605:7 */

type With

type With = With1 /* sqlite3.c:14938:21 */

type With1

type With1 = struct {
	FnCte   int32
	FbView  int32
	FpOuter uintptr
	Fa      [1]Cte

} /* sqlite3.c:1331:9 */

type X__FILE

type X__FILE = _IO_FILE /* __FILE.h:5:25 */

type X__blkcnt64_t

type X__blkcnt64_t = int64 /* types.h:178:30 */

type X__blkcnt_t

type X__blkcnt_t = int64 /* types.h:177:28 */

Type to count number of disk blocks.

type X__blksize_t

type X__blksize_t = int64 /* types.h:172:29 */

Type to represent block size.

type X__builtin_va_list

type X__builtin_va_list = uintptr /* <builtin>:46:14 */

type X__caddr_t

type X__caddr_t = uintptr /* types.h:201:14 */

type X__clock_t

type X__clock_t = int64 /* types.h:154:27 */ // Type of CPU usage counts.

type X__clockid_t

type X__clockid_t = int32 /* types.h:166:29 */

Clock ID used in clock and timer functions.

type X__compar_d_fn_t

type X__compar_d_fn_t = uintptr /* stdlib.h:812:13 */

type X__compar_fn_t

type X__compar_fn_t = uintptr /* stdlib.h:805:13 */

Shorthand for type of comparison functions.

type X__cpu_mask

type X__cpu_mask = uint64 /* cpu-set.h:32:25 */

Type for array elements in 'cpu_set_t'.

type X__daddr_t

type X__daddr_t = int32 /* types.h:162:27 */ // The type of a disk address.

type X__dev_t

type X__dev_t = uint64 /* types.h:143:25 */ // Type of device numbers.

type X__fd_mask

type X__fd_mask = int64 /* select.h:49:18 */

The fd_set member is required to be an array of longs.

type X__float128

type X__float128 = float64 /* <builtin>:47:21 */

type X__fpos64_t

type X__fpos64_t = _G_fpos64_t /* __fpos64_t.h:14:3 */

The tag name of this struct is _G_fpos64_t to preserve historic

C++ mangled names for functions taking fpos_t and/or fpos64_t
arguments.  That name should not be used in new code.

type X__fpos_t

type X__fpos_t = _G_fpos_t /* __fpos_t.h:14:3 */

The tag name of this struct is _G_fpos_t to preserve historic

C++ mangled names for functions taking fpos_t arguments.
That name should not be used in new code.

type X__fsblkcnt64_t

type X__fsblkcnt64_t = uint64 /* types.h:182:32 */

type X__fsblkcnt_t

type X__fsblkcnt_t = uint64 /* types.h:181:30 */

Type to count file system blocks.

type X__fsfilcnt64_t

type X__fsfilcnt64_t = uint64 /* types.h:186:32 */

type X__fsfilcnt_t

type X__fsfilcnt_t = uint64 /* types.h:185:30 */

Type to count file system nodes.

type X__fsid_t

type X__fsid_t = struct{ F__val [2]int32 } /* types.h:153:26 */ // Type of file system IDs.

type X__fsword_t

type X__fsword_t = int64 /* types.h:189:28 */

Type of miscellaneous file system fields.

type X__gid_t

type X__gid_t = uint32 /* types.h:145:25 */ // Type of group identifications.

type X__gnuc_va_list

type X__gnuc_va_list = X__builtin_va_list /* stdarg.h:40:27 */

type X__id_t

type X__id_t = uint32 /* types.h:157:24 */ // General type for IDs.

type X__ino64_t

type X__ino64_t = uint64 /* types.h:147:27 */ // Type of file serial numbers (LFS).

type X__ino_t

type X__ino_t = uint64 /* types.h:146:25 */ // Type of file serial numbers.

type X__int128_t

type X__int128_t = struct {
	Flo int64
	Fhi int64

} /* <builtin>:21:43 */ // must match modernc.org/mathutil.Int128

type X__int16_t

type X__int16_t = int16 /* types.h:38:26 */

type X__int32_t

type X__int32_t = int32 /* types.h:40:20 */

type X__int64_t

type X__int64_t = int64 /* types.h:43:25 */

type X__int8_t

type X__int8_t = int8 /* types.h:36:21 */

Fixed-size types, underlying types depend on word size and compiler.

type X__int_least16_t

type X__int_least16_t = X__int16_t /* types.h:53:19 */

type X__int_least32_t

type X__int_least32_t = X__int32_t /* types.h:55:19 */

type X__int_least64_t

type X__int_least64_t = X__int64_t /* types.h:57:19 */

type X__int_least8_t

type X__int_least8_t = X__int8_t /* types.h:51:18 */

Smallest types with at least a given width.

type X__intmax_t

type X__intmax_t = int64 /* types.h:71:18 */

Largest integral types.

type X__intptr_t

type X__intptr_t = int64 /* types.h:204:25 */

Duplicates info from stdint.h but this is used in unistd.h.

type X__itimer_which_t

type X__itimer_which_t = uint32 /* time.h:115:29 */

Use the nicer parameter type only in GNU mode and not for C++ since the

strict C++ rules prevent the automatic promotion.

type X__jmp_buf

type X__jmp_buf = [8]int64 /* setjmp.h:31:18 */

type X__key_t

type X__key_t = int32 /* types.h:163:25 */ // Type of an IPC key.

type X__locale_t

type X__locale_t = uintptr /* __locale_t.h:42:32 */

type X__loff_t

type X__loff_t = X__off64_t /* types.h:200:19 */ // Type of file sizes and offsets (LFS).

These few don't really vary by system, they always correspond

to one of the other defined types.

type X__mbstate_t

type X__mbstate_t = struct {
	F__count int32
	F__value struct{ F__wch uint32 }

} /* __mbstate_t.h:21:3 */

Conversion state information.

type X__mode_t

type X__mode_t = uint32 /* types.h:148:26 */ // Type of file attribute bitmasks.
type X__nlink_t = uint64 /* types.h:149:27 */ // Type of file link counts.

type X__off64_t

type X__off64_t = int64 /* types.h:151:27 */ // Type of file sizes and offsets (LFS).

type X__off_t

type X__off_t = int64 /* types.h:150:25 */ // Type of file sizes and offsets.

type X__pid_t

type X__pid_t = int32 /* types.h:152:25 */ // Type of process identifications.

type X__pthread_list_t

type X__pthread_list_t = __pthread_internal_list /* thread-shared-types.h:86:3 */

type X__pthread_unwind_buf_t

type X__pthread_unwind_buf_t = struct {
	F__cancel_jmp_buf [1]struct {
		F__cancel_jmp_buf X__jmp_buf
		F__mask_was_saved int32
		// contains filtered or unexported fields
	}
	F__pad [4]uintptr

} /* pthread.h:532:3 */

type X__quad_t

type X__quad_t = int64 /* types.h:62:18 */

quad_t is also 64 bits.

type X__rlim64_t

type X__rlim64_t = uint64 /* types.h:156:28 */ // Type for resource measurement (LFS).

type X__rlim_t

type X__rlim_t = uint64 /* types.h:155:26 */ // Type for resource measurement.

type X__sig_atomic_t

type X__sig_atomic_t = int32 /* types.h:212:13 */

C99: An integer type that can be accessed as an atomic entity,

even in the presence of asynchronous interrupts.
It is not currently necessary for this to be machine-specific.

type X__sigset_t

type X__sigset_t = struct{ F__val [16]uint64 } /* __sigset_t.h:8:3 */

type X__socklen_t

type X__socklen_t = uint32 /* types.h:207:23 */

Duplicate info from sys/socket.h.

type X__ssize_t

type X__ssize_t = int64 /* types.h:191:27 */ // Type of a byte count, or error.

type X__suseconds_t

type X__suseconds_t = int64 /* types.h:160:31 */ // Signed count of microseconds.

type X__syscall_slong_t

type X__syscall_slong_t = int64 /* types.h:194:33 */

Signed long type used in system calls.

type X__syscall_ulong_t

type X__syscall_ulong_t = uint64 /* types.h:196:33 */

Unsigned long type used in system calls.

type X__time_t

type X__time_t = int64 /* types.h:158:26 */ // Seconds since the Epoch.

type X__timer_t

type X__timer_t = uintptr /* types.h:169:12 */

Timer ID returned by `timer_create'.

type X__timezone_ptr_t

type X__timezone_ptr_t = uintptr /* time.h:58:25 */

type X__u_char

type X__u_char = uint8 /* types.h:30:23 */

Convenience types.

type X__u_int

type X__u_int = uint32 /* types.h:32:22 */

type X__u_long

type X__u_long = uint64 /* types.h:33:27 */

type X__u_quad_t

type X__u_quad_t = uint64 /* types.h:63:27 */

type X__u_short

type X__u_short = uint16 /* types.h:31:28 */

type X__uid_t

type X__uid_t = uint32 /* types.h:144:25 */ // Type of user identifications.

type X__uint128_t

type X__uint128_t = struct {
	Flo uint64
	Fhi uint64

} /* <builtin>:22:44 */ // must match modernc.org/mathutil.Int128

type X__uint16_t

type X__uint16_t = uint16 /* types.h:39:28 */

type X__uint32_t

type X__uint32_t = uint32 /* types.h:41:22 */

type X__uint64_t

type X__uint64_t = uint64 /* types.h:44:27 */

type X__uint8_t

type X__uint8_t = uint8 /* types.h:37:23 */

type X__uint_least16_t

type X__uint_least16_t = X__uint16_t /* types.h:54:20 */

type X__uint_least32_t

type X__uint_least32_t = X__uint32_t /* types.h:56:20 */

type X__uint_least64_t

type X__uint_least64_t = X__uint64_t /* types.h:58:20 */

type X__uint_least8_t

type X__uint_least8_t = X__uint8_t /* types.h:52:19 */

type X__uintmax_t

type X__uintmax_t = uint64 /* types.h:72:27 */

type X__useconds_t

type X__useconds_t = uint32 /* types.h:159:30 */ // Count of microseconds.

type YDbMask

type YDbMask = uint32 /* sqlite3.c:18969:24 */

The yDbMask datatype for the bitmask of all attached databases.

type YYMINORTYPE

type YYMINORTYPE = struct {
	Fyyinit int32
	// contains filtered or unexported fields

} /* sqlite3.c:158494:3 */

The next sections is a series of control #defines. various aspects of the generated parser.

YYCODETYPE         is the data type used to store the integer codes
                   that represent terminal and non-terminal symbols.
                   "unsigned char" is used if there are fewer than
                   256 symbols.  Larger types otherwise.
YYNOCODE           is a number of type YYCODETYPE that is not used for
                   any terminal or nonterminal symbol.
YYFALLBACK         If defined, this indicates that one or more tokens
                   (also known as: "terminal symbols") have fall-back
                   values which should be used if the original symbol
                   would not parse.  This permits keywords to sometimes
                   be used as identifiers, for example.
YYACTIONTYPE       is the data type used for "action codes" - numbers
                   that indicate what to do in response to the next
                   token.
sqlite3ParserTOKENTYPE     is the data type used for minor type for terminal
                   symbols.  Background: A "minor type" is a semantic
                   value associated with a terminal or non-terminal
                   symbols.  For example, for an "ID" terminal symbol,
                   the minor type might be the name of the identifier.
                   Each non-terminal can have a different minor type.
                   Terminal symbols all have the same minor type, though.
                   This macros defines the minor type for terminal
                   symbols.
YYMINORTYPE        is the data type used for all minor types.
                   This is typically a union of many types, one of
                   which is sqlite3ParserTOKENTYPE.  The entry in the union
                   for terminal symbols is called "yy0".
YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
                   zero the stack is dynamically sized using realloc()
sqlite3ParserARG_SDECL     A static variable declaration for the %extra_argument
sqlite3ParserARG_PDECL     A parameter declaration for the %extra_argument
sqlite3ParserARG_PARAM     Code to pass %extra_argument as a subroutine parameter
sqlite3ParserARG_STORE     Code to store %extra_argument into yypParser
sqlite3ParserARG_FETCH     Code to extract %extra_argument from yypParser
sqlite3ParserCTX_*         As sqlite3ParserARG_ except for %extra_context
YYERRORSYMBOL      is the code number of the error symbol.  If not
                   defined, then do no error processing.
YYNSTATE           the combined number of states.
YYNRULE            the number of rules in the grammar
YYNTOKEN           Number of terminal symbols
YY_MAX_SHIFT       Maximum value for shift actions
YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
YY_ERROR_ACTION    The yy_action[] code for syntax error
YY_ACCEPT_ACTION   The yy_action[] code for accept
YY_NO_ACTION       The yy_action[] code for no-op
YY_MIN_REDUCE      Minimum value for reduce actions
YY_MAX_REDUCE      Maximum value for reduce actions

************ Begin control #defines ****************************************

type YnVar

type YnVar = I16 /* sqlite3.c:18212:13 */

The datatype ynVar is a signed integer, either 16-bit or 32-bit. Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater than 32767 we have to make it 32-bit. 16-bit is preferred because it uses less memory in the Expr object, which is a big memory user in systems with lots of prepared statements. And few applications need more than about 10 or 20 variables. But some extreme users want to have prepared statements with over 32766 variables, and for them the option is available (at compile-time).

type YyParser

type YyParser = yyParser /* sqlite3.c:159434:25 */

type YyStackEntry

type YyStackEntry = yyStackEntry /* sqlite3.c:159411:29 */

Jump to

Keyboard shortcuts

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