hypershell.data


Access to low-level database objects and methods.


Functions


initdb(optimize: bool = False) None[source]

Initialize database tables.


checkdb() None[source]

Ensure database connection and tables exist.


ensuredb(auto_init: bool = False) None[source]

Ensure database configuration before applying any operations. If SQLite and auto_init we run initdb(), else checkdb().


truncatedb() None[source]

Truncate database tables.

Warning

This action is destructive, cannot be reversed, and proceeds without confirmation.


vacuumdb(path: str = None) None[source]

Apply database vacuum (optionally into backup location for SQLite).


rotatedb() None[source]

Split main database into next partition (SQLite only).


Constants


DATABASE_ENABLED: Final[bool] = True

Set if database has been configured.

DATABASE_PROVIDER: Final[str] = 'sqlite'

Either sqlite/turso or postgres.