@@ -21,18 +21,15 @@ import (
2121
2222var _ query.Session = (* Session )(nil )
2323
24- type (
25- Session struct {
26- cfg * config.Config
27- id string
28- nodeID int64
29- grpcClient Ydb_Query_V1.QueryServiceClient
30- statusCode statusCode
31- closeOnce func (ctx context.Context ) error
32- checks []func (s * Session ) bool
33- }
34- sessionOption func (session * Session )
35- )
24+ type Session struct {
25+ cfg * config.Config
26+ id string
27+ nodeID int64
28+ grpcClient Ydb_Query_V1.QueryServiceClient
29+ statusCode statusCode
30+ closeOnce func (ctx context.Context ) error
31+ checks []func (s * Session ) bool
32+ }
3633
3734func (s * Session ) ReadRow (ctx context.Context , q string , opts ... options.ExecuteOption ) (row query.Row , _ error ) {
3835 _ , r , err := s .Execute (ctx , q , opts ... )
@@ -74,15 +71,9 @@ func (s *Session) ReadResultSet(ctx context.Context, q string, opts ...options.E
7471 return rs , nil
7572}
7673
77- func withSessionCheck (f func (* Session ) bool ) sessionOption {
78- return func (s * Session ) {
79- s .checks = append (s .checks , f )
80- }
81- }
82-
83- func createSession (
84- ctx context.Context , client Ydb_Query_V1.QueryServiceClient , cfg * config.Config , opts ... sessionOption ,
85- ) (s * Session , finalErr error ) {
74+ func createSession (ctx context.Context , client Ydb_Query_V1.QueryServiceClient , cfg * config.Config ) (
75+ s * Session , finalErr error ,
76+ ) {
8677 s = & Session {
8778 cfg : cfg ,
8879 grpcClient : client ,
@@ -94,10 +85,6 @@ func createSession(
9485 }
9586 }()
9687
97- for _ , opt := range opts {
98- opt (s )
99- }
100-
10188 onDone := trace .QueryOnSessionCreate (s .cfg .Trace (), & ctx ,
10289 stack .FunctionID ("github.com/ydb-platform/ydb-go-sdk/3/internal/query.createSession" ),
10390 )
0 commit comments