@@ -9,9 +9,10 @@ import (
9
9
"strings"
10
10
"testing"
11
11
12
- "github.com/sqlc-dev/sqlc/internal/sqltest"
13
-
12
+ _ "github.com/go-sql-driver/mysql"
14
13
"github.com/google/go-cmp/cmp"
14
+
15
+ "github.com/sqlc-dev/sqlc/internal/sqltest/hosted"
15
16
)
16
17
17
18
func join (vals ... string ) sql.NullString {
@@ -143,10 +144,14 @@ func runOnDeckQueries(t *testing.T, q *Queries) {
143
144
func TestPrepared (t * testing.T ) {
144
145
t .Parallel ()
145
146
146
- sdb , cleanup := sqltest .MySQL (t , []string {"schema" })
147
- defer cleanup ()
147
+ uri := hosted .MySQL (t , []string {"schema" })
148
+ db , err := sql .Open ("mysql" , uri )
149
+ if err != nil {
150
+ t .Fatal (err )
151
+ }
152
+ defer db .Close ()
148
153
149
- q , err := Prepare (context .Background (), sdb )
154
+ q , err := Prepare (context .Background (), db )
150
155
if err != nil {
151
156
t .Fatal (err )
152
157
}
@@ -157,8 +162,12 @@ func TestPrepared(t *testing.T) {
157
162
func TestQueries (t * testing.T ) {
158
163
t .Parallel ()
159
164
160
- sdb , cleanup := sqltest .MySQL (t , []string {"schema" })
161
- defer cleanup ()
165
+ uri := hosted .MySQL (t , []string {"schema" })
166
+ db , err := sql .Open ("mysql" , uri )
167
+ if err != nil {
168
+ t .Fatal (err )
169
+ }
170
+ defer db .Close ()
162
171
163
- runOnDeckQueries (t , New (sdb ))
172
+ runOnDeckQueries (t , New (db ))
164
173
}
0 commit comments