Name
sqlite3_close() — Close a database connection
Definition
int sqlite3_close( sqlite3* db );
-
db A database connection. A NULL may be safely passed to this function (resulting in a no-op).
- Returns
An SQLite result code.
Description
This function closes a database connection and releases all the resources associated with it. The application is responsible for finalizing all prepared statements and closing all BLOB handles. If the database connection is currently in a transaction, it will be rolled back before the database(s) are closed. All attached databases will automatically be detached.
If an application fails to finalize a prepared statement, the
close will fail and SQLITE_BUSY will be returned. The statement
must be finalized and sqlite3_close() must be called again.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access