mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-25 14:26:00 +00:00
full refresh model can be called from command
This commit is contained in:
@@ -271,9 +271,9 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
syncModel_meta: true,
|
syncModel_meta: true,
|
||||||
async syncModel({ conid, database }) {
|
async syncModel({ conid, database, isFullRefresh }) {
|
||||||
const conn = await this.ensureOpened(conid, database);
|
const conn = await this.ensureOpened(conid, database);
|
||||||
conn.subprocess.send({ msgtype: 'syncModel' });
|
conn.subprocess.send({ msgtype: 'syncModel', isFullRefresh });
|
||||||
return { status: 'ok' };
|
return { status: 'ok' };
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -79,9 +79,10 @@ async function handleIncrementalRefresh(forceSend) {
|
|||||||
resolveAnalysedPromises();
|
resolveAnalysedPromises();
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSyncModel() {
|
function handleSyncModel({ isFullRefresh }) {
|
||||||
if (loadingModel) return;
|
if (loadingModel) return;
|
||||||
handleIncrementalRefresh();
|
if (isFullRefresh) handleFullRefresh();
|
||||||
|
else handleIncrementalRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setStatus(status) {
|
function setStatus(status) {
|
||||||
|
|||||||
@@ -18,11 +18,17 @@ registerCommand({
|
|||||||
};
|
};
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
text: 'Sync model',
|
text: 'Sync model (incremental)',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
apiCall('database-connections/sync-model', dbid);
|
apiCall('database-connections/sync-model', dbid);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: 'Sync model (full)',
|
||||||
|
onClick: () => {
|
||||||
|
apiCall('database-connections/sync-model', { ...dbid, isFullRefresh: true });
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: 'Reopen',
|
text: 'Reopen',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user