full refresh model can be called from command

This commit is contained in:
Jan Prochazka 2022-06-02 08:40:05 +02:00
parent a8047560af
commit a6f6680788
3 changed files with 12 additions and 5 deletions

View File

@ -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' };
},

View File

@ -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) {

View File

@ -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: () => {