Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support set MaxIdleConns MaxOpenConns ConnMaxLifetime from dsn #1082

Closed
hanjm opened this issue Sep 6, 2023 · 1 comment
Closed

support set MaxIdleConns MaxOpenConns ConnMaxLifetime from dsn #1082

hanjm opened this issue Sep 6, 2023 · 1 comment
Labels

Comments

@hanjm
Copy link
Contributor

hanjm commented Sep 6, 2023

Is your feature request related to a problem? Please describe.
Currently, we can set most option from dsn, but can not set MaxIdleConns MaxOpenConns ConnMaxLifetime

}
case "connection_open_strategy":
switch params.Get(v) {
case "in_order":
o.ConnOpenStrategy = ConnOpenInOrder
case "round_robin":

Describe the solution you'd like
Support set from dsn.

@jkaflik
Copy link
Contributor

jkaflik commented Sep 6, 2023

@hanjm
In case you use database/sql, setting those options have no effect, since connection pool is managed by database/sql - please see: https://github.com/ClickHouse/clickhouse-go#opendb

I think it was omitted mostly because of it, but since we expose clickhouse.ParseDSN to be used with our API, it makes sense to support connection pool options in DSN parser as well.

Would you like to submit a PR for it?

@jkaflik jkaflik added the bug label Sep 6, 2023
hanjm added a commit to hanjm/clickhouse-go that referenced this issue Sep 6, 2023
jkaflik added a commit that referenced this issue Sep 14, 2023
* parseDSN: support connection pool settings (#1082)

* add unit test

---------

Co-authored-by: Kuba Kaflik <[email protected]>
@jkaflik jkaflik closed this as completed Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants