MCPcopy Create free account
hub / github.com/effect-app/libs / run

Function run

repos/effect/packages/sql/sqlite-node/src/SqliteClient.ts:169–177  ·  view source on GitHub ↗
(
        sql: string,
        params: ReadonlyArray<unknown>,
        raw = false
      )

Source from the content-addressed store, hash-verified

167 raw: boolean
168 ) =>
169 Effect.withFiber<ReadonlyArray<any>, SqlError>((fiber) => {
170 const useSafeIntegers = Context.get(fiber.context, Client.SafeIntegers)
171 return Effect.try({
172 try: () => {
173 statement.setReadBigInts(useSafeIntegers)
174 if (statement.columns().length > 0) {
175 return statement.all(...(params as Array<any>)) as ReadonlyArray<any>
176 }
177 const result = statement.run(...(params as Array<any>))
178 return raw ? { changes: result.changes, lastInsertRowid: result.lastInsertRowid } as any : []
179 },
180 catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") })

Callers 3

layerFunction · 0.70
executeFunction · 0.70
executeRawFunction · 0.70

Calls 2

runStatementFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected