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

Function encodeUnnamedParseBind

packages/sql/pg/src/PgConnection.ts:1322–1334  ·  view source on GitHub ↗
(
  sql: string,
  parameters: ReadonlyArray<PgTypes.Parameter>,
  parameterTypes: ReadonlyArray<number>,
  encodeBind: BindEncoder,
  textResults = false
)

Source from the content-addressed store, hash-verified

1320type EncodeCycle = (cache: PreparedCache | undefined, output: Output) => Plan
1321
1322const encodeUnnamedParseBind = (
1323 sql: string,
1324 parameters: ReadonlyArray<PgTypes.Parameter>,
1325 parameterTypes: ReadonlyArray<number>,
1326 encodeBind: BindEncoder,
1327 textResults = false
1328): readonly [parse: Uint8Array, bind: Uint8Array] => {
1329 const parse = PgProtocol.encodeParse({ name: "", query: sql, parameterTypes })
1330 if (EffectResult.isFailure(parse)) throw parse.failure
1331 const bind = encodeBind({ portal: "", statement: "", parameters, textResults })
1332 if (EffectResult.isFailure(bind)) throw bind.failure
1333 return [parse.success, bind.success]
1334}
1335
1336/** The unnamed path: `Parse` / `Bind` / `Describe` / `Execute` / `Sync`. */
1337const encodeUnnamed = (

Callers 2

encodeUnnamedFunction · 0.85
encodeBatchFunction · 0.85

Calls 1

encodeBindFunction · 0.85

Tested by

no test coverage detected