mong support WIP

This commit is contained in:
Jan Prochazka
2021-04-02 18:40:07 +02:00
parent d4bd6e03c9
commit 394c6028c9
19 changed files with 347 additions and 10 deletions

View File

@@ -94,6 +94,17 @@ async function handleQueryData({ msgid, sql }) {
}
}
async function handleCollectionData({ msgid, options }) {
await waitConnected();
const driver = requireEngineDriver(storedConnection);
try {
const result = await driver.readCollection(systemConnection, options);
process.send({ msgtype: 'response', msgid, result });
} catch (err) {
process.send({ msgtype: 'response', msgid, errorMessage: err.message });
}
}
async function handleSqlPreview({ msgid, objects, options }) {
await waitConnected();
const driver = requireEngineDriver(storedConnection);
@@ -129,6 +140,7 @@ function handlePing() {
const messageHandlers = {
connect: handleConnect,
queryData: handleQueryData,
collectionData: handleCollectionData,
sqlPreview: handleSqlPreview,
ping: handlePing,
// runCommand: handleRunCommand,