snews_cs.database

Attributes

log

db_file_path

Classes

Database

Module Contents

snews_cs.database.log[source]
snews_cs.database.db_file_path[source]
class snews_cs.database.Database(db_file_path: pathlib.Path | str)[source]
db_file_path[source]
engine[source]
connection[source]
cursor[source]
initialize_database(sql_schema_path: pathlib.Path | str) None[source]

Initialize the database with the given SQL schema.

show_tables() list[tuple[str]][source]

Returns all tables in the SQL database.

get_table_schema(table_name: str) list[tuple[str]][source]

Returns the schema for a given table.

drop_tables(table_names: list[str] | None = None) None[source]

Drops all tables in the SQL database.