How to use the abstract-leveldown/abstract-chained-batch.call function in abstract-leveldown

To help you get started, we’ve selected a few abstract-leveldown 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 ralphtheninja / pgdown / pg-chained-batch.js View on Github external
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
}
github ralphtheninja / pgdown / pgbatch.js View on Github external
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) => {