correct export from read-only connection

This commit is contained in:
Jan Prochazka
2022-03-20 09:47:39 +01:00
parent 1a81952ce7
commit 6fb582249c
9 changed files with 85 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
import _compact from 'lodash/compact'
import _compact from 'lodash/compact';
import { SqlDumper } from './SqlDumper';
import { splitQuery } from 'dbgate-query-splitter';
import { dumpSqlSelect } from 'dbgate-sqltree';
@@ -105,4 +105,9 @@ export const driverBase = {
const resp = await this.query(pool, dmp.s);
return resp.rows;
},
readJsonQuery(pool, select, structure) {
const dmp = this.createDumper();
dumpSqlSelect(dmp, select);
return this.readQuery(pool, dmp.s, structure);
},
};