How to use pg-copy-streams-binary - 1 common examples

To help you get started, we’ve selected a few pg-copy-streams-binary examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gajus / slonik / src / utilities / encodeTupleList.js View on Github external
return new Promise((resolve, reject) => {
    const concatStream = createConcatStream((payloadBuffer) => {
      resolve(payloadBuffer);
    });

    const encode = createEncoder();

    const tupleStream = new Readable({
      objectMode: true,
    });

    tupleStream
      .pipe(encode)
      .pipe(concatStream)
      .on('error', (error) => {
        reject(error);
      });

    let lastTupleSize;

    for (const tuple of tupleList) {
      if (typeof lastTupleSize === 'number' && lastTupleSize !== tuple.length) {

pg-copy-streams-binary

Streams for parsing and deparsing the COPY binary format

MIT
Latest version published 3 years ago

Package Health Score

47 / 100
Full package analysis

Popular pg-copy-streams-binary functions

Similar packages