1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00
Oinktube/node_modules/leveldown/chained-batch.js

30 lines
758 B
JavaScript

'use strict'
const util = require('util')
const AbstractChainedBatch = require('abstract-leveldown').AbstractChainedBatch
const binding = require('./binding')
function ChainedBatch (db) {
AbstractChainedBatch.call(this, db)
this.context = binding.batch_init(db.context)
}
ChainedBatch.prototype._put = function (key, value) {
binding.batch_put(this.context, key, value)
}
ChainedBatch.prototype._del = function (key) {
binding.batch_del(this.context, key)
}
ChainedBatch.prototype._clear = function () {
binding.batch_clear(this.context)
}
ChainedBatch.prototype._write = function (options, callback) {
binding.batch_write(this.context, options, callback)
}
util.inherits(ChainedBatch, AbstractChainedBatch)
module.exports = ChainedBatch