( db: DatabaseAdapter, sql: string, maxRows: number = 1000 )
| 352 | * 执行只读 SQL 查询(SQL Lab)— 保留向后兼容签名 |
| 353 | */ |
| 354 | export function executeReadonlySql( |
| 355 | db: DatabaseAdapter, |
| 356 | sql: string, |
| 357 | maxRows: number = 1000 |
| 358 | ): { columns: string[]; rows: Record<string, unknown>[]; rowCount: number; truncated: boolean } { |
| 359 | const result = executeSql(db, sql, { maxRows }) |
| 360 | return { |
| 361 | columns: result.columns, |
| 362 | rows: result.rows as Record<string, unknown>[], |
| 363 | rowCount: result.rowCount, |
| 364 | truncated: result.truncated, |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | // ==================== Unified SQL Execution ==================== |
| 369 |
no test coverage detected