@@ -60,29 +60,79 @@ $ sql-language-server up --method stdio
6060{
6161 "adapter" : " mysql" ,
6262 "host" : " localhost" ,
63- "port" : 3306 ,
63+ "port" : 3307 ,
6464 "user" : " username" ,
6565 "password" : " password" ,
66- "database" : " mysql-development"
66+ "database" : " mysql-development" ,
67+ "ssh" : {
68+ "user" : " ubuntu" ,
69+ "remoteHost" : " ec2-xxx-xxx-xxx-xxx.ap-southeast-1.compute.amazonaws.com" ,
70+ "dbHost" : " 127.0.0.1" ,
71+ "port" : 3306 ,
72+ "identityFile" : " ~/.ssh/id_rsa" ,
73+ "passphrase" : " 123456"
74+ }
6775}
6876```
6977
70- - Details
71- - adapter: "mysql" | "postgres"
72- - host: string
73- - port: number
74- - user: string
75- - password: string
76- - database: string
77-
7878Please restart sql-language-server process after create .sqlrc.json.
7979
80+ #### Parameters
81+
82+ | Key | Description | value | required | default |
83+ | -------- | --------------------------- | ----------------------- | -------- | --------------------------------- |
84+ | adapter | Database type | `"mysql" | "postgres"` | true | |
85+ | host | Database host | string | true | |
86+ | port | Database port | string | false | mysql:3306, postgres:5432 |
87+ | user | Database user | string | true | mysql:"root", postgres:"postgres" |
88+ | password | Database password | string | false | |
89+ | database | Database name | string | false | |
90+ | ssh | Settings for port fowarding | \* see below SSH section | false | |
91+
92+ ##### SSH
93+
94+ | Key | Description | value | required | default |
95+ | ------------ | ---------------------------------------- | ------ | -------- | ------------------------- |
96+ | remoteHost | The host address you want to connect to | string | true | |
97+ | remotePort | Port number of the server for ssh | number | false | 22 |
98+ | user | User name on the server | string | false | |
99+ | dbHost | Database host on the server | string | false | 127.0.0.1 |
100+ | dbPort | Databse port on the server | number | false | mysql:3306, postgres:5432 |
101+ | identitiFile | Identity file for ssh | string | false | ~ /.ssh/config/id_rsa |
102+ | passphrase | Passphrase to allow to use identity file | string | false | |
103+
104+ #### Inject envitonment variables
105+
106+ ${ssm: VARIABLE_NAME } syntax allows you to replace configuration value with environt variable.
107+ This is useful when you don't write actual file on configuration file.
108+
109+ ##### example
110+
111+ ``` json
112+ {
113+ "adapter" : " mysql" ,
114+ "host" : " localhost" ,
115+ "port" : 3307 ,
116+ "user" : " username" ,
117+ "password" : " ${env:DB_PASSWORD}" ,
118+ "database" : " mysql-development" ,
119+ "ssh" : {
120+ "user" : " ubuntu" ,
121+ "remoteHost" : " ec2-xxx-xxx-xxx-xxx.ap-southeast-1.compute.amazonaws.com" ,
122+ "dbHost" : " 127.0.0.1" ,
123+ "port" : 3306 ,
124+ "identityFile" : " ~/.ssh/id_rsa" ,
125+ "passphrase" : " ${env:SSH_PASSPHRASE}"
126+ }
127+ }
128+ ```
129+
80130### TODO
81131
82132- [x] SELECT
83133- [x] INSERT
84134- [x] UPDATE
85135- [x] DELETE
136+ - [x] ssh port forwarding
86137- [ ] Beautify
87138- [ ] Lint
88- - [ ] ssh port forwarding
0 commit comments