The lock_status
pragma lists all of the databases
in a connection and their current lock status. The result set
will contain one row for each attached database.
The following locking states may be indicated:
Value | Meaning |
---|---|
unlocked
| Database has no locks |
shared
| Database has a shared read lock |
reserved
| Database has the reserved write-enable lock |
pending
| Database has the pending write-enable lock |
exclusive
| Database has the exclusive write lock |
closed
| Database file is not open |
unknown
| Lock state is not known |
The first five states correspond to
the standard locks SQLite uses to maintain read and write
transactions. The closed
value is normally returned when a brand new database file has
been created, but it has not yet been initialized. Since the
locking is done through the filesystem, any database that does
not have an associated file will return unknown
. This includes both in-memory
databases, as well as some temporary databases.
SQLite must be compiled with the
SQLITE_DEBUG
directive
for this pragma to be included.
schema_version, journal_mode, journal_size_limit, ATTACH DATABASE [SQL Cmd, Ap C], DETACH DATABASE [SQL Cmd, Ap C]