File tree Expand file tree Collapse file tree 9 files changed +44
-172
lines changed Expand file tree Collapse file tree 9 files changed +44
-172
lines changed Original file line number Diff line number Diff line change 1- version : " 3.8"
2-
31services :
42 app :
53 build :
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
1414### Changed
1515
16+ - Updated connection schema, ` Server ` now in ` uri ` format. That's mean you need
17+ to specify protocol (#634 ).
18+ - Removed ` useHTTPS ` option. If you need a ` HTTPS ` connection,
19+ specify it in server, e.g. ` https://node01.clickhouse.cloud ` .
1620- Updated dependencies.
1721
1822## [ 0.6.0] - 2024-08-03
Original file line number Diff line number Diff line change @@ -28,5 +28,3 @@ For more details see SQLTools [documentation](https://vscode-sqltools.mteixeira.
2828 and statistics.
2929- Don't send multiple queries, this is not supported
3030 by SQLTools (yet).
31- - Use ` LIMIT ` when selecting a large amount of data, otherwise the results may
32- take a long time to load.
Original file line number Diff line number Diff line change 3434 "server" : {
3535 "title" : " Server" ,
3636 "type" : " string" ,
37- "default" : " localhost" ,
37+ "format" : " uri" ,
38+ "default" : " http://localhost" ,
3839 "minLength" : 1
3940 },
4041 "port" : {
6162 " Use empty password" ,
6263 " Save as plaintext in settings"
6364 ],
64- "default" : " SQLTools Driver Credentials "
65+ "default" : " Use empty password "
6566 },
6667 "requestTimeout" : {
6768 "title" : " Request timeout in milliseconds" ,
6869 "type" : " integer" ,
6970 "default" : 30000
7071 },
71- "useHTTPS" : {
72- "title" : " Use HTTPS" ,
73- "type" : " boolean" ,
74- "default" : false
75- },
7672 "enableTls" : {
7773 "type" : " boolean" ,
7874 "title" : " Enable TLS" ,
Original file line number Diff line number Diff line change 100100 "concurrently" : " ^9.0.1" ,
101101 "cross-env" : " ^7.0.3" ,
102102 "esbuild" : " ^0.24.0" ,
103- "ovsx" : " ^0.9.4 " ,
103+ "ovsx" : " ^0.9.5 " ,
104104 "rimraf" : " ^6.0.1" ,
105105 "typescript" : " ^5.6.2"
106106 }
Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ export async function activate(
6262 parseBeforeSaveConnection : ( { connInfo } ) => {
6363 const propsToRemove = [ "passwordMode" ] ;
6464
65+ if (
66+ ! connInfo . server . startsWith ( "http://" ) &&
67+ ! connInfo . server . startsWith ( "https://" )
68+ ) {
69+ connInfo . server = "http://" + connInfo . server ;
70+ }
71+
6572 if ( connInfo . passwordMode ) {
6673 if ( connInfo . passwordMode . toString ( ) . toLowerCase ( ) . includes ( "ask" ) ) {
6774 connInfo . askForPassword = true ;
@@ -92,6 +99,13 @@ export async function activate(
9299 ...connInfo ,
93100 } ;
94101
102+ if (
103+ ! connInfo . server . startsWith ( "http://" ) &&
104+ ! connInfo . server . startsWith ( "https://" )
105+ ) {
106+ formData . server = "http://" + connInfo . server ;
107+ }
108+
95109 if ( connInfo . askForPassword ) {
96110 formData . passwordMode = "Ask on connect" ;
97111 delete formData . password ;
Original file line number Diff line number Diff line change @@ -50,17 +50,22 @@ export default class ClickHouseDriver
5050 }
5151 : undefined ;
5252
53+ let server = this . credentials . server ;
54+ if ( ! server . startsWith ( "http://" ) && ! server . startsWith ( "https://" ) ) {
55+ server = "http://" + server ;
56+ }
57+
58+ const url = new URL ( server ) ;
59+ url . port = this . credentials . port . toString ( ) ;
60+
5361 const opts = {
54- url : `${ this . credentials . useHTTPS ? "https" : "http" } ://${
55- this . credentials . server
56- } :${ this . credentials . port } `,
62+ url : url ,
5763 username : this . credentials . username ,
5864 password : this . credentials . password ,
5965 request_timeout : this . credentials . requestTimeout ,
6066 application : "sqltools-clickhouse-driver" ,
6167 database : this . credentials . database ,
6268 tls : tlsConfig ,
63- // TODO: check clickhouse_settings.default_format: "JSON"
6469 } as ClickHouseClientConfigOptions ;
6570
6671 this . connection = Promise . resolve ( createClient ( opts ) ) ;
Original file line number Diff line number Diff line change 77 " passwordMode" ,
88 " password" ,
99 " requestTimeout" ,
10- " useHTTPS" ,
1110 " enableTls" ,
1211 " tls"
1312 ],
You can’t perform that action at this time.
0 commit comments