MCPcopy Create free account
hub / github.com/anomalyco/opencode / run

Function run

packages/effect-sqlite-node/src/index.ts:72–85  ·  view source on GitHub ↗
(sql: string, params: ReadonlyArray<unknown> = [])

Source from the content-addressed store, hash-verified

70 }
71
72 const run = (sql: string, params: ReadonlyArray<unknown> = []) =>
73 Effect.withFiber<Array<Record<string, unknown>>, SqlError>((fiber) => {
74 const statement = db.prepare(sql)
75 statement.setReadBigInts(Context.get(fiber.context, Client.SafeIntegers))
76 try {
77 return Effect.succeed(statement.all(...(params as SQLInputValue[])) as Array<Record<string, unknown>>)
78 } catch (cause) {
79 return Effect.fail(
80 new SqlError({
81 reason: classifySqliteError(cause, { message: "Failed to execute statement", operation: "execute" }),
82 }),
83 )
84 }
85 })
86
87 const runValues = (sql: string, params: ReadonlyArray<unknown> = []) =>
88 Effect.withFiber<ReadonlyArray<ReadonlyArray<unknown>>, SqlError>((fiber) => {

Callers 2

executeFunction · 0.70
executeRawFunction · 0.70

Calls 3

getMethod · 0.65
prepareMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected