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

Function runValues

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

Source from the content-addressed store, hash-verified

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

Callers 1

executeValuesFunction · 0.70

Calls 4

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

Tested by

no test coverage detected