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

Class Stmt

packages/core/src/query/__tests__/basic-queries.test.ts:17–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected