Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function ldgapIterator (db, options) {
AbstractIterator.call(this, db)
var emptybuffer = new Buffer(0)
this._dbsize = this.db.container.length();
this._reverse = !!options.reverse
// Test for empty buffer in end
if(options.end instanceof Buffer){
if(options.end.length = 0)
this._end = this.db.container.key(this._dbsize - 1)
}else{
this._end = options.end
}
this._limit = options.limit
this._count = 0
function Iterator (db, options) {
AbstractIterator.call(this, db)
this.context = binding.iterator_init(db.context, options)
this.cache = null
this.finished = false
}
var MongoIterator = function (db, options) {
AbstractIterator.call(this, db);
if (options.limit === 0) return;
this._options = options;
var query = { _id: {} };
if (options.reverse) {
if (options.start) query._id.$lte = options.start;
if (options.end) query._id.$gte = options.end;
if (options.gt) query._id.$lt = options.gt;
if (options.gte) query._id.$lte = options.gte;
if (options.lt) query._id.$gt = options.lt;
if (options.lte) query._id.$gte = options.lte;
} else {
if (options.start) query._id.$gte = options.start;
if (options.end) query._id.$lte = options.end;
if (options.gt) query._id.$gt = options.gt;
if (options.gte) query._id.$gte = options.gte;
if (options.lt) query._id.$lt = options.lt;
function Iterator (db, options) {
AbstractIterator.call(this, db)
this.codec = db.codec
this.keys = options.keys
this.values = options.values
this.options = options
this.it = db.db.iterator({ ...this.options, valueAsBuffer: false })
}
function Iterator (db, location, options) {
AbstractIterator.call(this, db)
this._limit = options.limit
this._count = 0
this._callback = null
this._cache = []
this._completed = false
this._aborted = false
this._error = null
this._transaction = null
this._keys = options.keys
this._values = options.values
this._keyAsBuffer = options.keyAsBuffer
this._valueAsBuffer = options.valueAsBuffer
if (this._limit === 0) {
, MysqlIterator = function(db, options) {
var self = this
, query = []
, start = options.start && options.start.length > 0 ? mysql.escape(options.start) : null
, end = options.end && options.end.length > 0 ? mysql.escape(options.end) : null
AbstractIterator.call(this, db)
this._reverse = !!options.reverse
this._keyAsBuffer = !!options.keyAsBuffer
this._valueAsBuffer = !!options.valueAsBuffer
this._stream = new PassThrough({
objectMode: true
})
this._stream.once('end', function() {
self._endEmitted = true
})
query.push('SELECT * from ' + db.table)
if (options.reverse) {
if (start && end)
function HyperIterator (db, opts) {
var checkout = db._db.snapshot()
this._keyAsBuffer = opts.keyAsBuffer
this._valueAsBuffer = opts.valueAsBuffer
this.ite = checkout.lexIterator(opts)
AbstractIterator.call(this, db)
}
inherits(HyperIterator, AbstractIterator)
var DynamoIterator = module.exports = function (db, options) {
var self = this
AbstractIterator.call(this, db)
this.db = db
this.ddb = db.ddb
this._results = this.createReadStream(options)
this._results.on('end', function() {
self._endEmitted = true
})
}
, MedeaIterator = function (medea, options) {
AbstractIterator.call(this, medea.db)
this.keyAsBuffer = options.keyAsBuffer !== false
this.valueAsBuffer = options.valueAsBuffer !== false
this.keys = medea.keys.range(options)
this.idx = 0
this.snapshot = medea.db.createSnapshot()
}
function MemIterator (db, options) {
AbstractIterator.call(this, db)
this._limit = options.limit
if (this._limit === -1) this._limit = Infinity
var tree = db._store[db._location]
this.keyAsBuffer = options.keyAsBuffer !== false
this.valueAsBuffer = options.valueAsBuffer !== false
this._reverse = options.reverse
this._options = options
this._done = 0
if (!this._reverse) {
this._incr = 'next'
this._start = ltgt.lowerBound(options)
this._end = ltgt.upperBound(options)