MCPcopy Index your code
hub / github.com/Effect-TS/effect / runStatement

Function runStatement

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

Source from the content-addressed store, hash-verified

90 })
91
92 const runStatement = (
93 statement: D1PreparedStatement,
94 params: ReadonlyArray<unknown> = []
95 ): Effect.Effect<ReadonlyArray<any>, SqlError, never> =>
96 Effect.tryPromise({
97 try: async () => {
98 const response = await statement.bind(...params).all()
99 if (response.error) {
100 throw response.error
101 }
102 return response.results || []
103 },
104 catch: (cause) => new SqlError({ cause, message: `Failed to execute statement` })
105 })
106
107 const runRaw = (
108 sql: string,

Callers 2

runRawFunction · 0.70
runCachedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected