loading redis keys

This commit is contained in:
Jan Prochazka
2022-03-05 18:46:18 +01:00
parent 425841bb38
commit 51942be0a6
11 changed files with 130 additions and 21 deletions

View File

@@ -151,6 +151,16 @@ module.exports = {
return res.result;
},
loadKeys_meta: true,
async loadKeys({ conid, database, root }) {
const opened = await this.ensureOpened(conid, database);
const res = await this.sendRequest(opened, { msgtype: 'loadKeys', root });
if (res.errorMessage) {
console.error(res.errorMessage);
}
return res.result || null;
},
updateCollection_meta: true,
async updateCollection({ conid, database, changeSet }) {
const opened = await this.ensureOpened(conid, database);

View File

@@ -183,6 +183,17 @@ async function handleCollectionData({ msgid, options }) {
}
}
async function handleLoadKeys({ msgid, root }) {
await waitConnected();
const driver = requireEngineDriver(storedConnection);
try {
const result = await driver.loadKeys(systemConnection, root);
process.send({ msgtype: 'response', msgid, result });
} catch (err) {
process.send({ msgtype: 'response', msgid, errorMessage: err.message });
}
}
async function handleUpdateCollection({ msgid, changeSet }) {
await waitConnected();
const driver = requireEngineDriver(storedConnection);
@@ -248,6 +259,7 @@ const messageHandlers = {
runScript: handleRunScript,
updateCollection: handleUpdateCollection,
collectionData: handleCollectionData,
loadKeys: handleLoadKeys,
sqlPreview: handleSqlPreview,
ping: handlePing,
syncModel: handleSyncModel,