mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
full refresh model can be called from command
This commit is contained in:
parent
a8047560af
commit
a6f6680788
@ -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' };
|
||||
},
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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: () => {
|
||||
|
Loading…
Reference in New Issue
Block a user