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

Function runValues

repos/effect/packages/sql/d1/src/D1Client.ts:151–168  ·  view source on GitHub ↗
(
        sql: string,
        params: ReadonlyArray<unknown>
      )

Source from the content-addressed store, hash-verified

149 const transforms: Array<TransformRows | undefined> = []
150 const queryTexts: Array<string> = []
151
152 for (const original of statements) {
153 const statement = transformer === undefined
154 ? original
155 : yield* transformer(original, options.getClient(), fiber, span)
156 const [sql, params] = statement.compile()
157 queryTexts.push(sql)
158 transforms.push((statement as StatementWithTransformRows).transformRows)
159 prepared.push((yield* Cache.get(options.prepareCache, sql)).bind(...params))
160 }
161
162 for (const [key, value] of options.spanAttributes) {
163 span.attribute(key, value)
164 }
165 span.attribute(ATTR_DB_OPERATION_NAME, "batch")
166 span.attribute(ATTR_DB_QUERY_TEXT, queryTexts.join("; "))
167
168 // D1 batches execute on the binding directly and intentionally cannot participate in SqlClient transactions.
169 const responses = yield* Effect.tryPromise({
170 try: () =>
171 options.db.batch<Record<string, unknown>>(prepared).then((responses) => {

Callers 1

executeValuesFunction · 0.70

Calls 3

rawMethod · 0.80
classifyErrorFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…