smah.database

class smah.database.Database(args)[source]

Bases: object

DEFAULT_DATABASE = '/home/docs/.smah/smah.db'
append_to_chat(session_id: int, messages: list) None[source]
static args_to_dict(args: Namespace) dict[source]
static default_database() str[source]
history(limit: int = 10)[source]
last_session()[source]
save_chat(title: str, args: Namespace, plan: dict, messages: list, pipe: str | None = None) None[source]
session(session_id: int)[source]
class smah.database.Migration[source]

Bases: object

MIGRATIONS_DIR = '/home/docs/checkouts/readthedocs.org/user_builds/smah/checkouts/stable/smah/database/migrations'
static apply_migration(database: Database, migration: dict, silent: bool = False, exit_on_finish: bool = True) tuple[source]
static create(name: str) None[source]
static get_migrations()[source]
static get_schema_migrations(database: Database)[source]
static migrate(database: Database, args: Namespace, silent: bool = False, exit_on_finish: bool = True) tuple[source]
static rollback(database: Database, args: Namespace)[source]
static rollback_migration(database: Database, migration: dict, silent: bool = False, exit_on_finish: bool = True) tuple[source]
static status(database: Database)[source]

Modules

database

migration