databendlabs / bendsql

Databend Native Client
Apache License 2.0
49 stars 26 forks source link

fix: config support parse tls #446

Closed TCeason closed 4 months ago

TCeason commented 4 months ago

Summary

➜ ~/database/source-code/bendsql👆 git:(main) ⚡ ./target/debug/bendsql --tls=true path is "/home/taichong/.config/bendsql/config.toml" not set dsn : databend://root@localhost:8000?tls=false Welcome to BendSQL 0.18.3-fbb976e(2024-07-03T13:28:17.492814078Z). Connecting to localhost:8000 as user root. Error: APIError: RequestError: error sending request for url (https://localhost:8000/v1/query)

And I think the doc in README.md is wrong. That is right.

➜  ~/database/source-code/bendsql👆 git:(main) ⚡ cat  /home/taichong/.config/bendsql/config.toml
[connection]
host = "127.0.0.1"

[connection.args]
tls = "true"
connect_timeout = "30"

[settings]
display_pretty_sql = true
progress_color = "green"
no_auto_complete = true
prompt = ":) "

➜ ~/database/source-code/bendsql👆 git:(main) ⚡ ./target/debug/bendsql
path is "/home/taichong/.config/bendsql/config.toml" not set dsn : databend://root@localhost:8000?tls=true Welcome to BendSQL 0.18.3-fbb976e(2024-07-03T13:28:17.492814078Z). Connecting to localhost:8000 as user root. Error: APIError: RequestError: error sending request for url (https://localhost:8000/v1/query)

Fix: #440

TCeason commented 4 months ago

cc @sundy-li

TCeason commented 4 months ago

[connection] tls = true

[connection.args] ...

Good idea. Fixed. Please review the newest commit.

[connection]
tls = true

[connection.args]
...