Skip to content

Commit 186b108

Browse files
committed
fix: try query command without reading rows
1 parent 34eb10a commit 186b108

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/infra/query/sql.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,16 @@ func (ds *DataSource) Close() error {
8888
}
8989

9090
func (ds *DataSource) Query(query string) (query.DataReader, error) {
91-
rows, err := ds.dbx.Queryx(query)
91+
result, err := ds.dbx.Exec(query)
9292
if err != nil {
9393
return nil, fmt.Errorf("%w", err)
9494
}
9595

96-
log.Info().Str("query", query).Msg("success executing SQL query")
96+
if nbrows, err := result.RowsAffected(); err != nil {
97+
log.Info().Str("query", query).Int64("rows", nbrows).Msg("success executing SQL query")
98+
}
9799

98-
return &DataReader{rows, nil, nil}, nil
100+
return nil, nil
99101
}
100102

101103
type DataSourceFactory struct{}

0 commit comments

Comments
 (0)