CommitDatabaseSQLite¶
- class dsviper.CommitDatabaseSQLite¶
Bases:
objectA low-level class used to represent the database based on SQLite3 through the CommitDatabasing interface. Use the high-level static factory method CommitDatabase.create(…) or CommitDatabase.open(…).
Note: Not directly instantiable.
- begin_transaction() None¶
Create a transaction to boost the creation of many blobs.
Transactions do not nest: calling this while in_transaction() is True raises, and the transaction already open is untouched.
- close() None¶
Close the database.
- commit() None¶
Commit the transaction, so what it wrote stays.
Raises when no transaction is open.
- commit_databasing() CommitDatabasing¶
Return the CommitDatabasing interface.
- static create(file_path: str, *, documentation: str | None = None) CommitDatabaseSQLite¶
Create a database at file_path and return it.
documentation is stored in the file and read back by documentation().
Requires that nothing exist at file_path, and raises without creating anything when something does.
- static create_in_memory() CommitDatabaseSQLite¶
Create a database in memory.
- in_transaction() bool¶
Return True if a transaction is running.
- is_closed() bool¶
Return True if the database is closed.
- static is_compatible(file_path: str) bool¶
Return True if the file at file_path carries the expected SQL schema.
- static open(file_path: str, readonly: bool = False) CommitDatabaseSQLite¶
Open the database at file_path and return it.
readonly opens it without allowing a commit.
Requires a file at file_path, and raises when there is none.
- rollback() None¶
Roll back the transaction, so what it wrote is dropped.
Raises when no transaction is open.