mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 22:03:58 +00:00
duckdb: catch syntax error in query
This commit is contained in:
@@ -56,10 +56,11 @@ const driver = {
|
|||||||
},
|
},
|
||||||
async stream(dbhan, sql, options) {
|
async stream(dbhan, sql, options) {
|
||||||
const duckdb = getDuckDb();
|
const duckdb = getDuckDb();
|
||||||
|
|
||||||
|
try {
|
||||||
const statements = await dbhan.client.extractStatements(sql);
|
const statements = await dbhan.client.extractStatements(sql);
|
||||||
const count = statements.count;
|
const count = statements.count;
|
||||||
|
|
||||||
try {
|
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
let hasSentColumns = false;
|
let hasSentColumns = false;
|
||||||
const stmt = await statements.prepare(i);
|
const stmt = await statements.prepare(i);
|
||||||
@@ -77,11 +78,11 @@ const driver = {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
options.info({
|
// options.info({
|
||||||
message: JSON.stringify(res),
|
// message: JSON.stringify(res),
|
||||||
time: new Date(),
|
// time: new Date(),
|
||||||
severity: 'info',
|
// severity: 'info',
|
||||||
});
|
// });
|
||||||
|
|
||||||
if (!hasSentColumns) {
|
if (!hasSentColumns) {
|
||||||
const columnNames = res.columnNames();
|
const columnNames = res.columnNames();
|
||||||
|
|||||||
Reference in New Issue
Block a user