This commit is contained in:
Jan Prochazka
2021-03-27 16:04:12 +01:00
parent 11985004b5
commit bbc50ea3fb
3 changed files with 11 additions and 5 deletions

View File

@@ -46,11 +46,12 @@ export class SqlDumper {
}
putValue(value) {
if (value === null) this.putRaw('NULL');
if (value === true) this.putRaw('1');
if (value === false) this.putRaw('0');
else if (value === true) this.putRaw('1');
else if (value === false) this.putRaw('0');
else if (_isString(value)) this.putStringValue(value);
else if (_isNumber(value)) this.putRaw(value.toString());
else if (_isDate(value)) this.putStringValue(new Date(value).toISOString());
else this.putRaw('NULL');
}
putCmd(format, ...args) {
this.put(format, ...args);

View File

@@ -69,6 +69,7 @@ export function createBulkInsertStreamBase(driver, stream, pool, name, options):
}
dmp.putRaw(';');
// require('fs').writeFileSync('/home/jena/test.sql', dmp.s);
// console.log(dmp.s);
await driver.query(pool, dmp.s);
};

View File

@@ -35,6 +35,7 @@
import useEditorData from '../query/useEditorData';
import { activeTabId, getActiveTabId, nullStore } from '../stores';
import axiosInstance from '../utility/axiosInstance';
import { changeTab } from '../utility/common';
import memberStore from '../utility/memberStore';
import socket from '../utility/socket';
import useEffect from '../utility/useEffect';
@@ -75,8 +76,13 @@
domEditor?.getEditor()?.focus();
}
$: effect = useEffect(() => registerRunnerDone(runnerId));
$: {
changeTab(tabid, tab => ({ ...tab, busy }));
}
$: effect = useEffect(() => registerRunnerDone(runnerId));
$: $effect;
function registerRunnerDone(rid) {
if (rid) {
socket.on(`runner-done-${rid}`, handleRunnerDone);
@@ -88,8 +94,6 @@
}
}
$: $effect;
function handleRunnerDone() {
busy = false;
timerLabel.stop();