Skip to content

Add a strategy conf option allow workspace selection#1562

Open
Donald-Lao wants to merge 1 commit intomtxr:devfrom
Donald-Lao:dongyao.liu/Add-workspace-management-option
Open

Add a strategy conf option allow workspace selection#1562
Donald-Lao wants to merge 1 commit intomtxr:devfrom
Donald-Lao:dongyao.liu/Add-workspace-management-option

Conversation

@Donald-Lao
Copy link
Copy Markdown

@Donald-Lao Donald-Lao commented Feb 24, 2026

Describe here what is this PR about and what we are achieving merging this.
The sqltools default save the db connections to workspace/settings.json based on how user open the project. But in some cases, especially for micro services, we don't want to save the db connections as shared. To solve this case, I try to add a sqltools.strategy option to allow user select to save db connections to User Settings JSON or keep the old pattern


Thank you for your contribution!
Before submitting this PR, please make sure:

  • Your code builds clean without any errors or warnings
  • You have made the needed changes to the docs
  • You have written a description of what is the purpose of this pull request above

@Donald-Lao
Copy link
Copy Markdown
Author

Hi, team. Can I get approval by reviewers with write access? Thanks.

Copy link
Copy Markdown
Collaborator

@gjsjohnmurray gjsjohnmurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, and sorry for the delay. Please look at my suggested changes.

"description": "Display connections in two groups, 'Connected' and 'Not Connected'.",
"default": false
},
"sqltools.strategy": {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we make the setting name more descriptive:

Suggested change
"sqltools.strategy": {
"sqltools.connectionStore": {

return;
}
let target: ConfigurationTarget;
const strategy = Config.strategy || 'auto';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const strategy = Config.strategy || 'auto';
const connectionStore = Config.connectionStore || 'auto';

let target: ConfigurationTarget;
const strategy = Config.strategy || 'auto';
if (!writeTo) {
switch (strategy) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
switch (strategy) {
switch (connectionStore) {

Comment thread packages/types/index.d.ts
'connectionExplorer.groupConnected'?: boolean;

/**
* SQLTools configuration strategy.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* SQLTools configuration strategy.
* Where SQLTools will store connections you define.

"workspace"
],
"default": "auto",
"description": "SQLTools configuration strategy. 'auto' will use workspace settings if a workspace is open, and global settings otherwise. 'global' and 'workspace' will force the usage of global or workspace settings respectively."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "SQLTools configuration strategy. 'auto' will use workspace settings if a workspace is open, and global settings otherwise. 'global' and 'workspace' will force the usage of global or workspace settings respectively."
"description": "Where SQLTools will store connections you define. 'auto' will use workspace settings if a workspace is open, and global settings otherwise. 'global' and 'workspace' will force the usage of global or workspace settings respectively."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants