DatabaseSQLite¶
- class dsviper.DatabaseSQLite¶
Bases:
objectA low-level class used to represent a CRUD like database based on SQLite3 through the Databasing interface.
Its own create_in_memory(), create(…) and open(…) answer this low-level object, which adds sqlite(); Database.create_in_memory(), Database.create(…) and Database.open(…) answer the high-level one.
Note: Not directly instantiable.
- close()¶
Close the database.
- static create(file_path: str, *, documentation: str | None = None) DatabaseSQLite¶
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() DatabaseSQLite¶
Create and return a database in memory.
- databasing() Databasing¶
Return the Databasing interface.
- 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) DatabaseSQLite¶
Open the database at file_path and return it.
readonly opens it without allowing a write.
Requires a file at file_path, and raises when there is none.