Small. Fast. Reliable.
Choose any three.

SQLite C Interface

Closing A Database Connection

int sqlite3_close(sqlite3 *);

This routine is the destructor for the sqlite3 object.

Applications should finalize all prepared statements and close all BLOBs associated with the sqlite3 object prior to attempting to close the sqlite3 object.

(TODO: What happens to pending transactions? Are they rolled back, or abandoned?)

Invariants:

F12011 The sqlite3_close() interface destroys an sqlite3 object allocated by a prior call to sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
F12012 The sqlite3_close() function releases all memory used by the connection and closes all open files.
F12013 If the database connection contains prepared statements that have not been finalized by sqlite3_finalize(), then sqlite3_close() returns SQLITE_BUSY and leaves the connection open.
F12014 Giving sqlite3_close() a NULL pointer is a harmless no-op.

Limitations:

U12015 The parameter to sqlite3_close() must be an sqlite3 object pointer previously obtained from sqlite3_open() or the equivalent, or NULL.
U12016 The parameter to sqlite3_close() must not have been previously closed.

See also lists of Objects, Constants, and Functions.


This page last modified 2008/01/31 20:37:13 UTC