diff --git a/packages/api/src/controllers/databaseConnections.js b/packages/api/src/controllers/databaseConnections.js index 7e6360f9e..1078d4416 100644 --- a/packages/api/src/controllers/databaseConnections.js +++ b/packages/api/src/controllers/databaseConnections.js @@ -271,9 +271,9 @@ module.exports = { }, syncModel_meta: true, - async syncModel({ conid, database }) { + async syncModel({ conid, database, isFullRefresh }) { const conn = await this.ensureOpened(conid, database); - conn.subprocess.send({ msgtype: 'syncModel' }); + conn.subprocess.send({ msgtype: 'syncModel', isFullRefresh }); return { status: 'ok' }; }, diff --git a/packages/api/src/proc/databaseConnectionProcess.js b/packages/api/src/proc/databaseConnectionProcess.js index 0412721d6..afde7372b 100644 --- a/packages/api/src/proc/databaseConnectionProcess.js +++ b/packages/api/src/proc/databaseConnectionProcess.js @@ -79,9 +79,10 @@ async function handleIncrementalRefresh(forceSend) { resolveAnalysedPromises(); } -function handleSyncModel() { +function handleSyncModel({ isFullRefresh }) { if (loadingModel) return; - handleIncrementalRefresh(); + if (isFullRefresh) handleFullRefresh(); + else handleIncrementalRefresh(); } function setStatus(status) { diff --git a/packages/web/src/commands/changeDatabaseStatusCommand.ts b/packages/web/src/commands/changeDatabaseStatusCommand.ts index ad2cce077..0d71a7ef7 100644 --- a/packages/web/src/commands/changeDatabaseStatusCommand.ts +++ b/packages/web/src/commands/changeDatabaseStatusCommand.ts @@ -18,11 +18,17 @@ registerCommand({ }; return [ { - text: 'Sync model', + text: 'Sync model (incremental)', onClick: () => { apiCall('database-connections/sync-model', dbid); }, }, + { + text: 'Sync model (full)', + onClick: () => { + apiCall('database-connections/sync-model', { ...dbid, isFullRefresh: true }); + }, + }, { text: 'Reopen', onClick: () => {