Skip to content

Commit 213f207

Browse files
authored
docs: fix lsp-sqls-workspace-config-path behavior (#4535)
1 parent edec6f6 commit 213f207

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

docs/manual-language-docs/lsp-sqls.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ root_file: docs/manual-language-docs/lsp-sqls.md
1414
1515
```
1616

17-
Alternatively, you can leave `lsp-sqls-workspace-config-path` to the default "workspace" value, and put a json file in `<project>/.sqls/config.json` containing
17+
## Storing Configuration in `<project>/.sqls/config.json`
18+
19+
Alternatively, you can store your configuration in the project root at `<project>/.sqls/config.json`:
20+
1821
```
1922
{
2023
"sqls": {
@@ -29,4 +32,29 @@ Alternatively, you can leave `lsp-sqls-workspace-config-path` to the default "wo
2932
}
3033
```
3134

32-
Now lsp should start in sql-mode buffers, and you can pick a server connection with `M-x lsp-execute-code-action` and "Switch Connections" (or directly with `M-x lsp-sql-switch-connection`). You can change database with `M-x lsp-execute-code-action` and "Switch Database" (or `M-x lsp-sql-switch-database`).
35+
In this case, you need to set `lsp-sqls-workspace-config-path` to "root":
36+
37+
```emacs-lisp
38+
(setq lsp-sqls-workspace-config-path "root")
39+
```
40+
41+
## Storing Configuration in the Current Directory
42+
43+
If you want to configure it for the current directory, you can create a `.sqls/config.json` file:
44+
45+
```
46+
.sqls/config.json
47+
target.sql
48+
```
49+
50+
For this setup, ensure that `lsp-sqls-workspace-config-path` is set to "workspace":
51+
52+
```emacs-lisp
53+
(setq lsp-sqls-workspace-config-path "workspace")
54+
```
55+
56+
# Switching Connections and Databases
57+
58+
Now, lsp should start in sql-mode buffers. You can choose a server connection using `M-x lsp-execute-code-action` and then selecting "Switch Connections", or directly with `M-x lsp-sql-switch-connection`.
59+
60+
To change the database, use `M-x lsp-execute-code-action` and select "Switch Database" (or `M-x lsp-sql-switch-database`).

0 commit comments

Comments
 (0)