; _______________________________________________________________________________________
;|                                                                                       |
;| ..::FreshLib::..  Free, open source. Licensed under "BSD 2-clause" license."          |
;|_______________________________________________________________________________________|
;
;  Description: SQLite equates definitions.
;
;  Target OS: Any
;
;  Dependencies:
;
;  Notes:
;_________________________________________________________________________________________

; SQLite result codes

SQLITE_OK         =  0   ; Successful result
SQLITE_ERROR      =  1   ; SQL error or missing database
SQLITE_INTERNAL   =  2   ; An internal logic error in SQLite
SQLITE_PERM       =  3   ; Access permission denied
SQLITE_ABORT      =  4   ; Callback routine requested an abort
SQLITE_BUSY       =  5   ; The database file is locked
SQLITE_LOCKED     =  6   ; A table in the database is locked
SQLITE_NOMEM      =  7   ; A malloc() failed
SQLITE_READONLY   =  8   ; Attempt to write a readonly database
SQLITE_INTERRUPT  =  9   ; Operation terminated by sqlite_interrupt()
SQLITE_IOERR      = 10   ; Some kind of disk I/O error occurred
SQLITE_CORRUPT    = 11   ; The database disk image is malformed
SQLITE_NOTFOUND   = 12   ; (Internal Only) Table or record not found
SQLITE_FULL       = 13   ; Insertion failed because database is full
SQLITE_CANTOPEN   = 14   ; Unable to open the database file
SQLITE_PROTOCOL   = 15   ; Database lock protocol error
SQLITE_EMPTY      = 16   ; (Internal Only) Database table is empty
SQLITE_SCHEMA     = 17   ; The database schema changed
SQLITE_TOOBIG     = 18   ; Too much data for one row of a table
SQLITE_CONSTRAINT = 19   ; Abort due to constraint violation
SQLITE_MISMATCH   = 20   ; Data type mismatch
SQLITE_MISUSE     = 21   ; Library used incorrectly
SQLITE_NOLFS      = 22   ; Uses OS features not supported on host
SQLITE_AUTH       = 23   ; Authorization denied
SQLITE_FORMAT     = 24   ; Auxiliary database format error
SQLITE_RANGE      = 25   ; 2nd parameter to sqlite3_bind out of range
SQLITE_NOTADB     = 26   ; File opened that is not a database file
SQLITE_NOTICE     = 27   ; Notifications from sqlite3_log()
SQLITE_WARNING    = 28   ; Warnings from sqlite3_log()
SQLITE_ROW        = 100  ; sqlite_step() has another row ready
SQLITE_DONE       = 101  ; sqlite_step() has finished executing


; SQLite extended result codes.

SQLITE_IOERR_READ              = SQLITE_IOERR or (1 shl 8)
SQLITE_IOERR_SHORT_READ        = SQLITE_IOERR or (2 shl 8)
SQLITE_IOERR_WRITE             = SQLITE_IOERR or (3 shl 8)
SQLITE_IOERR_FSYNC             = SQLITE_IOERR or (4 shl 8)
SQLITE_IOERR_DIR_FSYNC         = SQLITE_IOERR or (5 shl 8)
SQLITE_IOERR_TRUNCATE          = SQLITE_IOERR or (6 shl 8)
SQLITE_IOERR_FSTAT             = SQLITE_IOERR or (7 shl 8)
SQLITE_IOERR_UNLOCK            = SQLITE_IOERR or (8 shl 8)
SQLITE_IOERR_RDLOCK            = SQLITE_IOERR or (9 shl 8)
SQLITE_IOERR_DELETE            = SQLITE_IOERR or (10 shl 8)
SQLITE_IOERR_BLOCKED           = SQLITE_IOERR or (11 shl 8)
SQLITE_IOERR_NOMEM             = SQLITE_IOERR or (12 shl 8)
SQLITE_IOERR_ACCESS            = SQLITE_IOERR or (13 shl 8)
SQLITE_IOERR_CHECKRESERVEDLOCK = SQLITE_IOERR or (14 shl 8)
SQLITE_IOERR_LOCK              = SQLITE_IOERR or (15 shl 8)
SQLITE_IOERR_CLOSE             = SQLITE_IOERR or (16 shl 8)
SQLITE_IOERR_DIR_CLOSE         = SQLITE_IOERR or (17 shl 8)
SQLITE_IOERR_SHMOPEN           = SQLITE_IOERR or (18 shl 8)
SQLITE_IOERR_SHMSIZE           = SQLITE_IOERR or (19 shl 8)
SQLITE_IOERR_SHMLOCK           = SQLITE_IOERR or (20 shl 8)
SQLITE_IOERR_SHMMAP            = SQLITE_IOERR or (21 shl 8)
SQLITE_IOERR_SEEK              = SQLITE_IOERR or (22 shl 8)
SQLITE_IOERR_DELETE_NOENT      = SQLITE_IOERR or (23 shl 8)
SQLITE_IOERR_MMAP              = SQLITE_IOERR or (24 shl 8)
SQLITE_IOERR_GETTEMPPATH       = SQLITE_IOERR or (25 shl 8)
SQLITE_IOERR_CONVPATH          = SQLITE_IOERR or (26 shl 8)
SQLITE_IOERR_VNODE             = SQLITE_IOERR or (27 shl 8)
SQLITE_IOERR_AUTH              = SQLITE_IOERR or (28 shl 8)
SQLITE_LOCKED_SHAREDCACHE      = SQLITE_LOCKED or  (1 shl 8)
SQLITE_BUSY_RECOVERY           = SQLITE_BUSY   or  (1 shl 8)
SQLITE_BUSY_SNAPSHOT           = SQLITE_BUSY   or  (2 shl 8)
SQLITE_CANTOPEN_NOTEMPDIR      = SQLITE_CANTOPEN or (1 shl 8)
SQLITE_CANTOPEN_ISDIR          = SQLITE_CANTOPEN or (2 shl 8)
SQLITE_CANTOPEN_FULLPATH       = SQLITE_CANTOPEN or (3 shl 8)
SQLITE_CANTOPEN_CONVPATH       = SQLITE_CANTOPEN or (4 shl 8)
SQLITE_CORRUPT_VTAB            = SQLITE_CORRUPT or (1 shl 8)
SQLITE_READONLY_RECOVERY       = SQLITE_READONLY or (1 shl 8)
SQLITE_READONLY_CANTLOCK       = SQLITE_READONLY or (2 shl 8)
SQLITE_READONLY_ROLLBACK       = SQLITE_READONLY or (3 shl 8)
SQLITE_READONLY_DBMOVED        = SQLITE_READONLY or (4 shl 8)
SQLITE_ABORT_ROLLBACK          = SQLITE_ABORT or (2 shl 8)
SQLITE_CONSTRAINT_CHECK        = SQLITE_CONSTRAINT or (1 shl 8)
SQLITE_CONSTRAINT_COMMITHOOK   = SQLITE_CONSTRAINT or (2 shl 8)
SQLITE_CONSTRAINT_FOREIGNKEY   = SQLITE_CONSTRAINT or (3 shl 8)
SQLITE_CONSTRAINT_FUNCTION     = SQLITE_CONSTRAINT or (4 shl 8)
SQLITE_CONSTRAINT_NOTNULL      = SQLITE_CONSTRAINT or (5 shl 8)
SQLITE_CONSTRAINT_PRIMARYKEY   = SQLITE_CONSTRAINT or (6 shl 8)
SQLITE_CONSTRAINT_TRIGGER      = SQLITE_CONSTRAINT or (7 shl 8)
SQLITE_CONSTRAINT_UNIQUE       = SQLITE_CONSTRAINT or (8 shl 8)
SQLITE_CONSTRAINT_VTAB         = SQLITE_CONSTRAINT or (9 shl 8)
SQLITE_CONSTRAINT_ROWID        = SQLITE_CONSTRAINT or (10 shl 8)
SQLITE_NOTICE_RECOVER_WAL      = SQLITE_NOTICE or (1 shl 8)
SQLITE_NOTICE_RECOVER_ROLLBACK = SQLITE_NOTICE or (2 shl 8)
SQLITE_WARNING_AUTOINDEX       = SQLITE_WARNING or (1 shl 8)
SQLITE_AUTH_USER               = SQLITE_AUTH or (1 shl 8)




SQLITE_CREATE_INDEX        =  1 ;   // Index Name      Table Name      */
SQLITE_CREATE_TABLE        =  2 ;   // Table Name      NULL            */
SQLITE_CREATE_TEMP_INDEX   =  3 ;   // Index Name      Table Name      */
SQLITE_CREATE_TEMP_TABLE   =  4 ;   // Table Name      NULL            */
SQLITE_CREATE_TEMP_TRIGGER =  5 ;   // Trigger Name    Table Name      */
SQLITE_CREATE_TEMP_VIEW    =  6 ;   // View Name       NULL            */
SQLITE_CREATE_TRIGGER      =  7 ;   // Trigger Name    Table Name      */
SQLITE_CREATE_VIEW         =  8 ;   // View Name       NULL            */
SQLITE_DELETE              =  9 ;   // Table Name      NULL            */
SQLITE_DROP_INDEX          = 10 ;   // Index Name      Table Name      */
SQLITE_DROP_TABLE          = 11 ;   // Table Name      NULL            */
SQLITE_DROP_TEMP_INDEX     = 12 ;   // Index Name      Table Name      */
SQLITE_DROP_TEMP_TABLE     = 13 ;   // Table Name      NULL            */
SQLITE_DROP_TEMP_TRIGGER   = 14 ;   // Trigger Name    Table Name      */
SQLITE_DROP_TEMP_VIEW      = 15 ;   // View Name       NULL            */
SQLITE_DROP_TRIGGER        = 16 ;   // Trigger Name    Table Name      */
SQLITE_DROP_VIEW           = 17 ;   // View Name       NULL            */
SQLITE_INSERT              = 18 ;   // Table Name      NULL            */
SQLITE_PRAGMA              = 19 ;   // Pragma Name     1st arg or NULL */
SQLITE_READ                = 20 ;   // Table Name      Column Name     */
SQLITE_SELECT              = 21 ;   // NULL            NULL            */
SQLITE_TRANSACTION         = 22 ;   // NULL            NULL            */
SQLITE_UPDATE              = 23 ;   // Table Name      Column Name     */
SQLITE_ATTACH              = 24 ;   // Filename        NULL            */
SQLITE_DETACH              = 25 ;   // Database Name   NULL            */

SQLITE_DENY   = 1       ;   // Abort the SQL statement with an error */
SQLITE_IGNORE = 2       ;   // Don't allow access, but don't generate an error */


; These are the allowed values for the eTextRep argument to
; sqliteCreateCollation and sqliteCreateFunction.

SQLITE_UTF8       = 1
SQLITE_UTF16LE    = 2
SQLITE_UTF16BE    = 3
SQLITE_UTF16      = 4   ;   Use native byte order
SQLITE_ANY        = 5

; values returned by sqliteColumnType
SQLITE_INTEGER    = 1
SQLITE_FLOAT      = 2
SQLITE_TEXT       = 3
SQLITE_BLOB       = 4
SQLITE_NULL       = 5


SQLITE_STATIC     = 0
SQLITE_TRANSIENT  = -1



; SQLITE configuration parameters

SQLITE_CONFIG_SINGLETHREAD  = 1  ; nil
SQLITE_CONFIG_MULTITHREAD   = 2  ; nil
SQLITE_CONFIG_SERIALIZED    = 3  ; nil
SQLITE_CONFIG_MALLOC        = 4  ; sqlite3_mem_methods*
SQLITE_CONFIG_GETMALLOC     = 5  ; sqlite3_mem_methods*
SQLITE_CONFIG_SCRATCH       = 6  ; void*, int sz, int N
SQLITE_CONFIG_PAGECACHE     = 7  ; void*, int sz, int N
SQLITE_CONFIG_HEAP          = 8  ; void*, int nByte, int min
SQLITE_CONFIG_MEMSTATUS     = 9  ; boolean
SQLITE_CONFIG_MUTEX         = 10 ; sqlite3_mutex_methods*
SQLITE_CONFIG_GETMUTEX      = 11 ; sqlite3_mutex_methods*

