This commit is contained in:
Jan Prochazka
2022-01-29 11:30:10 +01:00
parent 1c5a22a071
commit c89e3adb38
7 changed files with 146 additions and 24 deletions

View File

@@ -4,7 +4,7 @@ const lock = new AsyncLock();
const stableStringify = require('json-stable-stringify');
const { evaluateCondition } = require('dbgate-sqltree');
async function fetchNextLine(reader) {
export async function fetchNextLineFromReader(reader) {
return new Promise((resolve, reject) => {
if (!reader.hasNextLine()) {
resolve(null);
@@ -62,7 +62,7 @@ class JsonLinesDatastore {
async _readLine(parse) {
for (;;) {
const line = await fetchNextLine(this.reader);
const line = await fetchNextLineFromReader(this.reader);
if (!line) {
// EOF
return null;