MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / executeReadonlySql

Function executeReadonlySql

packages/core/src/query/message-queries.ts:354–366  ·  view source on GitHub ↗
(
  db: DatabaseAdapter,
  sql: string,
  maxRows: number = 1000
)

Source from the content-addressed store, hash-verified

352 * 执行只读 SQL 查询(SQL Lab)— 保留向后兼容签名
353 */
354export 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

Callers 3

executeSqlMethod · 0.90
cli.tsFile · 0.90

Calls 1

executeSqlFunction · 0.70

Tested by

no test coverage detected