@@ -37,7 +37,7 @@ const (
37
37
)
38
38
39
39
func TestBindingFloat64 (t * testing.T ) {
40
- runTests ( t , dsn , func (dbt * DBTest ) {
40
+ runDBTest ( t , func (dbt * DBTest ) {
41
41
types := [2 ]string {"FLOAT" , "DOUBLE" }
42
42
expected := 42.23
43
43
var out float64
@@ -63,7 +63,7 @@ func TestBindingFloat64(t *testing.T) {
63
63
// TestBindingUint64 tests uint64 binding. Should fail as unit64 is not a
64
64
// supported binding value by Go's sql package.
65
65
func TestBindingUint64 (t * testing.T ) {
66
- runTests ( t , dsn , func (dbt * DBTest ) {
66
+ runDBTest ( t , func (dbt * DBTest ) {
67
67
types := []string {"INTEGER" }
68
68
expected := uint64 (18446744073709551615 )
69
69
for _ , v := range types {
@@ -80,7 +80,7 @@ func TestBindingUint64(t *testing.T) {
80
80
81
81
func TestBindingDateTimeTimestamp (t * testing.T ) {
82
82
createDSN (PSTLocation )
83
- runTests ( t , dsn , func (dbt * DBTest ) {
83
+ runDBTest ( t , func (dbt * DBTest ) {
84
84
expected := time .Now ()
85
85
dbt .mustExec (
86
86
"CREATE OR REPLACE TABLE tztest (id int, ntz timestamp_ntz, ltz timestamp_ltz, dt date, tm time)" )
@@ -150,7 +150,7 @@ func TestBindingDateTimeTimestamp(t *testing.T) {
150
150
}
151
151
152
152
func TestBindingBinary (t * testing.T ) {
153
- runTests ( t , dsn , func (dbt * DBTest ) {
153
+ runDBTest ( t , func (dbt * DBTest ) {
154
154
dbt .mustExec ("CREATE OR REPLACE TABLE bintest (id int, b binary)" )
155
155
var b = []byte {0x01 , 0x02 , 0x03 }
156
156
dbt .mustExec ("INSERT INTO bintest(id,b) VALUES(1, ?)" , DataTypeBinary , b )
@@ -172,7 +172,7 @@ func TestBindingBinary(t *testing.T) {
172
172
}
173
173
174
174
func TestBindingTimestampTZ (t * testing.T ) {
175
- runTests ( t , dsn , func (dbt * DBTest ) {
175
+ runDBTest ( t , func (dbt * DBTest ) {
176
176
expected := time .Now ()
177
177
dbt .mustExec ("CREATE OR REPLACE TABLE tztest (id int, tz timestamp_tz)" )
178
178
stmt , err := dbt .prepare ("INSERT INTO tztest(id,tz) VALUES(1, ?)" )
@@ -201,7 +201,7 @@ func TestBindingTimestampTZ(t *testing.T) {
201
201
202
202
// SNOW-755844: Test the use of a pointer *time.Time type in user-defined structures to perform updates/inserts
203
203
func TestBindingTimePtrInStruct (t * testing.T ) {
204
- runTests ( t , dsn , func (dbt * DBTest ) {
204
+ runDBTest ( t , func (dbt * DBTest ) {
205
205
type timePtrStruct struct {
206
206
id * int
207
207
timeVal * time.Time
@@ -248,7 +248,7 @@ func TestBindingTimePtrInStruct(t *testing.T) {
248
248
249
249
// SNOW-755844: Test the use of a time.Time type in user-defined structures to perform updates/inserts
250
250
func TestBindingTimeInStruct (t * testing.T ) {
251
- runTests ( t , dsn , func (dbt * DBTest ) {
251
+ runDBTest ( t , func (dbt * DBTest ) {
252
252
type timeStruct struct {
253
253
id int
254
254
timeVal time.Time
@@ -294,7 +294,7 @@ func TestBindingTimeInStruct(t *testing.T) {
294
294
}
295
295
296
296
func TestBindingInterface (t * testing.T ) {
297
- runTests ( t , dsn , func (dbt * DBTest ) {
297
+ runDBTest ( t , func (dbt * DBTest ) {
298
298
rows := dbt .mustQueryContext (
299
299
WithHigherPrecision (context .Background ()), selectVariousTypes )
300
300
defer rows .Close ()
@@ -321,7 +321,7 @@ func TestBindingInterface(t *testing.T) {
321
321
}
322
322
323
323
func TestBindingInterfaceString (t * testing.T ) {
324
- runTests ( t , dsn , func (dbt * DBTest ) {
324
+ runDBTest ( t , func (dbt * DBTest ) {
325
325
rows := dbt .mustQuery (selectVariousTypes )
326
326
defer rows .Close ()
327
327
if ! rows .Next () {
@@ -350,7 +350,7 @@ func TestBindingInterfaceString(t *testing.T) {
350
350
func TestBulkArrayBindingInterfaceNil (t * testing.T ) {
351
351
nilArray := make ([]any , 1 )
352
352
353
- runTests ( t , dsn , func (dbt * DBTest ) {
353
+ runDBTest ( t , func (dbt * DBTest ) {
354
354
dbt .mustExec (createTableSQL )
355
355
defer dbt .mustExec (deleteTableSQL )
356
356
@@ -436,7 +436,7 @@ func TestBulkArrayBindingInterface(t *testing.T) {
436
436
int64Array [0 ] = int64 (100 )
437
437
int64Array [1 ] = int64 (200 )
438
438
439
- runTests ( t , dsn , func (dbt * DBTest ) {
439
+ runDBTest ( t , func (dbt * DBTest ) {
440
440
dbt .mustExec (createTableSQLBulkArray )
441
441
defer dbt .mustExec (deleteTableSQLBulkArray )
442
442
@@ -536,7 +536,7 @@ func TestBulkArrayBindingInterfaceDateTimeTimestamp(t *testing.T) {
536
536
tmArray [1 ] = now .Add (8 ).In (loc )
537
537
tmArray [2 ] = now .Add (9 ).In (loc )
538
538
539
- runTests ( t , dsn , func (dbt * DBTest ) {
539
+ runDBTest ( t , func (dbt * DBTest ) {
540
540
dbt .mustExec (createTableSQLBulkArrayDateTimeTimestamp )
541
541
defer dbt .mustExec (deleteTableSQLBulkArrayDateTimeTimestamp )
542
542
@@ -638,7 +638,7 @@ func testBindingArray(t *testing.T, bulk bool) {
638
638
dtArray := []time.Time {now .Add (9 ), now .Add (10 ), now .Add (11 )}
639
639
tmArray := []time.Time {now .Add (12 ), now .Add (13 ), now .Add (14 )}
640
640
641
- runTests ( t , dsn , func (dbt * DBTest ) {
641
+ runDBTest ( t , func (dbt * DBTest ) {
642
642
dbt .mustExec (createTableSQL )
643
643
defer dbt .mustExec (deleteTableSQL )
644
644
if bulk {
@@ -706,7 +706,7 @@ func testBindingArray(t *testing.T, bulk bool) {
706
706
}
707
707
708
708
func TestBulkArrayBinding (t * testing.T ) {
709
- runTests ( t , dsn , func (dbt * DBTest ) {
709
+ runDBTest ( t , func (dbt * DBTest ) {
710
710
dbt .mustExec (fmt .Sprintf ("create or replace table %v (c1 integer, c2 string)" , dbname ))
711
711
numRows := 100000
712
712
intArr := make ([]int , numRows )
@@ -751,7 +751,7 @@ func TestBulkArrayMultiPartBinding(t *testing.T) {
751
751
tempTableName := fmt .Sprintf ("test_table_%v" , randomString (5 ))
752
752
ctx := context .Background ()
753
753
754
- runTests ( t , dsn , func (dbt * DBTest ) {
754
+ runDBTest ( t , func (dbt * DBTest ) {
755
755
dbt .mustExec (fmt .Sprintf ("CREATE TABLE %s (C VARCHAR(64) NOT NULL)" , tempTableName ))
756
756
defer dbt .mustExec ("drop table " + tempTableName )
757
757
@@ -784,7 +784,7 @@ func TestBulkArrayMultiPartBinding(t *testing.T) {
784
784
}
785
785
786
786
func TestBulkArrayMultiPartBindingInt (t * testing.T ) {
787
- runTests ( t , dsn , func (dbt * DBTest ) {
787
+ runDBTest ( t , func (dbt * DBTest ) {
788
788
dbt .mustExec ("create or replace table binding_test (c1 integer)" )
789
789
startNum := 1000000
790
790
endNum := 3000000
@@ -819,7 +819,7 @@ func TestBulkArrayMultiPartBindingInt(t *testing.T) {
819
819
}
820
820
821
821
func TestBulkArrayMultiPartBindingWithNull (t * testing.T ) {
822
- runTests ( t , dsn , func (dbt * DBTest ) {
822
+ runDBTest ( t , func (dbt * DBTest ) {
823
823
dbt .mustExec ("create or replace table binding_test (c1 integer, c2 string)" )
824
824
startNum := 1000000
825
825
endNum := 2000000
@@ -911,7 +911,7 @@ func TestFunctionParameters(t *testing.T) {
911
911
{"timestamp_tzAndTimeResultInNotNull" , "timestamp_tz" , time .Now (), false },
912
912
}
913
913
914
- runTests ( t , dsn , func (dbt * DBTest ) {
914
+ runDBTest ( t , func (dbt * DBTest ) {
915
915
for _ , tc := range testcases {
916
916
t .Run (tc .testDesc , func (t * testing.T ) {
917
917
query := fmt .Sprintf (`
@@ -997,7 +997,7 @@ func TestVariousBindingModes(t *testing.T) {
997
997
},
998
998
}
999
999
1000
- runTests ( t , dsn , func (dbt * DBTest ) {
1000
+ runDBTest ( t , func (dbt * DBTest ) {
1001
1001
for _ , tc := range testcases {
1002
1002
for _ , bindingMode := range bindingModes {
1003
1003
t .Run (tc .testDesc + " " + bindingMode .param , func (t * testing.T ) {
0 commit comments