Skip to content

Commit 8a9114f

Browse files
committed
publish options.Execute as query.ExecuteOption
1 parent cb0dbd7 commit 8a9114f

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

query/client.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ type (
1717
//
1818
// Exec used by default:
1919
// - DefaultTxControl
20-
Exec(ctx context.Context, query string, opts ...options.Execute) error
20+
Exec(ctx context.Context, query string, opts ...ExecuteOption) error
2121

2222
// Query execute query with result
2323
//
2424
// Exec used by default:
2525
// - DefaultTxControl
26-
Query(ctx context.Context, query string, opts ...options.Execute) (Result, error)
26+
Query(ctx context.Context, query string, opts ...ExecuteOption) (Result, error)
2727

2828
// QueryResultSet execute query and take the exactly single materialized result set from result
2929
//
3030
// Exec used by default:
3131
// - DefaultTxControl
32-
QueryResultSet(ctx context.Context, query string, opts ...options.Execute) (ClosableResultSet, error)
32+
QueryResultSet(ctx context.Context, query string, opts ...ExecuteOption) (ClosableResultSet, error)
3333

3434
// QueryRow execute query and take the exactly single row from exactly single result set from result
3535
//
3636
// Exec used by default:
3737
// - DefaultTxControl
38-
QueryRow(ctx context.Context, query string, opts ...options.Execute) (Row, error)
38+
QueryRow(ctx context.Context, query string, opts ...ExecuteOption) (Row, error)
3939
}
4040
// Client defines API of query client
4141
Client interface {
@@ -68,31 +68,31 @@ type (
6868
//
6969
// Exec used by default:
7070
// - DefaultTxControl
71-
Exec(ctx context.Context, query string, opts ...options.Execute) error
71+
Exec(ctx context.Context, query string, opts ...ExecuteOption) error
7272

7373
// Query execute query with materialized result
7474
//
7575
// Warning: the large result from query will be materialized and can happened to "OOM killed" problem
7676
//
7777
// Exec used by default:
7878
// - DefaultTxControl
79-
Query(ctx context.Context, query string, opts ...options.Execute) (Result, error)
79+
Query(ctx context.Context, query string, opts ...ExecuteOption) (Result, error)
8080

8181
// QueryResultSet is a helper which read all rows from first result set in result
8282
//
8383
// Warning: the large result set from query will be materialized and can happened to "OOM killed" problem
84-
QueryResultSet(ctx context.Context, query string, opts ...options.Execute) (ClosableResultSet, error)
84+
QueryResultSet(ctx context.Context, query string, opts ...ExecuteOption) (ClosableResultSet, error)
8585

8686
// QueryRow is a helper which read only one row from first result set in result
8787
//
8888
// ReadRow returns error if result contains more than one result set or more than one row
89-
QueryRow(ctx context.Context, query string, opts ...options.Execute) (Row, error)
89+
QueryRow(ctx context.Context, query string, opts ...ExecuteOption) (Row, error)
9090

9191
// ExecuteScript starts long executing script with polling results later
9292
//
9393
// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
9494
ExecuteScript(
95-
ctx context.Context, query string, ttl time.Duration, ops ...options.Execute,
95+
ctx context.Context, query string, ttl time.Duration, ops ...ExecuteOption,
9696
) (*options.ExecuteScriptOperation, error)
9797

9898
// FetchScriptResults fetching the script results

query/execute_options.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"github.com/ydb-platform/ydb-go-sdk/v3/internal/query/tx"
99
)
1010

11+
type ExecuteOption = options.Execute
12+
1113
const (
1214
SyntaxYQL = options.SyntaxYQL
1315
SyntaxPostgreSQL = options.SyntaxPostgreSQL

0 commit comments

Comments
 (0)