* Get current schema version
()
| 398 | * Get current schema version |
| 399 | */ |
| 400 | getSchemaVersion(): SchemaVersion | null { |
| 401 | const row = this.db |
| 402 | .prepare('SELECT version, applied_at, description FROM schema_versions ORDER BY version DESC LIMIT 1') |
| 403 | .get() as { version: number; applied_at: number; description: string | null } | undefined; |
| 404 | |
| 405 | if (!row) return null; |
| 406 | |
| 407 | return { |
| 408 | version: row.version, |
| 409 | appliedAt: row.applied_at, |
| 410 | description: row.description ?? undefined, |
| 411 | }; |
| 412 | } |
| 413 | |
| 414 | /** |
| 415 | * Execute a function within a transaction |
no test coverage detected