* Get current schema version
()
| 161 | * Get current schema version |
| 162 | */ |
| 163 | getSchemaVersion(): SchemaVersion | null { |
| 164 | const row = this.db |
| 165 | .prepare('SELECT version, applied_at, description FROM schema_versions ORDER BY version DESC LIMIT 1') |
| 166 | .get() as { version: number; applied_at: number; description: string | null } | undefined; |
| 167 | |
| 168 | if (!row) return null; |
| 169 | |
| 170 | return { |
| 171 | version: row.version, |
| 172 | appliedAt: row.applied_at, |
| 173 | description: row.description ?? undefined, |
| 174 | }; |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Execute a function within a transaction |
no test coverage detected