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

Method executeBatch

packages/sql/libsql/src/LibsqlClient.ts:266–280  ·  view source on GitHub ↗
(statements: ReadonlyArray<readonly [sql: string, params: ReadonlyArray<unknown>]>)

Source from the content-addressed store, hash-verified

264 return this.execute(sql, params, transformRows)
265 }
266 executeBatch(statements: ReadonlyArray<readonly [sql: string, params: ReadonlyArray<unknown>]>) {
267 return Effect.map(
268 Effect.tryPromise({
269 // Take the write lock up front, as `beginTransaction` does. A
270 // `Transaction` ignores the mode.
271 try: () =>
272 (this.sdk as Libsql.Client).batch(
273 statements.map(([sql, params]) => ({ sql, args: params as Array<any> })),
274 "write"
275 ),
276 catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to execute batch", "execute") })
277 }),
278 (results) => results.map((result) => result.rows)
279 )
280 }
281 executeStream() {
282 return Stream.die("executeStream not implemented")
283 }

Callers

nothing calls this directly

Calls 2

classifyErrorFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected