You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
+
18
21
```
19
22
{
20
23
"sqls": {
@@ -29,4 +32,29 @@ Alternatively, you can leave `lsp-sqls-workspace-config-path` to the default "wo
29
32
}
30
33
```
31
34
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