Skip to content

Commit

Permalink
Fix TestQueryer test to use exec for multistatement insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbuddy committed Aug 29, 2022
1 parent 72623c7 commit e2bf557
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions sqlite3_test.go
Expand Up @@ -1100,18 +1100,23 @@ func TestQueryer(t *testing.T) {
defer db.Close()

_, err = db.Exec(`
create table foo (id integer);
create table foo (id integer);
`)
if err != nil {
t.Error("Failed to call db.Query:", err)
}

rows, err := db.Query(`
insert into foo(id) values(?);
insert into foo(id) values(?);
insert into foo(id) values(?);
select id from foo order by id;
_, err = db.Exec(`
insert into foo(id) values(?);
insert into foo(id) values(?);
insert into foo(id) values(?);
`, 3, 2, 1)
if err != nil {
t.Error("Failed to call db.Exec:", err)
}
rows, err := db.Query(`
select id from foo order by id;
`)
if err != nil {
t.Error("Failed to call db.Query:", err)
}
Expand Down

0 comments on commit e2bf557

Please sign in to comment.