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

Class Stmt

packages/core/src/query/advanced/__tests__/ranking.test.ts:28–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26import type { DatabaseAdapter, PreparedStatement, RunResult } from '../../../interfaces'
27
28class Stmt implements PreparedStatement {
29 readonly?: boolean
30 constructor(private stmt: Database.Statement) {
31 this.readonly = stmt.readonly
32 }
33 get(...p: unknown[]) {
34 return this.stmt.get(...p) as Record<string, unknown> | undefined
35 }
36 all(...p: unknown[]) {
37 return this.stmt.all(...p) as Record<string, unknown>[]
38 }
39 run(...p: unknown[]): RunResult {
40 const r = this.stmt.run(...p)
41 return { changes: r.changes, lastInsertRowid: r.lastInsertRowid }
42 }
43}
44
45class Adapter implements DatabaseAdapter {
46 constructor(private db: Database.Database) {}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected