1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 10:19:24 +02:00
Oinktube/node_modules/leveldown/chained-batch.js
2022-07-15 11:08:01 -03:00

28 lines
744 B
JavaScript

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