@@ -79,8 +79,8 @@ func TestCases(t *testing.T) {
79
79
t .Run ("Migrate_" + engine , func (t * testing.T ) { testMigrate (t , engine ) })
80
80
t .Run ("Version_" + engine , func (t * testing.T ) { testVersion (t , engine ) })
81
81
t .Run ("Drop_" + engine , func (t * testing.T ) { testDrop (t , engine ) })
82
-
83
82
}
83
+ t .Run ("WithInstanceDefaultConfigValues" , func (t * testing.T ) { testSimpleWithInstanceDefaultConfigValues (t ) })
84
84
}
85
85
86
86
func testSimple (t * testing.T , engine string ) {
@@ -106,6 +106,33 @@ func testSimple(t *testing.T, engine string) {
106
106
})
107
107
}
108
108
109
+ func testSimpleWithInstanceDefaultConfigValues (t * testing.T ) {
110
+ dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
111
+ ip , port , err := c .Port (defaultPort )
112
+ if err != nil {
113
+ t .Fatal (err )
114
+ }
115
+
116
+ addr := clickhouseConnectionString (ip , port , "" )
117
+ conn , err := sql .Open ("clickhouse" , addr )
118
+ if err != nil {
119
+ t .Fatal (err )
120
+ }
121
+ d , err := clickhouse .WithInstance (conn , & clickhouse.Config {})
122
+ if err != nil {
123
+ _ = conn .Close ()
124
+ t .Fatal (err )
125
+ }
126
+ defer func () {
127
+ if err := d .Close (); err != nil {
128
+ t .Error (err )
129
+ }
130
+ }()
131
+
132
+ dt .Test (t , d , []byte ("SELECT 1" ))
133
+ })
134
+ }
135
+
109
136
func testMigrate (t * testing.T , engine string ) {
110
137
dktesting .ParallelTest (t , specs , func (t * testing.T , c dktest.ContainerInfo ) {
111
138
ip , port , err := c .Port (defaultPort )
0 commit comments