mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 06:46:00 +00:00
read json lines field values
This commit is contained in:
@@ -159,6 +159,18 @@ class JsonLinesDatastore {
|
||||
}
|
||||
}
|
||||
|
||||
async enumRows(eachRow) {
|
||||
await lock.acquire('reader', async () => {
|
||||
await this._ensureReader(0, null);
|
||||
for (;;) {
|
||||
const line = await this._readLine(true);
|
||||
if (line == null) break;
|
||||
const shouldContinue = eachRow(line);
|
||||
if (!shouldContinue) break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async getRows(offset, limit, filter) {
|
||||
const res = [];
|
||||
await lock.acquire('reader', async () => {
|
||||
|
||||
Reference in New Issue
Block a user