@@ -8,14 +8,14 @@ import (
8
8
9
9
"github.com/ydb-platform/ydb-go-sdk/v3/config"
10
10
"github.com/ydb-platform/ydb-go-sdk/v3/internal/bind"
11
- "github.com/ydb-platform/ydb-go-sdk/v3/internal/connector "
12
- querySql "github.com/ydb-platform/ydb-go-sdk/v3/internal/query/conn"
13
- tableSql "github.com/ydb-platform/ydb-go-sdk/v3/internal/table/conn"
11
+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql "
12
+ conn2 "github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql /query/conn"
13
+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql /table/conn"
14
14
)
15
15
16
16
func TestParse (t * testing.T ) {
17
- newConnector := func (opts ... connector .Option ) * connector .Connector {
18
- c := & connector .Connector {}
17
+ newConnector := func (opts ... xsql .Option ) * xsql .Connector {
18
+ c := & xsql .Connector {}
19
19
for _ , opt := range opts {
20
20
if opt != nil {
21
21
if err := opt .Apply (c ); err != nil {
@@ -26,11 +26,11 @@ func TestParse(t *testing.T) {
26
26
27
27
return c
28
28
}
29
- newTableConn := func (opts ... tableSql .Option ) * tableSql .Conn {
30
- return tableSql .New (context .Background (), nil , nil , opts ... )
29
+ newTableConn := func (opts ... conn .Option ) * conn .Conn {
30
+ return conn .New (context .Background (), nil , nil , opts ... )
31
31
}
32
- newQueryConn := func (opts ... querySql .Option ) * querySql .Conn {
33
- return querySql .New (context .Background (), nil , nil , opts ... )
32
+ newQueryConn := func (opts ... conn2 .Option ) * conn2 .Conn {
33
+ return conn2 .New (context .Background (), nil , nil , opts ... )
34
34
}
35
35
compareConfigs := func (t * testing.T , lhs , rhs * config.Config ) {
36
36
require .Equal (t , lhs .Secure (), rhs .Secure ())
@@ -40,7 +40,7 @@ func TestParse(t *testing.T) {
40
40
for _ , tt := range []struct {
41
41
dsn string
42
42
opts []config.Option
43
- connectorOpts []connector .Option
43
+ connectorOpts []xsql .Option
44
44
err error
45
45
}{
46
46
{
@@ -70,8 +70,8 @@ func TestParse(t *testing.T) {
70
70
config .WithEndpoint ("localhost:2135" ),
71
71
config .WithDatabase ("/local" ),
72
72
},
73
- connectorOpts : []connector .Option {
74
- connector .WithDefaultQueryMode (tableSql .ScriptingQueryMode ),
73
+ connectorOpts : []xsql .Option {
74
+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
75
75
},
76
76
err : nil ,
77
77
},
@@ -82,9 +82,9 @@ func TestParse(t *testing.T) {
82
82
config .WithEndpoint ("localhost:2135" ),
83
83
config .WithDatabase ("/local" ),
84
84
},
85
- connectorOpts : []connector .Option {
86
- connector .WithDefaultQueryMode (tableSql .ScriptingQueryMode ),
87
- connector .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
85
+ connectorOpts : []xsql .Option {
86
+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
87
+ xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
88
88
},
89
89
err : nil ,
90
90
},
@@ -95,10 +95,10 @@ func TestParse(t *testing.T) {
95
95
config .WithEndpoint ("localhost:2135" ),
96
96
config .WithDatabase ("/local" ),
97
97
},
98
- connectorOpts : []connector .Option {
99
- connector .WithDefaultQueryMode (tableSql .ScriptingQueryMode ),
100
- connector .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
101
- connector .WithQueryBind (bind.NumericArgs {}),
98
+ connectorOpts : []xsql .Option {
99
+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
100
+ xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
101
+ xsql .WithQueryBind (bind.NumericArgs {}),
102
102
},
103
103
err : nil ,
104
104
},
@@ -109,10 +109,10 @@ func TestParse(t *testing.T) {
109
109
config .WithEndpoint ("localhost:2135" ),
110
110
config .WithDatabase ("/local" ),
111
111
},
112
- connectorOpts : []connector .Option {
113
- connector .WithDefaultQueryMode (tableSql .ScriptingQueryMode ),
114
- connector .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
115
- connector .WithQueryBind (bind.PositionalArgs {}),
112
+ connectorOpts : []xsql .Option {
113
+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
114
+ xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
115
+ xsql .WithQueryBind (bind.PositionalArgs {}),
116
116
},
117
117
err : nil ,
118
118
},
@@ -123,10 +123,10 @@ func TestParse(t *testing.T) {
123
123
config .WithEndpoint ("localhost:2135" ),
124
124
config .WithDatabase ("/local" ),
125
125
},
126
- connectorOpts : []connector .Option {
127
- connector .WithDefaultQueryMode (tableSql .ScriptingQueryMode ),
128
- connector .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
129
- connector .WithQueryBind (bind.AutoDeclare {}),
126
+ connectorOpts : []xsql .Option {
127
+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
128
+ xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
129
+ xsql .WithQueryBind (bind.AutoDeclare {}),
130
130
},
131
131
err : nil ,
132
132
},
@@ -137,9 +137,9 @@ func TestParse(t *testing.T) {
137
137
config .WithEndpoint ("localhost:2135" ),
138
138
config .WithDatabase ("/local" ),
139
139
},
140
- connectorOpts : []connector .Option {
141
- connector .WithDefaultQueryMode (tableSql .ScriptingQueryMode ),
142
- connector .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
140
+ connectorOpts : []xsql .Option {
141
+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
142
+ xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
143
143
},
144
144
err : nil ,
145
145
},
@@ -150,11 +150,11 @@ func TestParse(t *testing.T) {
150
150
config .WithEndpoint ("localhost:2135" ),
151
151
config .WithDatabase ("/local" ),
152
152
},
153
- connectorOpts : []connector .Option {
154
- connector .WithDefaultQueryMode (tableSql .ScriptingQueryMode ),
155
- connector .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
156
- connector .WithQueryBind (bind.PositionalArgs {}),
157
- connector .WithQueryBind (bind.AutoDeclare {}),
153
+ connectorOpts : []xsql .Option {
154
+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
155
+ xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
156
+ xsql .WithQueryBind (bind.PositionalArgs {}),
157
+ xsql .WithQueryBind (bind.AutoDeclare {}),
158
158
},
159
159
err : nil ,
160
160
},
@@ -165,9 +165,9 @@ func TestParse(t *testing.T) {
165
165
config .WithEndpoint ("localhost:2135" ),
166
166
config .WithDatabase ("/local" ),
167
167
},
168
- connectorOpts : []connector .Option {
169
- connector .WithFakeTx (tableSql .ScriptingQueryMode ),
170
- connector .WithFakeTx (tableSql .SchemeQueryMode ),
168
+ connectorOpts : []xsql .Option {
169
+ xsql .WithFakeTx (conn .ScriptingQueryMode ),
170
+ xsql .WithFakeTx (conn .SchemeQueryMode ),
171
171
},
172
172
err : nil ,
173
173
},
0 commit comments