MCPcopy Create free account
hub / github.com/Effect-TS/effect / runStatementRaw

Function runStatementRaw

packages/sql/d1/src/D1Client.ts:246–259  ·  view source on GitHub ↗
(
        statement: D1PreparedStatement,
        params: ReadonlyArray<unknown> = []
      )

Source from the content-addressed store, hash-verified

244 })
245
246 const runStatementRaw = (
247 statement: D1PreparedStatement,
248 params: ReadonlyArray<unknown> = []
249 ): Effect.Effect<D1Result, SqlError, never> =>
250 Effect.tryPromise({
251 try: async () => {
252 const response = await statement.bind(...params).all()
253 if (response.error) {
254 throw response.error
255 }
256 return response
257 },
258 catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") })
259 })
260
261 const runStatement = (
262 statement: D1PreparedStatement,

Callers 2

runStatementFunction · 0.85
runRawFunction · 0.85

Calls 2

classifyErrorFunction · 0.70
allMethod · 0.65

Tested by

no test coverage detected