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4.12.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/pg-query-stream@4.12.0/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nconst stream_1 = require(\"stream\");\nconst pg_cursor_1 = __importDefault(require(\"pg-cursor\"));\nclass QueryStream extends stream_1.Readable {\n    constructor(text, values, config = {}) {\n        const { batchSize, highWaterMark = 100 } = config;\n        super({ objectMode: true, autoDestroy: true, highWaterMark: batchSize || highWaterMark });\n        this.cursor = new pg_cursor_1.default(text, values, config);\n        // delegate Submittable callbacks to cursor\n        this.handleRowDescription = this.cursor.handleRowDescription.bind(this.cursor);\n        this.handleDataRow = this.cursor.handleDataRow.bind(this.cursor);\n        this.handlePortalSuspended = this.cursor.handlePortalSuspended.bind(this.cursor);\n        this.handleCommandComplete = this.cursor.handleCommandComplete.bind(this.cursor);\n        this.handleReadyForQuery = this.cursor.handleReadyForQuery.bind(this.cursor);\n        this.handleError = this.cursor.handleError.bind(this.cursor);\n        this.handleEmptyQuery = this.cursor.handleEmptyQuery.bind(this.cursor);\n        // pg client sets types via _result property\n        this._result = this.cursor._result;\n    }\n    submit(connection) {\n        this.cursor.submit(connection);\n    }\n    _destroy(_err, cb) {\n        this.cursor.close((err) => {\n            cb(err || _err);\n        });\n    }\n    // https://nodejs.org/api/stream.html#stream_readable_read_size_1\n    _read(size) {\n        this.cursor.read(size, (err, rows) => {\n            if (err) {\n                // https://nodejs.org/api/stream.html#stream_errors_while_reading\n                this.destroy(err);\n            }\n            else {\n                for (const row of rows)\n                    this.push(row);\n                if (rows.length < size)\n                    this.push(null);\n            }\n        });\n    }\n}\nmodule.exports = QueryStream;\n"]}