read json lines field values

This commit is contained in:
Jan Prochazka
2022-03-31 15:35:38 +02:00
parent 5aac142e4c
commit c0b365602b
5 changed files with 52 additions and 10 deletions

View File

@@ -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 () => {