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

Function run

packages/core/src/database/sqlite.node.ts:56–69  ·  view source on GitHub ↗
(query: string, params: ReadonlyArray<unknown> = [])

Source from the content-addressed store, hash-verified

54 : undefined
55
56 const run = (query: string, params: ReadonlyArray<unknown> = []) =>
57 Effect.withFiber<Array<Record<string, unknown>>, SqlError>((fiber) => {
58 const statement = native.prepare(query)
59 statement.setReadBigInts(Context.get(fiber.context, Client.SafeIntegers))
60 try {
61 return Effect.succeed(statement.all(...(params as SQLInputValue[])) as Array<Record<string, unknown>>)
62 } catch (cause) {
63 return Effect.fail(
64 new SqlError({
65 reason: classifySqliteError(cause, { message: "Failed to execute statement", operation: "execute" }),
66 }),
67 )
68 }
69 })
70
71 const runValues = (query: string, params: ReadonlyArray<unknown> = []) =>
72 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