@@ -8,11 +8,12 @@ import (
88
99 "github.com/ydb-platform/ydb-go-sdk/v3/config"
1010 "github.com/ydb-platform/ydb-go-sdk/v3/internal/bind"
11+ "github.com/ydb-platform/ydb-go-sdk/v3/internal/table/conn"
1112 "github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql"
1213)
1314
1415func TestParse (t * testing.T ) {
15- newConnector := func (opts ... xsql.ConnectorOption ) * xsql.Connector {
16+ newConnector := func (opts ... xsql.Option ) * xsql.Connector {
1617 c := & xsql.Connector {}
1718 for _ , opt := range opts {
1819 if opt != nil {
@@ -32,7 +33,7 @@ func TestParse(t *testing.T) {
3233 for _ , tt := range []struct {
3334 dsn string
3435 opts []config.Option
35- connectorOpts []xsql.ConnectorOption
36+ connectorOpts []xsql.Option
3637 err error
3738 }{
3839 {
@@ -42,9 +43,9 @@ func TestParse(t *testing.T) {
4243 config .WithEndpoint ("localhost:2135" ),
4344 config .WithDatabase ("/local" ),
4445 },
45- connectorOpts : []xsql.ConnectorOption {
46- xsql .WithFakeTx (xsql .ScriptingQueryMode ),
47- xsql .WithFakeTx (xsql .SchemeQueryMode ),
46+ connectorOpts : []xsql.Option {
47+ xsql .WithFakeTx (conn .ScriptingQueryMode ),
48+ xsql .WithFakeTx (conn .SchemeQueryMode ),
4849 },
4950 err : nil ,
5051 },
@@ -75,8 +76,8 @@ func TestParse(t *testing.T) {
7576 config .WithEndpoint ("localhost:2135" ),
7677 config .WithDatabase ("/local" ),
7778 },
78- connectorOpts : []xsql.ConnectorOption {
79- xsql .WithDefaultQueryMode (xsql .ScriptingQueryMode ),
79+ connectorOpts : []xsql.Option {
80+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
8081 },
8182 err : nil ,
8283 },
@@ -87,9 +88,9 @@ func TestParse(t *testing.T) {
8788 config .WithEndpoint ("localhost:2135" ),
8889 config .WithDatabase ("/local" ),
8990 },
90- connectorOpts : []xsql.ConnectorOption {
91- xsql .WithDefaultQueryMode (xsql .ScriptingQueryMode ),
92- xsql .WithTablePathPrefix ( "path/to/tables" ),
91+ connectorOpts : []xsql.Option {
92+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
93+ xsql .WithQueryBind ( bind . TablePathPrefix ( "path/to/tables" ) ),
9394 },
9495 err : nil ,
9596 },
@@ -100,9 +101,9 @@ func TestParse(t *testing.T) {
100101 config .WithEndpoint ("localhost:2135" ),
101102 config .WithDatabase ("/local" ),
102103 },
103- connectorOpts : []xsql.ConnectorOption {
104- xsql .WithDefaultQueryMode (xsql .ScriptingQueryMode ),
105- xsql .WithTablePathPrefix ( "path/to/tables" ),
104+ connectorOpts : []xsql.Option {
105+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
106+ xsql .WithQueryBind ( bind . TablePathPrefix ( "path/to/tables" ) ),
106107 xsql .WithQueryBind (bind.NumericArgs {}),
107108 },
108109 err : nil ,
@@ -114,9 +115,9 @@ func TestParse(t *testing.T) {
114115 config .WithEndpoint ("localhost:2135" ),
115116 config .WithDatabase ("/local" ),
116117 },
117- connectorOpts : []xsql.ConnectorOption {
118- xsql .WithDefaultQueryMode (xsql .ScriptingQueryMode ),
119- xsql .WithTablePathPrefix ( "path/to/tables" ),
118+ connectorOpts : []xsql.Option {
119+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
120+ xsql .WithQueryBind ( bind . TablePathPrefix ( "path/to/tables" ) ),
120121 xsql .WithQueryBind (bind.PositionalArgs {}),
121122 },
122123 err : nil ,
@@ -128,9 +129,9 @@ func TestParse(t *testing.T) {
128129 config .WithEndpoint ("localhost:2135" ),
129130 config .WithDatabase ("/local" ),
130131 },
131- connectorOpts : []xsql.ConnectorOption {
132- xsql .WithDefaultQueryMode (xsql .ScriptingQueryMode ),
133- xsql .WithTablePathPrefix ( "path/to/tables" ),
132+ connectorOpts : []xsql.Option {
133+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
134+ xsql .WithQueryBind ( bind . TablePathPrefix ( "path/to/tables" ) ),
134135 xsql .WithQueryBind (bind.AutoDeclare {}),
135136 },
136137 err : nil ,
@@ -142,9 +143,9 @@ func TestParse(t *testing.T) {
142143 config .WithEndpoint ("localhost:2135" ),
143144 config .WithDatabase ("/local" ),
144145 },
145- connectorOpts : []xsql.ConnectorOption {
146- xsql .WithDefaultQueryMode (xsql .ScriptingQueryMode ),
147- xsql .WithTablePathPrefix ( "path/to/tables" ),
146+ connectorOpts : []xsql.Option {
147+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
148+ xsql .WithQueryBind ( bind . TablePathPrefix ( "path/to/tables" ) ),
148149 },
149150 err : nil ,
150151 },
@@ -155,9 +156,9 @@ func TestParse(t *testing.T) {
155156 config .WithEndpoint ("localhost:2135" ),
156157 config .WithDatabase ("/local" ),
157158 },
158- connectorOpts : []xsql.ConnectorOption {
159- xsql .WithDefaultQueryMode (xsql .ScriptingQueryMode ),
160- xsql .WithTablePathPrefix ( "path/to/tables" ),
159+ connectorOpts : []xsql.Option {
160+ xsql .WithDefaultQueryMode (conn .ScriptingQueryMode ),
161+ xsql .WithQueryBind ( bind . TablePathPrefix ( "path/to/tables" ) ),
161162 xsql .WithQueryBind (bind.PositionalArgs {}),
162163 xsql .WithQueryBind (bind.AutoDeclare {}),
163164 },
0 commit comments