@@ -15,13 +15,6 @@ import (
1515 "github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql/common"
1616)
1717
18- type resultNoRows struct {}
19-
20- func (resultNoRows ) LastInsertId () (int64 , error ) { return 0 , ErrUnsupported }
21- func (resultNoRows ) RowsAffected () (int64 , error ) { return 0 , ErrUnsupported }
22-
23- var _ driver.Result = resultNoRows {}
24-
2518type Parent interface {
2619 Query () * query.Client
2720}
@@ -39,7 +32,7 @@ func (c *Conn) NodeID() uint32 {
3932}
4033
4134func (c * Conn ) Exec (ctx context.Context , sql string , params * params.Params ) (
42- result driver.Result , finalErr error ,
35+ driver.Result , error ,
4336) {
4437 if ! c .IsValid () {
4538 return nil , xerrors .WithStackTrace (xerrors .Retryable (errNotReadyConn ,
@@ -63,12 +56,15 @@ func (c *Conn) Exec(ctx context.Context, sql string, params *params.Params) (
6356 opts = append (opts , options .WithTxControl (txControl ))
6457 }
6558
59+ r := & resultWithStats {}
60+ opts = append (opts , options .WithStatsMode (options .StatsModeBasic , r .onQueryStats ))
61+
6662 err := c .session .Exec (ctx , sql , opts ... )
6763 if err != nil {
6864 return nil , xerrors .WithStackTrace (err )
6965 }
7066
71- return resultNoRows {} , nil
67+ return r , nil
7268}
7369
7470func (c * Conn ) Query (ctx context.Context , sql string , params * params.Params ) (
0 commit comments