( statements: ReadonlyArray<BatchStatement>, registry: PgTypes.Registry | undefined, encodeBind: BindEncoder )
| 1375 | * and is never retried. |
| 1376 | */ |
| 1377 | const encodeBatch = ( |
| 1378 | statements: ReadonlyArray<BatchStatement>, |
| 1379 | registry: PgTypes.Registry | undefined, |
| 1380 | encodeBind: BindEncoder |
| 1381 | ): Plan => { |
| 1382 | const chunks: Array<Uint8Array> = [] |
| 1383 | for (const statement of statements) { |
| 1384 | const { parameterTypes, parameters } = inferParameters(statement.params ?? emptyParams, registry) |
| 1385 | const [parse, bind] = encodeUnnamedParseBind(statement.sql, parameters, parameterTypes, encodeBind) |
| 1386 | chunks.push(parse, bind, describeExecute) |
| 1387 | } |
| 1388 | chunks.push(sync) |
| 1389 | return { |
| 1390 | frame: concat(chunks), |
| 1391 | closes: 0, |
| 1392 | parses: true, |
| 1393 | describes: true, |
| 1394 | prepared: undefined, |
| 1395 | description: undefined, |
| 1396 | stale: false, |
| 1397 | statements: statements.length |
| 1398 | } |
| 1399 | } |
| 1400 | |
| 1401 | /** |
| 1402 | * Builds one extended-query cycle as a single buffer, so a statement costs one |
no test coverage detected