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
TheSQL Language Server offers autocompletion, error/warning notifications, and other editor support. It includes a linting feature, an SQL parser, and a Visual Studio Code extension. It supports MySQL, PostgreSQL, and SQLite3 databases.
- Autocompletion andnotifywarnings and errorsand some other editor support ([sql-language-server](https://github.com/joe-re/sql-language-server/tree/release/packages/server))
See the[example](https://github.com/joe-re/sql-language-server/blob/master/example/monaco_editor) to use the Monaco Editor to develop sql-language-server.
56
56
57
-
It's also used to develop sql-language-server.
58
-
You can follow[development section](#development) to check Mocaco Editor working.
57
+
Follow the[development section](#development) section to check Mocaco Editor working.
59
58
60
59
##Usage
61
60
@@ -85,8 +84,8 @@ $ sql-language-server up --method stdio
85
84
86
85
There are two ways to use configuration files.
87
86
88
-
- Set personal configuration file(~/.config/sql-language-server/.sqllsrc.json)
89
-
- Set project configuration file on your project root(\${YOUR_PROJECT/.sqllsrc.json})
87
+
- Set personal configuration file (`~/.config/sql-language-server/.sqllsrc.json`)
88
+
- Set project configuration file on your project root (`${YOUR_PROJECT}/.sqllsrc.json`)
90
89
- Use workspace/configuration according to LSP specification
91
90
92
91
####Example for personal configuration file
@@ -134,9 +133,9 @@ There are two ways to use configuration files.
134
133
}
135
134
```
136
135
137
-
Please restart sql-language-server process aftercreate.sqllsrc.json.
136
+
Please restart sql-language-server process aftercreating`.sqllsrc.json`.
@@ -159,26 +158,23 @@ Please restart sql-language-server process after create .sqllsrc.json.
159
158
| remotePort| Port number of the server for ssh| number| false| 22|
160
159
| user| User name on the server| string| false||
161
160
| dbHost| Database host on the server| string| false| 127.0.0.1|
162
-
| dbPort|Databse port on the server| number| false| mysql:3306, postgres:5432|
161
+
| dbPort|Database port on the server| number| false| mysql:3306, postgres:5432|
163
162
| identityFile| Identity file for ssh| string| false|~/.ssh/config/id_rsa|
164
163
| passphrase| Passphrase to allow to use identity file| string| false||
165
164
166
-
####Personalconfuguration file
165
+
####Personalconfiguration file
167
166
168
-
Personal configuration file is located on`~/.config/sql-language-server/.sqllsrc.json`.
169
-
sql-language-server will try to read when it's started.
167
+
The personal configuration file is located at`~/.config/sql-language-server/.sqllsrc.json`. When the SQL Language Server starts, it will try to read this file.
170
168
171
-
####Projectconfuguration file
169
+
####Projectconfiguration file
172
170
173
-
Projectconfiguration file is locatedon`${YOUR_PROJECT_ROOT}/.sqllsrc.json`.
171
+
The projectconfiguration file is locatedat`${YOUR_PROJECT_ROOT}/.sqllsrc.json`. This file has the same settings as the personal configuration file, with a few exceptions:
174
172
175
-
All setting items are similarly to personal configuration file, with some exceptions:
173
+
- The connection property is specified directly, rather than as an array.
174
+
- The project path does not need to be set. If it is set, it will be ignored.
175
+
- The project configuration file is merged with the personal configuration file, if it exists.
176
176
177
-
- Specify under`connection` property element directly(you don't need to set array)
178
-
- You don't need to set project path.(if you set it it will be ignored)
179
-
- It's merged to personal configuration if you have it.
180
-
181
-
Example:
177
+
Here is an example project configuration file for a PostgreSQL database:
182
178
```json
183
179
{
184
180
"name":"postgres-project",
@@ -190,7 +186,7 @@ Example:
190
186
}
191
187
```
192
188
193
-
And also ifyou have set personal configuration and both of them's names are matched, it's mergedautomatically.
189
+
Ifyou havealsosetapersonal configuration, the project configuration and personal configure will be mergedif they have the same name.
194
190
195
191
Personal configuration example:
196
192
```json
@@ -210,7 +206,7 @@ Personal configuration example:
210
206
}
211
207
```
212
208
213
-
It will merge them asfollowing:
209
+
It will merge them asfollows:
214
210
215
211
```json
216
212
{
@@ -232,12 +228,12 @@ It will merge them as following:
232
228
}
233
229
```
234
230
235
-
####workspace/configuration
231
+
####Workspaceconfiguration for sql-language-server
236
232
237
233
#####Parameters of workspace configuration
238
234
239
-
- connections: It'sthe same as`connections` params ofpersonalconfig file
240
-
- lint: It'sthe same as configuration of[sqlint](https://github.com/joe-re/sql-language-server/tree/release/packages/sqlint#configuration).
235
+
-`connections`: This parameter isthe same astheconnections parameter in thepersonalconfiguration file. It allows you to specify the connections for your workspace.
236
+
-`lint`: This parameter isthe same astheconfiguration of[sqlint](https://github.com/joe-re/sql-language-server/tree/release/packages/sqlint#configuration). It allows you to configure the linting rules for your workspace.
241
237
242
238
243
239
#####Example of workspace configuration
@@ -290,7 +286,7 @@ It will merge them as following:
290
286
}
291
287
```
292
288
293
-
-vscode workspace setting
289
+
-VS Code workspace setting
294
290
295
291
```json
296
292
"settings": {
@@ -327,12 +323,12 @@ It will merge them as following:
327
323
```
328
324
329
325
330
-
####Injectenvitonment variables
326
+
####Injectenvironment variables
331
327
332
-
${env:VARIABLE_NAME} syntax allows you to replace configuration value withenviroment variable.
333
-
This is usefulwhen you don't want towrite actual valueon the configuration file.
328
+
`${env:VARIABLE_NAME}` syntax allows you to replace configuration value withan environment variable.
329
+
This is usefulif you don't want tostore the valuein the configuration file.
334
330
335
-
#####example
331
+
#####Example
336
332
337
333
```json
338
334
{
@@ -355,7 +351,7 @@ This is useful when you don't want to write actual value on the configuration fi
355
351
356
352
####Switch database connection
357
353
358
-
If you have multiple connectioninformation onpersonal config file, you canswtich database connection.
354
+
If you have multiple connectionentries in yourpersonal config file, you canswitch the database connection.
If you're using sql-language-server directly,aftergo to thedirectry of itandcall`npm rebuild sqlite` to rebuild it.
376
+
If you're using sql-language-server directly, go to theinstall directoryandrun`npm rebuild sqlite` to rebuild it.
381
377
382
378
383
-
####Lint
379
+
####Linting
384
380
385
-
You can use lint rules that are provided[sqlint](https://github.com/joe-re/sql-language-server/tree/release/packages/sqlint).
386
-
Please refer this to know how to use and how to configure to make them be matched your case.
381
+
You can use lint rules provided by[sqlint](https://github.com/joe-re/sql-language-server/tree/release/packages/sqlint) to ensure your SQL code follows best practices and avoid potential errors. Refer to the[sqlint configuraton documentation](https://github.com/joe-re/sql-language-server/tree/release/packages/sqlint#configuration) to learn how to use and configure the linter to match your use case.
[GitHub Issues](https://github.com/joe-re/sql-language-server/issues) are opening for asking question, reporting problems,andsuggests improvement.
398
+
###Bug ReportsandFeature Requests
406
399
407
-
You can start adisccustionabout newrule for SQLint there also.
400
+
If you have any questions, problems or suggestions for improvements, feel free to create a new issue on[GitHub Issues](https://github.com/joe-re/sql-language-server/issues).You canalsostart adiscussion thereabout newrules for SQLint.
408
401
409
402
###Development
410
403
411
-
Code contributions are always appreciated. Feel free to fork the repo and submit pull requests.
404
+
Code contributions are always appreciated, so feel free to fork the repo and submit pull requests.
412
405
413
406
####Development environment
414
407
415
-
You can start to develop sql-language-server on docker compose.
416
-
Start development process on your docker by the bellow:
408
+
You can start developing sql-language-server using Docker Compose. To begin the development process in your Docker container, run the following command: