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

Function runValues

packages/sql-sqlite-node/src/SqliteClient.ts:152–173  ·  view source on GitHub ↗
(
        sql: string,
        params: ReadonlyArray<unknown>
      )

Source from the content-addressed store, hash-verified

150 )
151
152 const runValues = (
153 sql: string,
154 params: ReadonlyArray<unknown>
155 ) =>
156 Effect.acquireUseRelease(
157 prepareCache.get(sql),
158 (statement) =>
159 Effect.try({
160 try: () => {
161 if (statement.reader) {
162 statement.raw(true)
163 return statement.all(...params) as ReadonlyArray<
164 ReadonlyArray<unknown>
165 >
166 }
167 statement.run(...params)
168 return []
169 },
170 catch: (cause) => new SqlError({ cause, message: "Failed to execute statement" })
171 }),
172 (statement) => Effect.sync(() => statement.reader && statement.raw(false))
173 )
174
175 return identity<SqliteConnection>({
176 execute(sql, params, transformRows) {

Callers 1

executeValuesFunction · 0.70

Calls 4

rawMethod · 0.80
syncMethod · 0.80
getMethod · 0.65
runMethod · 0.45

Tested by

no test coverage detected