diff --git a/job.go b/job.go index cde02f8d..236e3fb7 100644 --- a/job.go +++ b/job.go @@ -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)