📄 capi3ref.html
字号:
numeric value of its corresponding primary result code inits least significant 8 bits.</td></tr></table></p><hr><a name="SQLITE_OPEN_CREATE"></a><h2>Flags For File Open Operations</h2><blockquote><pre>#define SQLITE_OPEN_READONLY 0x00000001#define SQLITE_OPEN_READWRITE 0x00000002#define SQLITE_OPEN_CREATE 0x00000004#define SQLITE_OPEN_DELETEONCLOSE 0x00000008#define SQLITE_OPEN_EXCLUSIVE 0x00000010#define SQLITE_OPEN_MAIN_DB 0x00000100#define SQLITE_OPEN_TEMP_DB 0x00000200#define SQLITE_OPEN_TRANSIENT_DB 0x00000400#define SQLITE_OPEN_MAIN_JOURNAL 0x00000800#define SQLITE_OPEN_TEMP_JOURNAL 0x00001000#define SQLITE_OPEN_SUBJOURNAL 0x00002000#define SQLITE_OPEN_MASTER_JOURNAL 0x00004000#define SQLITE_OPEN_NOMUTEX 0x00008000#define SQLITE_OPEN_FULLMUTEX 0x00010000</pre></blockquote><p>These bit values are intended for use in the3rd parameter to the <a href="#sqlite3_open">sqlite3_open_v2()</a> interface andin the 4th parameter to the xOpen method of the<a href="#sqlite3_vfs">sqlite3_vfs</a> object.</p><hr><a name="SQLITE_IOCAP_ATOMIC"></a><h2>Device Characteristics</h2><blockquote><pre>#define SQLITE_IOCAP_ATOMIC 0x00000001#define SQLITE_IOCAP_ATOMIC512 0x00000002#define SQLITE_IOCAP_ATOMIC1K 0x00000004#define SQLITE_IOCAP_ATOMIC2K 0x00000008#define SQLITE_IOCAP_ATOMIC4K 0x00000010#define SQLITE_IOCAP_ATOMIC8K 0x00000020#define SQLITE_IOCAP_ATOMIC16K 0x00000040#define SQLITE_IOCAP_ATOMIC32K 0x00000080#define SQLITE_IOCAP_ATOMIC64K 0x00000100#define SQLITE_IOCAP_SAFE_APPEND 0x00000200#define SQLITE_IOCAP_SEQUENTIAL 0x00000400</pre></blockquote><p>The xDeviceCapabilities method of the <a href="#sqlite3_io_methods">sqlite3_io_methods</a>object returns an integer which is a vector of the thesebit values expressing I/O characteristics of the mass storagedevice that holds the file that the <a href="#sqlite3_io_methods">sqlite3_io_methods</a>refers to.</p><p>The SQLITE_IOCAP_ATOMIC property means that all writes ofany size are atomic. The SQLITE_IOCAP_ATOMICnnn valuesmean that writes of blocks that are nnn bytes in size andare aligned to an address which is an integer multiple ofnnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value meansthat when data is appended to a file, the data is appendedfirst then the size of the file is extended, never the otherway around. The SQLITE_IOCAP_SEQUENTIAL property means thatinformation is written to disk in the same order as callsto xWrite().</p><hr><a name="SQLITE_LOCK_EXCLUSIVE"></a><h2>File Locking Levels</h2><blockquote><pre>#define SQLITE_LOCK_NONE 0#define SQLITE_LOCK_SHARED 1#define SQLITE_LOCK_RESERVED 2#define SQLITE_LOCK_PENDING 3#define SQLITE_LOCK_EXCLUSIVE 4</pre></blockquote><p>SQLite uses one of these integer values as the secondargument to calls it makes to the xLock() and xUnlock() methodsof an <a href="#sqlite3_io_methods">sqlite3_io_methods</a> object.</p><hr><a name="SQLITE_SYNC_DATAONLY"></a><h2>Synchronization Type Flags</h2><blockquote><pre>#define SQLITE_SYNC_NORMAL 0x00002#define SQLITE_SYNC_FULL 0x00003#define SQLITE_SYNC_DATAONLY 0x00010</pre></blockquote><p>When SQLite invokes the xSync() method of an<a href="#sqlite3_io_methods">sqlite3_io_methods</a> object it uses a combination ofthese integer values as the second argument.</p><p>When the SQLITE_SYNC_DATAONLY flag is used, it means that thesync operation only needs to flush data to mass storage. Inodeinformation need not be flushed. The SQLITE_SYNC_NORMAL flag meansto use normal fsync() semantics. The SQLITE_SYNC_FULL flag meansto use Mac OS X style fullsync instead of fsync().</p><hr><a name="SQLITE_BLOB"></a><h2>Fundamental Datatypes</h2><blockquote><pre>#define SQLITE_INTEGER 1#define SQLITE_FLOAT 2#define SQLITE_BLOB 4#define SQLITE_NULL 5#ifdef SQLITE_TEXT# undef SQLITE_TEXT#else# define SQLITE_TEXT 3#endif#define SQLITE3_TEXT 3</pre></blockquote><p> Every value in SQLite has one of five fundamental datatypes:</p><p><ul><li> 64-bit signed integer<li> 64-bit IEEE floating point number<li> string<li> BLOB<li> NULL</ul></p><p>These constants are codes for each of those types.</p><p>Note that the SQLITE_TEXT constant was also used in SQLite version 2for a completely different meaning. Software that links against bothSQLite version 2 and SQLite version 3 should use SQLITE3_TEXT, notSQLITE_TEXT.</p><hr><a name="SQLITE_ANY"></a><h2>Text Encodings</h2><blockquote><pre>#define SQLITE_UTF8 1#define SQLITE_UTF16LE 2#define SQLITE_UTF16BE 3#define SQLITE_UTF16 4 /* Use native byte order */#define SQLITE_ANY 5 /* sqlite3_create_function only */#define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */</pre></blockquote><p>These constant define integer codes that represent the varioustext encodings supported by SQLite.</p><hr><a name="SQLITE_STATIC"></a><h2>Constants Defining Special Destructor Behavior</h2><blockquote><pre>typedef void (*sqlite3_destructor_type)(void*);#define SQLITE_STATIC ((sqlite3_destructor_type)0)#define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1)</pre></blockquote><p>These are special values for the destructor that is passed in as thefinal argument to routines like <a href="#sqlite3_result_blob">sqlite3_result_blob()</a>. If the destructorargument is SQLITE_STATIC, it means that the content pointer is constantand will never change. It does not need to be destroyed. TheSQLITE_TRANSIENT value means that the content will likely change inthe near future and that SQLite should make its own private copy ofthe content before returning.</p><p>The typedef is necessary to work around problems in certainC++ compilers. See ticket #2191.</p><hr><a name="SQLITE_ACCESS_EXISTS"></a><h2>Flags for the xAccess VFS method</h2><blockquote><pre>#define SQLITE_ACCESS_EXISTS 0#define SQLITE_ACCESS_READWRITE 1#define SQLITE_ACCESS_READ 2</pre></blockquote><p> These integer constants can be used as the third parameter tothe xAccess method of an <a href="#sqlite3_vfs">sqlite3_vfs</a> object. They determinewhat kind of permissions the xAccess method is looking for. With SQLITE_ACCESS_EXISTS, the xAccess methodsimply checks whether the file exists. With SQLITE_ACCESS_READWRITE, the xAccess methodchecks whether the file is both readable and writable. With SQLITE_ACCESS_READ, the xAccess methodchecks whether the file is readable.</p><hr><a name="SQLITE_FCNTL_LOCKSTATE"></a><h2>Standard File Control Opcodes</h2><blockquote><pre>#define SQLITE_FCNTL_LOCKSTATE 1</pre></blockquote><p>These integer constants are opcodes for the xFileControl methodof the <a href="#sqlite3_io_methods">sqlite3_io_methods</a> object and for the <a href="#sqlite3_file_control">sqlite3_file_control()</a>interface.</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -