← Về thư mục
openai4s/storage/migrations.py
- MigrationError · class · L72-L73 — class MigrationError(RuntimeError)
- FutureSchemaError · class · L76-L87 — class FutureSchemaError(MigrationError)
- init · method · L81-L87 — def init(self, actual_version: int, supported_version: int)
- require_supported_schema · function · L90-L96 — def require_supported_schema( conn: sqlite3.Connection, *, target: int = SCHEMA_VERSION ) -> int
- preflight_schema · function · L99-L124 — def preflight_schema(db_path: Path, *, target: int = SCHEMA_VERSION) -> int | None
- _is_readonly_refusal · function · L127-L138 — def _is_readonly_refusal(error: sqlite3.OperationalError) -> bool
- apply_ddl_script · function · L141-L166 — def apply_ddl_script(conn: sqlite3.Connection, script: str) -> None
- _is_duplicate_column · function · L169-L179 — def _is_duplicate_column(exc: sqlite3.OperationalError) -> bool
- current_version · function · L182-L189 — def current_version(conn: sqlite3.Connection) -> int
- applied_migrations · function · L192-L208 — def applied_migrations(conn: sqlite3.Connection) -> list[dict]
- checksum · function · L211-L216 — def checksum(*parts: str) -> str
- integrity_ok · function · L219-L229 — def integrity_ok(conn: sqlite3.Connection) -> bool
- backup_database · function · L232-L265 — def backup_database(db_path: Path, version: int) -> Path | None
- run_migrations · function · L268-L349 — def run_migrations( conn: sqlite3.Connection, db_path: Path, steps: dict[int, tuple[str, Callable[[sqlite3.Connection], None]]], *, target: int = SCHEMA_VERSION, ) -> dict