Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/saltstac.../salt/include
File: sqlite3.h
/*
[0] Fix | Delete
** 2001-09-15
[1] Fix | Delete
**
[2] Fix | Delete
** The author disclaims copyright to this source code. In place of
[3] Fix | Delete
** a legal notice, here is a blessing:
[4] Fix | Delete
**
[5] Fix | Delete
** May you do good and not evil.
[6] Fix | Delete
** May you find forgiveness for yourself and forgive others.
[7] Fix | Delete
** May you share freely, never taking more than you give.
[8] Fix | Delete
**
[9] Fix | Delete
*************************************************************************
[10] Fix | Delete
** This header file defines the interface that the SQLite library
[11] Fix | Delete
** presents to client programs. If a C-function, structure, datatype,
[12] Fix | Delete
** or constant definition does not appear in this file, then it is
[13] Fix | Delete
** not a published API of SQLite, is subject to change without
[14] Fix | Delete
** notice, and should not be referenced by programs that use SQLite.
[15] Fix | Delete
**
[16] Fix | Delete
** Some of the definitions that are in this file are marked as
[17] Fix | Delete
** "experimental". Experimental interfaces are normally new
[18] Fix | Delete
** features recently added to SQLite. We do not anticipate changes
[19] Fix | Delete
** to experimental interfaces but reserve the right to make minor changes
[20] Fix | Delete
** if experience from use "in the wild" suggest such changes are prudent.
[21] Fix | Delete
**
[22] Fix | Delete
** The official C-language API documentation for SQLite is derived
[23] Fix | Delete
** from comments in this file. This file is the authoritative source
[24] Fix | Delete
** on how SQLite interfaces are supposed to operate.
[25] Fix | Delete
**
[26] Fix | Delete
** The name of this file under configuration management is "sqlite.h.in".
[27] Fix | Delete
** The makefile makes some minor changes to this file (such as inserting
[28] Fix | Delete
** the version number) and changes its name to "sqlite3.h" as
[29] Fix | Delete
** part of the build process.
[30] Fix | Delete
*/
[31] Fix | Delete
#ifndef SQLITE3_H
[32] Fix | Delete
#define SQLITE3_H
[33] Fix | Delete
#include <stdarg.h> /* Needed for the definition of va_list */
[34] Fix | Delete
[35] Fix | Delete
/*
[36] Fix | Delete
** Make sure we can call this stuff from C++.
[37] Fix | Delete
*/
[38] Fix | Delete
#ifdef __cplusplus
[39] Fix | Delete
extern "C" {
[40] Fix | Delete
#endif
[41] Fix | Delete
[42] Fix | Delete
[43] Fix | Delete
/*
[44] Fix | Delete
** Facilitate override of interface linkage and calling conventions.
[45] Fix | Delete
** Be aware that these macros may not be used within this particular
[46] Fix | Delete
** translation of the amalgamation and its associated header file.
[47] Fix | Delete
**
[48] Fix | Delete
** The SQLITE_EXTERN and SQLITE_API macros are used to instruct the
[49] Fix | Delete
** compiler that the target identifier should have external linkage.
[50] Fix | Delete
**
[51] Fix | Delete
** The SQLITE_CDECL macro is used to set the calling convention for
[52] Fix | Delete
** public functions that accept a variable number of arguments.
[53] Fix | Delete
**
[54] Fix | Delete
** The SQLITE_APICALL macro is used to set the calling convention for
[55] Fix | Delete
** public functions that accept a fixed number of arguments.
[56] Fix | Delete
**
[57] Fix | Delete
** The SQLITE_STDCALL macro is no longer used and is now deprecated.
[58] Fix | Delete
**
[59] Fix | Delete
** The SQLITE_CALLBACK macro is used to set the calling convention for
[60] Fix | Delete
** function pointers.
[61] Fix | Delete
**
[62] Fix | Delete
** The SQLITE_SYSAPI macro is used to set the calling convention for
[63] Fix | Delete
** functions provided by the operating system.
[64] Fix | Delete
**
[65] Fix | Delete
** Currently, the SQLITE_CDECL, SQLITE_APICALL, SQLITE_CALLBACK, and
[66] Fix | Delete
** SQLITE_SYSAPI macros are used only when building for environments
[67] Fix | Delete
** that require non-default calling conventions.
[68] Fix | Delete
*/
[69] Fix | Delete
#ifndef SQLITE_EXTERN
[70] Fix | Delete
# define SQLITE_EXTERN extern
[71] Fix | Delete
#endif
[72] Fix | Delete
#ifndef SQLITE_API
[73] Fix | Delete
# define SQLITE_API
[74] Fix | Delete
#endif
[75] Fix | Delete
#ifndef SQLITE_CDECL
[76] Fix | Delete
# define SQLITE_CDECL
[77] Fix | Delete
#endif
[78] Fix | Delete
#ifndef SQLITE_APICALL
[79] Fix | Delete
# define SQLITE_APICALL
[80] Fix | Delete
#endif
[81] Fix | Delete
#ifndef SQLITE_STDCALL
[82] Fix | Delete
# define SQLITE_STDCALL SQLITE_APICALL
[83] Fix | Delete
#endif
[84] Fix | Delete
#ifndef SQLITE_CALLBACK
[85] Fix | Delete
# define SQLITE_CALLBACK
[86] Fix | Delete
#endif
[87] Fix | Delete
#ifndef SQLITE_SYSAPI
[88] Fix | Delete
# define SQLITE_SYSAPI
[89] Fix | Delete
#endif
[90] Fix | Delete
[91] Fix | Delete
/*
[92] Fix | Delete
** These no-op macros are used in front of interfaces to mark those
[93] Fix | Delete
** interfaces as either deprecated or experimental. New applications
[94] Fix | Delete
** should not use deprecated interfaces - they are supported for backwards
[95] Fix | Delete
** compatibility only. Application writers should be aware that
[96] Fix | Delete
** experimental interfaces are subject to change in point releases.
[97] Fix | Delete
**
[98] Fix | Delete
** These macros used to resolve to various kinds of compiler magic that
[99] Fix | Delete
** would generate warning messages when they were used. But that
[100] Fix | Delete
** compiler magic ended up generating such a flurry of bug reports
[101] Fix | Delete
** that we have taken it all out and gone back to using simple
[102] Fix | Delete
** noop macros.
[103] Fix | Delete
*/
[104] Fix | Delete
#define SQLITE_DEPRECATED
[105] Fix | Delete
#define SQLITE_EXPERIMENTAL
[106] Fix | Delete
[107] Fix | Delete
/*
[108] Fix | Delete
** Ensure these symbols were not defined by some previous header file.
[109] Fix | Delete
*/
[110] Fix | Delete
#ifdef SQLITE_VERSION
[111] Fix | Delete
# undef SQLITE_VERSION
[112] Fix | Delete
#endif
[113] Fix | Delete
#ifdef SQLITE_VERSION_NUMBER
[114] Fix | Delete
# undef SQLITE_VERSION_NUMBER
[115] Fix | Delete
#endif
[116] Fix | Delete
[117] Fix | Delete
/*
[118] Fix | Delete
** CAPI3REF: Compile-Time Library Version Numbers
[119] Fix | Delete
**
[120] Fix | Delete
** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header
[121] Fix | Delete
** evaluates to a string literal that is the SQLite version in the
[122] Fix | Delete
** format "X.Y.Z" where X is the major version number (always 3 for
[123] Fix | Delete
** SQLite3) and Y is the minor version number and Z is the release number.)^
[124] Fix | Delete
** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer
[125] Fix | Delete
** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same
[126] Fix | Delete
** numbers used in [SQLITE_VERSION].)^
[127] Fix | Delete
** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
[128] Fix | Delete
** be larger than the release from which it is derived. Either Y will
[129] Fix | Delete
** be held constant and Z will be incremented or else Y will be incremented
[130] Fix | Delete
** and Z will be reset to zero.
[131] Fix | Delete
**
[132] Fix | Delete
** Since [version 3.6.18] ([dateof:3.6.18]),
[133] Fix | Delete
** SQLite source code has been stored in the
[134] Fix | Delete
** <a href="http://www.fossil-scm.org/">Fossil configuration management
[135] Fix | Delete
** system</a>. ^The SQLITE_SOURCE_ID macro evaluates to
[136] Fix | Delete
** a string which identifies a particular check-in of SQLite
[137] Fix | Delete
** within its configuration management system. ^The SQLITE_SOURCE_ID
[138] Fix | Delete
** string contains the date and time of the check-in (UTC) and a SHA1
[139] Fix | Delete
** or SHA3-256 hash of the entire source tree. If the source code has
[140] Fix | Delete
** been edited in any way since it was last checked in, then the last
[141] Fix | Delete
** four hexadecimal digits of the hash may be modified.
[142] Fix | Delete
**
[143] Fix | Delete
** See also: [sqlite3_libversion()],
[144] Fix | Delete
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
[145] Fix | Delete
** [sqlite_version()] and [sqlite_source_id()].
[146] Fix | Delete
*/
[147] Fix | Delete
#define SQLITE_VERSION "3.45.2"
[148] Fix | Delete
#define SQLITE_VERSION_NUMBER 3045002
[149] Fix | Delete
#define SQLITE_SOURCE_ID "2024-03-12 11:06:23 d8cd6d49b46a395b13955387d05e9e1a2a47e54fb99f3c9b59835bbefad6af77"
[150] Fix | Delete
[151] Fix | Delete
/*
[152] Fix | Delete
** CAPI3REF: Run-Time Library Version Numbers
[153] Fix | Delete
** KEYWORDS: sqlite3_version sqlite3_sourceid
[154] Fix | Delete
**
[155] Fix | Delete
** These interfaces provide the same information as the [SQLITE_VERSION],
[156] Fix | Delete
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
[157] Fix | Delete
** but are associated with the library instead of the header file. ^(Cautious
[158] Fix | Delete
** programmers might include assert() statements in their application to
[159] Fix | Delete
** verify that values returned by these interfaces match the macros in
[160] Fix | Delete
** the header, and thus ensure that the application is
[161] Fix | Delete
** compiled with matching library and header files.
[162] Fix | Delete
**
[163] Fix | Delete
** <blockquote><pre>
[164] Fix | Delete
** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
[165] Fix | Delete
** assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
[166] Fix | Delete
** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
[167] Fix | Delete
** </pre></blockquote>)^
[168] Fix | Delete
**
[169] Fix | Delete
** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]
[170] Fix | Delete
** macro. ^The sqlite3_libversion() function returns a pointer to the
[171] Fix | Delete
** to the sqlite3_version[] string constant. The sqlite3_libversion()
[172] Fix | Delete
** function is provided for use in DLLs since DLL users usually do not have
[173] Fix | Delete
** direct access to string constants within the DLL. ^The
[174] Fix | Delete
** sqlite3_libversion_number() function returns an integer equal to
[175] Fix | Delete
** [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns
[176] Fix | Delete
** a pointer to a string constant whose value is the same as the
[177] Fix | Delete
** [SQLITE_SOURCE_ID] C preprocessor macro. Except if SQLite is built
[178] Fix | Delete
** using an edited copy of [the amalgamation], then the last four characters
[179] Fix | Delete
** of the hash might be different from [SQLITE_SOURCE_ID].)^
[180] Fix | Delete
**
[181] Fix | Delete
** See also: [sqlite_version()] and [sqlite_source_id()].
[182] Fix | Delete
*/
[183] Fix | Delete
SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
[184] Fix | Delete
SQLITE_API const char *sqlite3_libversion(void);
[185] Fix | Delete
SQLITE_API const char *sqlite3_sourceid(void);
[186] Fix | Delete
SQLITE_API int sqlite3_libversion_number(void);
[187] Fix | Delete
[188] Fix | Delete
/*
[189] Fix | Delete
** CAPI3REF: Run-Time Library Compilation Options Diagnostics
[190] Fix | Delete
**
[191] Fix | Delete
** ^The sqlite3_compileoption_used() function returns 0 or 1
[192] Fix | Delete
** indicating whether the specified option was defined at
[193] Fix | Delete
** compile time. ^The SQLITE_ prefix may be omitted from the
[194] Fix | Delete
** option name passed to sqlite3_compileoption_used().
[195] Fix | Delete
**
[196] Fix | Delete
** ^The sqlite3_compileoption_get() function allows iterating
[197] Fix | Delete
** over the list of options that were defined at compile time by
[198] Fix | Delete
** returning the N-th compile time option string. ^If N is out of range,
[199] Fix | Delete
** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_
[200] Fix | Delete
** prefix is omitted from any strings returned by
[201] Fix | Delete
** sqlite3_compileoption_get().
[202] Fix | Delete
**
[203] Fix | Delete
** ^Support for the diagnostic functions sqlite3_compileoption_used()
[204] Fix | Delete
** and sqlite3_compileoption_get() may be omitted by specifying the
[205] Fix | Delete
** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.
[206] Fix | Delete
**
[207] Fix | Delete
** See also: SQL functions [sqlite_compileoption_used()] and
[208] Fix | Delete
** [sqlite_compileoption_get()] and the [compile_options pragma].
[209] Fix | Delete
*/
[210] Fix | Delete
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
[211] Fix | Delete
SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
[212] Fix | Delete
SQLITE_API const char *sqlite3_compileoption_get(int N);
[213] Fix | Delete
#else
[214] Fix | Delete
# define sqlite3_compileoption_used(X) 0
[215] Fix | Delete
# define sqlite3_compileoption_get(X) ((void*)0)
[216] Fix | Delete
#endif
[217] Fix | Delete
[218] Fix | Delete
/*
[219] Fix | Delete
** CAPI3REF: Test To See If The Library Is Threadsafe
[220] Fix | Delete
**
[221] Fix | Delete
** ^The sqlite3_threadsafe() function returns zero if and only if
[222] Fix | Delete
** SQLite was compiled with mutexing code omitted due to the
[223] Fix | Delete
** [SQLITE_THREADSAFE] compile-time option being set to 0.
[224] Fix | Delete
**
[225] Fix | Delete
** SQLite can be compiled with or without mutexes. When
[226] Fix | Delete
** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes
[227] Fix | Delete
** are enabled and SQLite is threadsafe. When the
[228] Fix | Delete
** [SQLITE_THREADSAFE] macro is 0,
[229] Fix | Delete
** the mutexes are omitted. Without the mutexes, it is not safe
[230] Fix | Delete
** to use SQLite concurrently from more than one thread.
[231] Fix | Delete
**
[232] Fix | Delete
** Enabling mutexes incurs a measurable performance penalty.
[233] Fix | Delete
** So if speed is of utmost importance, it makes sense to disable
[234] Fix | Delete
** the mutexes. But for maximum safety, mutexes should be enabled.
[235] Fix | Delete
** ^The default behavior is for mutexes to be enabled.
[236] Fix | Delete
**
[237] Fix | Delete
** This interface can be used by an application to make sure that the
[238] Fix | Delete
** version of SQLite that it is linking against was compiled with
[239] Fix | Delete
** the desired setting of the [SQLITE_THREADSAFE] macro.
[240] Fix | Delete
**
[241] Fix | Delete
** This interface only reports on the compile-time mutex setting
[242] Fix | Delete
** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with
[243] Fix | Delete
** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but
[244] Fix | Delete
** can be fully or partially disabled using a call to [sqlite3_config()]
[245] Fix | Delete
** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],
[246] Fix | Delete
** or [SQLITE_CONFIG_SERIALIZED]. ^(The return value of the
[247] Fix | Delete
** sqlite3_threadsafe() function shows only the compile-time setting of
[248] Fix | Delete
** thread safety, not any run-time changes to that setting made by
[249] Fix | Delete
** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()
[250] Fix | Delete
** is unchanged by calls to sqlite3_config().)^
[251] Fix | Delete
**
[252] Fix | Delete
** See the [threading mode] documentation for additional information.
[253] Fix | Delete
*/
[254] Fix | Delete
SQLITE_API int sqlite3_threadsafe(void);
[255] Fix | Delete
[256] Fix | Delete
/*
[257] Fix | Delete
** CAPI3REF: Database Connection Handle
[258] Fix | Delete
** KEYWORDS: {database connection} {database connections}
[259] Fix | Delete
**
[260] Fix | Delete
** Each open SQLite database is represented by a pointer to an instance of
[261] Fix | Delete
** the opaque structure named "sqlite3". It is useful to think of an sqlite3
[262] Fix | Delete
** pointer as an object. The [sqlite3_open()], [sqlite3_open16()], and
[263] Fix | Delete
** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]
[264] Fix | Delete
** and [sqlite3_close_v2()] are its destructors. There are many other
[265] Fix | Delete
** interfaces (such as
[266] Fix | Delete
** [sqlite3_prepare_v2()], [sqlite3_create_function()], and
[267] Fix | Delete
** [sqlite3_busy_timeout()] to name but three) that are methods on an
[268] Fix | Delete
** sqlite3 object.
[269] Fix | Delete
*/
[270] Fix | Delete
typedef struct sqlite3 sqlite3;
[271] Fix | Delete
[272] Fix | Delete
/*
[273] Fix | Delete
** CAPI3REF: 64-Bit Integer Types
[274] Fix | Delete
** KEYWORDS: sqlite_int64 sqlite_uint64
[275] Fix | Delete
**
[276] Fix | Delete
** Because there is no cross-platform way to specify 64-bit integer types
[277] Fix | Delete
** SQLite includes typedefs for 64-bit signed and unsigned integers.
[278] Fix | Delete
**
[279] Fix | Delete
** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.
[280] Fix | Delete
** The sqlite_int64 and sqlite_uint64 types are supported for backwards
[281] Fix | Delete
** compatibility only.
[282] Fix | Delete
**
[283] Fix | Delete
** ^The sqlite3_int64 and sqlite_int64 types can store integer values
[284] Fix | Delete
** between -9223372036854775808 and +9223372036854775807 inclusive. ^The
[285] Fix | Delete
** sqlite3_uint64 and sqlite_uint64 types can store integer values
[286] Fix | Delete
** between 0 and +18446744073709551615 inclusive.
[287] Fix | Delete
*/
[288] Fix | Delete
#ifdef SQLITE_INT64_TYPE
[289] Fix | Delete
typedef SQLITE_INT64_TYPE sqlite_int64;
[290] Fix | Delete
# ifdef SQLITE_UINT64_TYPE
[291] Fix | Delete
typedef SQLITE_UINT64_TYPE sqlite_uint64;
[292] Fix | Delete
# else
[293] Fix | Delete
typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;
[294] Fix | Delete
# endif
[295] Fix | Delete
#elif defined(_MSC_VER) || defined(__BORLANDC__)
[296] Fix | Delete
typedef __int64 sqlite_int64;
[297] Fix | Delete
typedef unsigned __int64 sqlite_uint64;
[298] Fix | Delete
#else
[299] Fix | Delete
typedef long long int sqlite_int64;
[300] Fix | Delete
typedef unsigned long long int sqlite_uint64;
[301] Fix | Delete
#endif
[302] Fix | Delete
typedef sqlite_int64 sqlite3_int64;
[303] Fix | Delete
typedef sqlite_uint64 sqlite3_uint64;
[304] Fix | Delete
[305] Fix | Delete
/*
[306] Fix | Delete
** If compiling for a processor that lacks floating point support,
[307] Fix | Delete
** substitute integer for floating-point.
[308] Fix | Delete
*/
[309] Fix | Delete
#ifdef SQLITE_OMIT_FLOATING_POINT
[310] Fix | Delete
# define double sqlite3_int64
[311] Fix | Delete
#endif
[312] Fix | Delete
[313] Fix | Delete
/*
[314] Fix | Delete
** CAPI3REF: Closing A Database Connection
[315] Fix | Delete
** DESTRUCTOR: sqlite3
[316] Fix | Delete
**
[317] Fix | Delete
** ^The sqlite3_close() and sqlite3_close_v2() routines are destructors
[318] Fix | Delete
** for the [sqlite3] object.
[319] Fix | Delete
** ^Calls to sqlite3_close() and sqlite3_close_v2() return [SQLITE_OK] if
[320] Fix | Delete
** the [sqlite3] object is successfully destroyed and all associated
[321] Fix | Delete
** resources are deallocated.
[322] Fix | Delete
**
[323] Fix | Delete
** Ideally, applications should [sqlite3_finalize | finalize] all
[324] Fix | Delete
** [prepared statements], [sqlite3_blob_close | close] all [BLOB handles], and
[325] Fix | Delete
** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
[326] Fix | Delete
** with the [sqlite3] object prior to attempting to close the object.
[327] Fix | Delete
** ^If the database connection is associated with unfinalized prepared
[328] Fix | Delete
** statements, BLOB handlers, and/or unfinished sqlite3_backup objects then
[329] Fix | Delete
** sqlite3_close() will leave the database connection open and return
[330] Fix | Delete
** [SQLITE_BUSY]. ^If sqlite3_close_v2() is called with unfinalized prepared
[331] Fix | Delete
** statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups,
[332] Fix | Delete
** it returns [SQLITE_OK] regardless, but instead of deallocating the database
[333] Fix | Delete
** connection immediately, it marks the database connection as an unusable
[334] Fix | Delete
** "zombie" and makes arrangements to automatically deallocate the database
[335] Fix | Delete
** connection after all prepared statements are finalized, all BLOB handles
[336] Fix | Delete
** are closed, and all backups have finished. The sqlite3_close_v2() interface
[337] Fix | Delete
** is intended for use with host languages that are garbage collected, and
[338] Fix | Delete
** where the order in which destructors are called is arbitrary.
[339] Fix | Delete
**
[340] Fix | Delete
** ^If an [sqlite3] object is destroyed while a transaction is open,
[341] Fix | Delete
** the transaction is automatically rolled back.
[342] Fix | Delete
**
[343] Fix | Delete
** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]
[344] Fix | Delete
** must be either a NULL
[345] Fix | Delete
** pointer or an [sqlite3] object pointer obtained
[346] Fix | Delete
** from [sqlite3_open()], [sqlite3_open16()], or
[347] Fix | Delete
** [sqlite3_open_v2()], and not previously closed.
[348] Fix | Delete
** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer
[349] Fix | Delete
** argument is a harmless no-op.
[350] Fix | Delete
*/
[351] Fix | Delete
SQLITE_API int sqlite3_close(sqlite3*);
[352] Fix | Delete
SQLITE_API int sqlite3_close_v2(sqlite3*);
[353] Fix | Delete
[354] Fix | Delete
/*
[355] Fix | Delete
** The type for a callback function.
[356] Fix | Delete
** This is legacy and deprecated. It is included for historical
[357] Fix | Delete
** compatibility and is not documented.
[358] Fix | Delete
*/
[359] Fix | Delete
typedef int (*sqlite3_callback)(void*,int,char**, char**);
[360] Fix | Delete
[361] Fix | Delete
/*
[362] Fix | Delete
** CAPI3REF: One-Step Query Execution Interface
[363] Fix | Delete
** METHOD: sqlite3
[364] Fix | Delete
**
[365] Fix | Delete
** The sqlite3_exec() interface is a convenience wrapper around
[366] Fix | Delete
** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],
[367] Fix | Delete
** that allows an application to run multiple statements of SQL
[368] Fix | Delete
** without having to use a lot of C code.
[369] Fix | Delete
**
[370] Fix | Delete
** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
[371] Fix | Delete
** semicolon-separate SQL statements passed into its 2nd argument,
[372] Fix | Delete
** in the context of the [database connection] passed in as its 1st
[373] Fix | Delete
** argument. ^If the callback function of the 3rd argument to
[374] Fix | Delete
** sqlite3_exec() is not NULL, then it is invoked for each result row
[375] Fix | Delete
** coming out of the evaluated SQL statements. ^The 4th argument to
[376] Fix | Delete
** sqlite3_exec() is relayed through to the 1st argument of each
[377] Fix | Delete
** callback invocation. ^If the callback pointer to sqlite3_exec()
[378] Fix | Delete
** is NULL, then no callback is ever invoked and result rows are
[379] Fix | Delete
** ignored.
[380] Fix | Delete
**
[381] Fix | Delete
** ^If an error occurs while evaluating the SQL statements passed into
[382] Fix | Delete
** sqlite3_exec(), then execution of the current statement stops and
[383] Fix | Delete
** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec()
[384] Fix | Delete
** is not NULL then any error message is written into memory obtained
[385] Fix | Delete
** from [sqlite3_malloc()] and passed back through the 5th parameter.
[386] Fix | Delete
** To avoid memory leaks, the application should invoke [sqlite3_free()]
[387] Fix | Delete
** on error message strings returned through the 5th parameter of
[388] Fix | Delete
** sqlite3_exec() after the error message string is no longer needed.
[389] Fix | Delete
** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
[390] Fix | Delete
** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
[391] Fix | Delete
** NULL before returning.
[392] Fix | Delete
**
[393] Fix | Delete
** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
[394] Fix | Delete
** routine returns SQLITE_ABORT without invoking the callback again and
[395] Fix | Delete
** without running any subsequent SQL statements.
[396] Fix | Delete
**
[397] Fix | Delete
** ^The 2nd argument to the sqlite3_exec() callback function is the
[398] Fix | Delete
** number of columns in the result. ^The 3rd argument to the sqlite3_exec()
[399] Fix | Delete
** callback is an array of pointers to strings obtained as if from
[400] Fix | Delete
** [sqlite3_column_text()], one for each column. ^If an element of a
[401] Fix | Delete
** result row is NULL then the corresponding string pointer for the
[402] Fix | Delete
** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the
[403] Fix | Delete
** sqlite3_exec() callback is an array of pointers to strings where each
[404] Fix | Delete
** entry represents the name of corresponding result column as obtained
[405] Fix | Delete
** from [sqlite3_column_name()].
[406] Fix | Delete
**
[407] Fix | Delete
** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
[408] Fix | Delete
** to an empty string, or a pointer that contains only whitespace and/or
[409] Fix | Delete
** SQL comments, then no SQL statements are evaluated and the database
[410] Fix | Delete
** is not changed.
[411] Fix | Delete
**
[412] Fix | Delete
** Restrictions:
[413] Fix | Delete
**
[414] Fix | Delete
** <ul>
[415] Fix | Delete
** <li> The application must ensure that the 1st parameter to sqlite3_exec()
[416] Fix | Delete
** is a valid and open [database connection].
[417] Fix | Delete
** <li> The application must not close the [database connection] specified by
[418] Fix | Delete
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
[419] Fix | Delete
** <li> The application must not modify the SQL statement text passed into
[420] Fix | Delete
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
[421] Fix | Delete
** <li> The application must not dereference the arrays or string pointers
[422] Fix | Delete
** passed as the 3rd and 4th callback parameters after it returns.
[423] Fix | Delete
** </ul>
[424] Fix | Delete
*/
[425] Fix | Delete
SQLITE_API int sqlite3_exec(
[426] Fix | Delete
sqlite3*, /* An open database */
[427] Fix | Delete
const char *sql, /* SQL to be evaluated */
[428] Fix | Delete
int (*callback)(void*,int,char**,char**), /* Callback function */
[429] Fix | Delete
void *, /* 1st argument to callback */
[430] Fix | Delete
char **errmsg /* Error msg written here */
[431] Fix | Delete
);
[432] Fix | Delete
[433] Fix | Delete
/*
[434] Fix | Delete
** CAPI3REF: Result Codes
[435] Fix | Delete
** KEYWORDS: {result code definitions}
[436] Fix | Delete
**
[437] Fix | Delete
** Many SQLite functions return an integer result code from the set shown
[438] Fix | Delete
** here in order to indicate success or failure.
[439] Fix | Delete
**
[440] Fix | Delete
** New error codes may be added in future versions of SQLite.
[441] Fix | Delete
**
[442] Fix | Delete
** See also: [extended result code definitions]
[443] Fix | Delete
*/
[444] Fix | Delete
#define SQLITE_OK 0 /* Successful result */
[445] Fix | Delete
/* beginning-of-error-codes */
[446] Fix | Delete
#define SQLITE_ERROR 1 /* Generic error */
[447] Fix | Delete
#define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */
[448] Fix | Delete
#define SQLITE_PERM 3 /* Access permission denied */
[449] Fix | Delete
#define SQLITE_ABORT 4 /* Callback routine requested an abort */
[450] Fix | Delete
#define SQLITE_BUSY 5 /* The database file is locked */
[451] Fix | Delete
#define SQLITE_LOCKED 6 /* A table in the database is locked */
[452] Fix | Delete
#define SQLITE_NOMEM 7 /* A malloc() failed */
[453] Fix | Delete
#define SQLITE_READONLY 8 /* Attempt to write a readonly database */
[454] Fix | Delete
#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/
[455] Fix | Delete
#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */
[456] Fix | Delete
#define SQLITE_CORRUPT 11 /* The database disk image is malformed */
[457] Fix | Delete
#define SQLITE_NOTFOUND 12 /* Unknown opcode in sqlite3_file_control() */
[458] Fix | Delete
#define SQLITE_FULL 13 /* Insertion failed because database is full */
[459] Fix | Delete
#define SQLITE_CANTOPEN 14 /* Unable to open the database file */
[460] Fix | Delete
#define SQLITE_PROTOCOL 15 /* Database lock protocol error */
[461] Fix | Delete
#define SQLITE_EMPTY 16 /* Internal use only */
[462] Fix | Delete
#define SQLITE_SCHEMA 17 /* The database schema changed */
[463] Fix | Delete
#define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */
[464] Fix | Delete
#define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */
[465] Fix | Delete
#define SQLITE_MISMATCH 20 /* Data type mismatch */
[466] Fix | Delete
#define SQLITE_MISUSE 21 /* Library used incorrectly */
[467] Fix | Delete
#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */
[468] Fix | Delete
#define SQLITE_AUTH 23 /* Authorization denied */
[469] Fix | Delete
#define SQLITE_FORMAT 24 /* Not used */
[470] Fix | Delete
#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */
[471] Fix | Delete
#define SQLITE_NOTADB 26 /* File opened that is not a database file */
[472] Fix | Delete
#define SQLITE_NOTICE 27 /* Notifications from sqlite3_log() */
[473] Fix | Delete
#define SQLITE_WARNING 28 /* Warnings from sqlite3_log() */
[474] Fix | Delete
#define SQLITE_ROW 100 /* sqlite3_step() has another row ready */
[475] Fix | Delete
#define SQLITE_DONE 101 /* sqlite3_step() has finished executing */
[476] Fix | Delete
/* end-of-error-codes */
[477] Fix | Delete
[478] Fix | Delete
/*
[479] Fix | Delete
** CAPI3REF: Extended Result Codes
[480] Fix | Delete
** KEYWORDS: {extended result code definitions}
[481] Fix | Delete
**
[482] Fix | Delete
** In its default configuration, SQLite API routines return one of 30 integer
[483] Fix | Delete
** [result codes]. However, experience has shown that many of
[484] Fix | Delete
** these result codes are too coarse-grained. They do not provide as
[485] Fix | Delete
** much information about problems as programmers might like. In an effort to
[486] Fix | Delete
** address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8]
[487] Fix | Delete
** and later) include
[488] Fix | Delete
** support for additional result codes that provide more detailed information
[489] Fix | Delete
** about errors. These [extended result codes] are enabled or disabled
[490] Fix | Delete
** on a per database connection basis using the
[491] Fix | Delete
** [sqlite3_extended_result_codes()] API. Or, the extended code for
[492] Fix | Delete
** the most recent error can be obtained using
[493] Fix | Delete
** [sqlite3_extended_errcode()].
[494] Fix | Delete
*/
[495] Fix | Delete
#define SQLITE_ERROR_MISSING_COLLSEQ (SQLITE_ERROR | (1<<8))
[496] Fix | Delete
#define SQLITE_ERROR_RETRY (SQLITE_ERROR | (2<<8))
[497] Fix | Delete
#define SQLITE_ERROR_SNAPSHOT (SQLITE_ERROR | (3<<8))
[498] Fix | Delete
#define SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8))
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function