(db: DatabaseAdapter)
| 178 | * 获取数据库中的表结构(Schema) |
| 179 | */ |
| 180 | export function getDatabaseSchema(db: DatabaseAdapter): Array<{ name: string; sql: string }> { |
| 181 | return db |
| 182 | .prepare("SELECT name, sql FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' ORDER BY name") |
| 183 | .all() as Array<{ name: string; sql: string }> |
| 184 | } |
| 185 | |
| 186 | // ==================== Chat Overview & Session Queries ==================== |
| 187 |
no test coverage detected