You've already forked go-clickhouse
mirror of
https://github.com/uptrace/go-clickhouse.git
synced 2025-06-14 23:44:59 +02:00
chore: enable test
This commit is contained in:
@ -48,8 +48,6 @@ func TestCHError(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCHTimeout(t *testing.T) {
|
func TestCHTimeout(t *testing.T) {
|
||||||
t.Skip()
|
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
db := chDB(ch.WithTimeout(time.Second), ch.WithMaxRetries(0))
|
db := chDB(ch.WithTimeout(time.Second), ch.WithMaxRetries(0))
|
||||||
|
@ -191,13 +191,20 @@ func (q *InsertQuery) Exec(ctx context.Context) (sql.Result, error) {
|
|||||||
}
|
}
|
||||||
query := internal.String(queryBytes)
|
query := internal.String(queryBytes)
|
||||||
|
|
||||||
fields, err := q.getFields()
|
ctx, evt := q.db.beforeQuery(ctx, q, query, nil, q.tableModel)
|
||||||
if err != nil {
|
var res *result
|
||||||
return nil, err
|
|
||||||
|
if q.tableModel != nil {
|
||||||
|
fields, err := q.getFields()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
res, err = q.db.insert(ctx, q.tableModel, query, fields)
|
||||||
|
} else {
|
||||||
|
res, err = q.db.exec(ctx, query)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, evt := q.db.beforeQuery(ctx, q, query, nil, q.tableModel)
|
|
||||||
res, err := q.db.insert(ctx, q.tableModel, query, fields)
|
|
||||||
q.db.afterQuery(ctx, evt, res, err)
|
q.db.afterQuery(ctx, evt, res, err)
|
||||||
|
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user