(sql: string)
| 122 | // measured at ~12ns/call against real node:sqlite (negligible). |
| 123 | // biome-ignore lint/suspicious/noExplicitAny: node:sqlite StatementSync has no shipped types here. |
| 124 | prepare(sql: string): any { |
| 125 | const stmt = super.prepare(sql); |
| 126 | for (const method of ["run", "get", "all"] as const) { |
| 127 | const original = stmt[method].bind(stmt); |
| 128 | stmt[method] = (...args: unknown[]): unknown => |
| 129 | args.length === 1 && Array.isArray(args[0]) |
| 130 | ? original(...args[0]) |
| 131 | : original(...args); |
| 132 | } |
| 133 | return stmt; |
| 134 | } |
| 135 | |
| 136 | // biome-ignore lint/suspicious/noExplicitAny: mirrors better-sqlite3's generic transaction(fn) signature. |
| 137 | transaction<F extends (...args: any[]) => any>(fn: F): F { |
no outgoing calls