Skip to content

Commit

Permalink
Merge pull request #86 from Hubbitus/issue71-clickhouse-http-support
Browse files Browse the repository at this point in the history
issue 71: add clickhouse http support
  • Loading branch information
dewey authored Jun 19, 2023
2 parents f0a38d7 + 5819c4a commit 63eed6d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion job.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ func (c *connection) connect(job *Job) error {
switch c.driver {
case "mysql":
dsn = strings.TrimPrefix(dsn, "mysql://")
case "clickhouse":
case "clickhouse+tcp", "clickhouse+http": // Support both http and tcp connections
dsn = strings.TrimPrefix(dsn, "clickhouse+")
c.driver = "clickhouse"
case "clickhouse": // Backward compatible alias
dsn = "tcp://" + strings.TrimPrefix(dsn, "clickhouse://")
}
conn, err := sqlx.Connect(c.driver, dsn)
Expand Down

0 comments on commit 63eed6d

Please sign in to comment.