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

Function execWithLockConn

packages/cluster/src/SqlRunnerStorage.ts:244–251  ·  view source on GitHub ↗
(effect: Statement.Statement<A>)

Source from the content-addressed store, hash-verified

242 })
243
244 const execWithLockConn = <A>(effect: Statement.Statement<A>): Effect.Effect<unknown, SqlError> => {
245 if (!lockConn) return effect
246 const [query, params] = effect.compile()
247 return lockConn.await.pipe(
248 Effect.flatMap(([conn]) => conn.executeRaw(query, params)),
249 Effect.onError(() => lockConn.unsafeRebuild())
250 )
251 }
252 const execWithLockConnUnprepared = <A>(
253 effect: Statement.Statement<A>
254 ): Effect.Effect<ReadonlyArray<ReadonlyArray<any>>, SqlError> => {

Callers

nothing calls this directly

Calls 5

onErrorMethod · 0.80
unsafeRebuildMethod · 0.80
pipeMethod · 0.65
compileMethod · 0.45
executeRawMethod · 0.45

Tested by

no test coverage detected