* Get current schema version
()
| 431 | * Get current schema version |
| 432 | */ |
| 433 | getSchemaVersion(): SchemaVersion | null { |
| 434 | const row = this.db |
| 435 | .prepare('SELECT version, applied_at, description FROM schema_versions ORDER BY version DESC LIMIT 1') |
| 436 | .get() as { version: number; applied_at: number; description: string | null } | undefined; |
| 437 | |
| 438 | if (!row) return null; |
| 439 | |
| 440 | return { |
| 441 | version: row.version, |
| 442 | appliedAt: row.applied_at, |
| 443 | description: row.description ?? undefined, |
| 444 | }; |
| 445 | } |
| 446 | |
| 447 | /** |
| 448 | * Execute a function within a transaction |
no test coverage detected