99 "github.com/ydb-platform/ydb-go-sdk/v3/config"
1010 "github.com/ydb-platform/ydb-go-sdk/v3/internal/bind"
1111 "github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql"
12- "github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql/legacy "
13- "github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql/propose "
12+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql/xquery "
13+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql/xtable "
1414)
1515
1616func TestParse (t * testing.T ) {
@@ -26,11 +26,11 @@ func TestParse(t *testing.T) {
2626
2727 return c
2828 }
29- newLegacyConn := func (opts ... legacy .Option ) * legacy .Conn {
30- return legacy .New (context .Background (), nil , nil , opts ... )
29+ newLegacyConn := func (opts ... xtable .Option ) * xtable .Conn {
30+ return xtable .New (context .Background (), nil , nil , opts ... )
3131 }
32- newQueryConn := func (opts ... propose .Option ) * propose .Conn {
33- return propose .New (context .Background (), nil , nil , opts ... )
32+ newQueryConn := func (opts ... xquery .Option ) * xquery .Conn {
33+ return xquery .New (context .Background (), nil , nil , opts ... )
3434 }
3535 compareConfigs := func (t * testing.T , lhs , rhs * config.Config ) {
3636 require .Equal (t , lhs .Secure (), rhs .Secure ())
@@ -71,7 +71,7 @@ func TestParse(t *testing.T) {
7171 config .WithDatabase ("/local" ),
7272 },
7373 connectorOpts : []xsql.Option {
74- xsql .WithDefaultQueryMode (legacy .ScriptingQueryMode ),
74+ xsql .WithDefaultQueryMode (xtable .ScriptingQueryMode ),
7575 },
7676 err : nil ,
7777 },
@@ -83,7 +83,7 @@ func TestParse(t *testing.T) {
8383 config .WithDatabase ("/local" ),
8484 },
8585 connectorOpts : []xsql.Option {
86- xsql .WithDefaultQueryMode (legacy .ScriptingQueryMode ),
86+ xsql .WithDefaultQueryMode (xtable .ScriptingQueryMode ),
8787 xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
8888 },
8989 err : nil ,
@@ -96,7 +96,7 @@ func TestParse(t *testing.T) {
9696 config .WithDatabase ("/local" ),
9797 },
9898 connectorOpts : []xsql.Option {
99- xsql .WithDefaultQueryMode (legacy .ScriptingQueryMode ),
99+ xsql .WithDefaultQueryMode (xtable .ScriptingQueryMode ),
100100 xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
101101 xsql .WithQueryBind (bind.NumericArgs {}),
102102 },
@@ -110,7 +110,7 @@ func TestParse(t *testing.T) {
110110 config .WithDatabase ("/local" ),
111111 },
112112 connectorOpts : []xsql.Option {
113- xsql .WithDefaultQueryMode (legacy .ScriptingQueryMode ),
113+ xsql .WithDefaultQueryMode (xtable .ScriptingQueryMode ),
114114 xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
115115 xsql .WithQueryBind (bind.PositionalArgs {}),
116116 },
@@ -124,7 +124,7 @@ func TestParse(t *testing.T) {
124124 config .WithDatabase ("/local" ),
125125 },
126126 connectorOpts : []xsql.Option {
127- xsql .WithDefaultQueryMode (legacy .ScriptingQueryMode ),
127+ xsql .WithDefaultQueryMode (xtable .ScriptingQueryMode ),
128128 xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
129129 xsql .WithQueryBind (bind.AutoDeclare {}),
130130 },
@@ -138,7 +138,7 @@ func TestParse(t *testing.T) {
138138 config .WithDatabase ("/local" ),
139139 },
140140 connectorOpts : []xsql.Option {
141- xsql .WithDefaultQueryMode (legacy .ScriptingQueryMode ),
141+ xsql .WithDefaultQueryMode (xtable .ScriptingQueryMode ),
142142 xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
143143 },
144144 err : nil ,
@@ -151,7 +151,7 @@ func TestParse(t *testing.T) {
151151 config .WithDatabase ("/local" ),
152152 },
153153 connectorOpts : []xsql.Option {
154- xsql .WithDefaultQueryMode (legacy .ScriptingQueryMode ),
154+ xsql .WithDefaultQueryMode (xtable .ScriptingQueryMode ),
155155 xsql .WithQueryBind (bind .TablePathPrefix ("path/to/tables" )),
156156 xsql .WithQueryBind (bind.PositionalArgs {}),
157157 xsql .WithQueryBind (bind.AutoDeclare {}),
@@ -183,15 +183,15 @@ func TestParse(t *testing.T) {
183183 exp := newConnector (tt .connectorOpts ... )
184184 act := newConnector (d .databaseSQLOptions ... )
185185 t .Run ("tableOptions" , func (t * testing.T ) {
186- require .Equal (t , newLegacyConn (exp .LegacyOpts ... ), newLegacyConn (act .LegacyOpts ... ))
186+ require .Equal (t , newLegacyConn (exp .TableOpts ... ), newLegacyConn (act .TableOpts ... ))
187187 })
188188 t .Run ("queryOptions" , func (t * testing.T ) {
189- require .Equal (t , newQueryConn (exp .Options ... ), newQueryConn (act .Options ... ))
189+ require .Equal (t , newQueryConn (exp .QueryOpts ... ), newQueryConn (act .QueryOpts ... ))
190190 })
191- exp .LegacyOpts = nil
192- exp .Options = nil
193- act .LegacyOpts = nil
194- act .Options = nil
191+ exp .TableOpts = nil
192+ exp .QueryOpts = nil
193+ act .TableOpts = nil
194+ act .QueryOpts = nil
195195 require .Equal (t , exp .Bindings (), act .Bindings ())
196196 require .Equal (t , exp , act )
197197 compareConfigs (t , config .New (tt .opts ... ), d .config )
0 commit comments