MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / Stmt

Class Stmt

packages/tools/src/providers/core-data-provider.test.ts:18–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16import { openTestSqliteDatabase } from '../../../../tests/helpers/sqlite.mts'
17
18class Stmt implements PreparedStatement {
19 readonly?: boolean
20 constructor(private stmt: Database.Statement) {
21 this.readonly = stmt.readonly
22 }
23 get(...p: unknown[]) {
24 return this.stmt.get(...p) as Record<string, unknown> | undefined
25 }
26 all(...p: unknown[]) {
27 return this.stmt.all(...p) as Record<string, unknown>[]
28 }
29 run(...p: unknown[]): RunResult {
30 const r = this.stmt.run(...p)
31 return { changes: r.changes, lastInsertRowid: r.lastInsertRowid }
32 }
33}
34
35class Adapter implements DatabaseAdapter {
36 constructor(private db: Database.Database) {}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected