Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add command to run apply defer config #1612

Merged
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,11 @@
"command": "dbtPowerUser.showNotebookGenerateModelCTE",
"title": "Generate dbt model CTE",
"group": "notebooks@5"
},
{
"command": "dbtPowerUser.applyDeferConfig",
"category": "dbt Power User",
"title": "Apply defer configuration"
}
],
"keybindings": [
Expand Down
18 changes: 18 additions & 0 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,24 @@ export class VSCodeCommands implements Disposable {
);
},
),
commands.registerCommand("dbtPowerUser.applyDeferConfig", async () => {
const projects = this.dbtProjectContainer.getProjects();
try {
await Promise.all(
projects.map((project) => project.applyDeferConfig()),
);
window.showInformationMessage("Applied defer configuration");
} catch (error) {
this.dbtTerminal.error(
"applyDeferConfig",
"Failed to apply defer configuration",
error
);
window.showErrorMessage(
`Failed to apply defer configuration: ${error}`
);
}
}),
);
}

Expand Down