Skip to content

Commit

Permalink
fix: clickhouse query issue
Browse files Browse the repository at this point in the history
  • Loading branch information
YenchangChan committed Jan 2, 2024
1 parent e21fa86 commit a8a1ffa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pool/ck_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ func (c *Conn) Query(query string, args ...any) (*Rows, error) {
var rs Rows
rs.protocol = c.protocol
if c.protocol == clickhouse.HTTP {
rows, err := c.db.Query(query, args)
rows, err := c.db.Query(query, args...)
if err != nil {
return &rs, err
} else {
rs.rs1 = rows
}
} else {
rows, err := c.c.Query(c.ctx, query, args)
rows, err := c.c.Query(c.ctx, query, args...)
if err != nil {
return &rs, err
} else {
Expand All @@ -98,19 +98,19 @@ func (c *Conn) QueryRow(query string, args ...any) *Row {
var row Row
row.proto = c.protocol
if c.protocol == clickhouse.HTTP {
row.r1 = c.db.QueryRow(query, args)
row.r1 = c.db.QueryRow(query, args...)
} else {
row.r2 = c.c.QueryRow(c.ctx, query, args)
row.r2 = c.c.QueryRow(c.ctx, query, args...)
}
return &row
}

func (c *Conn) Exec(query string, args ...any) error {
if c.protocol == clickhouse.HTTP {
_, err := c.db.Exec(query, args)
_, err := c.db.Exec(query, args...)
return err
} else {
return c.c.Exec(c.ctx, query, args)
return c.c.Exec(c.ctx, query, args...)
}
}

Expand Down

0 comments on commit a8a1ffa

Please sign in to comment.