Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function PgChainedBatch (db) {
debug('# new PgChainedBatch (db)')
AbstractChainedBatch.call(this, db)
// TODO: once queued batch exceeds some threshold create a temp table
// then flush batch ops to temp table periodically and clear ops
}
function PgBatch (db) {
AbstractChainedBatch.call(this, db)
this._qname = db._qname
this._connecting = true
const pool = this._pool = db._pool
pool.acquire((err, client) => {
this._connecting = false
if (err) return this._setError(err)
this._client = client
client.query('BEGIN', (err) => {
debug('PgBatch - begin transaction (err = %j)', err)
this._setError(err)
this._flush()
}).on('error', (err) => {