⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sqlite3.h

📁 一个小型嵌入式数据库SQLite的源码,C语言
💻 H
📖 第 1 页 / 共 5 页
字号:
int sqlite3_create_collation16(  sqlite3*,   const char *zName,   int eTextRep,   void*,  int(*xCompare)(void*,int,const void*,int,const void*));/*** To avoid having to register all collation sequences before a database** can be used, a single callback function may be registered with the** database handle to be called whenever an undefined collation sequence is** required.**** If the function is registered using the sqlite3_collation_needed() API,** then it is passed the names of undefined collation sequences as strings** encoded in UTF-8. If sqlite3_collation_needed16() is used, the names** are passed as UTF-16 in machine native byte order. A call to either** function replaces any existing callback.**** When the user-function is invoked, the first argument passed is a copy** of the second argument to sqlite3_collation_needed() or** sqlite3_collation_needed16(). The second argument is the database** handle. The third argument is one of SQLITE_UTF8, SQLITE_UTF16BE or** SQLITE_UTF16LE, indicating the most desirable form of the collation** sequence function required. The fourth parameter is the name of the** required collation sequence.**** The collation sequence is returned to SQLite by a collation-needed** callback using the sqlite3_create_collation() or** sqlite3_create_collation16() APIs, described above.*/int sqlite3_collation_needed(  sqlite3*,   void*,   void(*)(void*,sqlite3*,int eTextRep,const char*));int sqlite3_collation_needed16(  sqlite3*,   void*,  void(*)(void*,sqlite3*,int eTextRep,const void*));/*** Specify the key for an encrypted database.  This routine should be** called right after sqlite3_open().**** The code to implement this API is not available in the public release** of SQLite.*/int sqlite3_key(  sqlite3 *db,                   /* Database to be rekeyed */  const void *pKey, int nKey     /* The key */);/*** Change the key on an open database.  If the current database is not** encrypted, this routine will encrypt it.  If pNew==0 or nNew==0, the** database is decrypted.**** The code to implement this API is not available in the public release** of SQLite.*/int sqlite3_rekey(  sqlite3 *db,                   /* Database to be rekeyed */  const void *pKey, int nKey     /* The new key */);/*** Sleep for a little while. The second parameter is the number of** miliseconds to sleep for. **** If the operating system does not support sleep requests with ** milisecond time resolution, then the time will be rounded up to ** the nearest second. The number of miliseconds of sleep actually ** requested from the operating system is returned.*/int sqlite3_sleep(int);/*** Return TRUE (non-zero) if 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.***/int sqlite3_expired(sqlite3_stmt*);/*** Move all bindings from the first prepared statement over to the second.** This routine is useful, for example, if the first prepared statement** fails with an SQLITE_SCHEMA error.  The same SQL can be prepared into** the second prepared statement then all of the bindings transfered over** to the second statement before the first statement is finalized.*/int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);/*** If the following global variable is made to point to a** string which is the name of a directory, then all temporary files** created by SQLite will be placed in that directory.  If this variable** is NULL pointer, then SQLite does a search for an appropriate temporary** file directory.**** Once sqlite3_open() has been called, changing this variable will invalidate** the current temporary database, if any.*/extern char *sqlite3_temp_directory;/*** This function is called to recover from a malloc() failure that occured** within the SQLite library. Normally, after a single malloc() fails the ** library refuses to function (all major calls return SQLITE_NOMEM).** This function restores the library state so that it can be used again.**** All existing statements (sqlite3_stmt pointers) must be finalized or** reset before this call is made. Otherwise, SQLITE_BUSY is returned.** If any in-memory databases are in use, either as a main or TEMP** database, SQLITE_ERROR is returned. In either of these cases, the ** library is not reset and remains unusable.**** This function is *not* threadsafe. Calling this from within a threaded** application when threads other than the caller have used SQLite is** dangerous and will almost certainly result in malfunctions.**** This functionality can be omitted from a build by defining the ** SQLITE_OMIT_GLOBALRECOVER at compile time.*/int sqlite3_global_recover(void);/*** 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.*/int sqlite3_get_autocommit(sqlite3*);/*** 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.*/sqlite3 *sqlite3_db_handle(sqlite3_stmt*);/*** Register a callback function with the database connection identified by the ** first argument to be invoked whenever a row is updated, inserted or deleted.** Any callback set by a previous call to this function for the same ** database connection is overridden.**** The second argument is a pointer to the function to invoke when a ** row is updated, inserted or deleted. The first argument to the callback is** a copy of the third argument to sqlite3_update_hook. The second callback ** argument is one of SQLITE_INSERT, SQLITE_DELETE or SQLITE_UPDATE, depending** on the operation that caused the callback to be invoked. The third and ** fourth arguments to the callback contain pointers to the database and ** table name containing the affected row. The final callback parameter is ** the rowid of the row. In the case of an update, this is the rowid after ** the update takes place.**** The update hook is not invoked when internal system tables are** modified (i.e. sqlite_master and sqlite_sequence).**** If another function was previously registered, its pArg value is returned.** Otherwise NULL is returned.*/void *sqlite3_update_hook(  sqlite3*,   void(*)(void *,int ,char const *,char const *,sqlite_int64),  void*);/*** Register a callback to be invoked whenever a transaction is rolled** back. **** The new callback function overrides any existing rollback-hook** callback. If there was an existing callback, then it's pArg value ** (the third argument to sqlite3_rollback_hook() when it was registered) ** is returned. Otherwise, NULL is returned.**** For the purposes of this API, a transaction is said to have been ** rolled back if an explicit "ROLLBACK" statement is executed, or** an error or constraint causes an implicit rollback to occur. The ** callback is not invoked if a transaction is automatically rolled** back because the database connection is closed.*/void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);/*** This function is only available if the library is compiled without** the SQLITE_OMIT_SHARED_CACHE macro defined. It is used to enable or** disable (if the argument is true or false, respectively) the ** "shared pager" feature.*/int sqlite3_enable_shared_cache(int);/*** Attempt to free N bytes of heap memory by deallocating non-essential** memory allocations held by the database library (example: memory ** used to cache database pages to improve performance).**** This function is not a part of standard builds.  It is only created** if SQLite is compiled with the SQLITE_ENABLE_MEMORY_MANAGEMENT macro.*/int sqlite3_release_memory(int);/*** Place a "soft" limit on the amount of heap memory that may be allocated by** SQLite within the current thread. If an internal allocation is requested ** that would exceed the specified limit, sqlite3_release_memory() is invoked** one or more times to free up some space before the allocation is made.**** The limit is called "soft", because if sqlite3_release_memory() cannot free** sufficient memory to prevent the limit from being exceeded, the memory is** allocated anyway and the current operation proceeds.**** This function is only available if the library was compiled with the ** SQLITE_ENABLE_MEMORY_MANAGEMENT option set.** memory-management has been enabled.*/void sqlite3_soft_heap_limit(int);/*** This routine makes sure that all thread-local storage has been** deallocated for the current thread.**** This routine is not technically necessary.  All thread-local storage** will be automatically deallocated once memory-management and** shared-cache are disabled and the soft heap limit has been set** to zero.  This routine is provided as a convenience for users who** want to make absolutely sure they have not forgotten something** prior to killing off a thread.*/void sqlite3_thread_cleanup(void);/*** Return meta information about a specific column of a specific database** table accessible using the connection handle passed as the first function ** argument.**** The column is identified by the second, third and fourth parameters to ** this function. The second parameter is either the name of the database** (i.e. "main", "temp" or an attached database) containing the specified** table or NULL. If it is NULL, then all attached databases are searched** for the table using the same algorithm as the database engine uses to ** resolve unqualified table references.**** The third and fourth parameters to this function are the table and column ** name of the desired column, respectively. Neither of these parameters ** may be NULL.**** Meta information is returned by writing to the memory locations passed as** the 5th and subsequent parameters to this function. Any of these ** arguments may be NULL, in which case the corresponding element of meta ** information is ommitted.**** Parameter     Output Type      Description** -----------------------------------****   5th         const char*      Data type**   6th         const char*      Name of the default collation sequence **   7th         int              True if the column has a NOT NULL constraint**   8th         int              True if the column is part of the PRIMARY KEY**   9th         int              True if the column is AUTOINCREMENT****** The memory pointed to by the character pointers returned for the ** declaration type and collation sequence is valid only until the next ** call to any sqlite API function.**** If the specified table is actually a view, then an error is returned.**** If the specified column is "rowid", "oid" or "_rowid_" and an ** INTEGER PRIMARY KEY column has been explicitly declared, then the output ** parameters are set for the explicitly declared column. If there is no** explicitly declared IPK column, then the output parameters are set as ** follows:****     data type: "INTEGER"**     collation sequence: "BINARY"**     not null: 0**     primary key: 1**     auto increment: 0**** This function may load one or more schemas from database files. If an** error occurs during this process, or if the requested table or column** cannot be found, an SQLITE error code is returned and an error message** left in the database handle (to be retrieved using sqlite3_errmsg()).**** This API is only available if the library was compiled with the** SQLITE_ENABLE_COLUMN_METADATA preprocessor symbol defined.*/int sqlite3_table_column_metadata(  sqlite3 *db,                /* Connection handle */  const char *zDbName,        /* Database name or NULL */  const char *zTableName,     /* Table name */  const char *zColumnName,    /* 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -