* Get current schema version
()
| 658 | * Get current schema version |
| 659 | */ |
| 660 | getSchemaVersion(): SchemaVersion | null { |
| 661 | const row = this.db |
| 662 | .prepare('SELECT version, applied_at, description FROM schema_versions ORDER BY version DESC LIMIT 1') |
| 663 | .get() as { version: number; applied_at: number; description: string | null } | undefined; |
| 664 | |
| 665 | if (!row) return null; |
| 666 | |
| 667 | return { |
| 668 | version: row.version, |
| 669 | appliedAt: row.applied_at, |
| 670 | description: row.description ?? undefined, |
| 671 | }; |
| 672 | } |
| 673 | |
| 674 | /** |
| 675 | * Execute a function within a transaction |