Remove MustPrepare.

This commit is contained in:
Nuno Cruces
2023-03-08 17:39:41 +00:00
parent 677f51bec1
commit 926adeb3f5
6 changed files with 20 additions and 82 deletions

View File

@@ -26,7 +26,11 @@ func Example() {
log.Fatal(err)
}
stmt := db.MustPrepare(`SELECT id, name FROM users`)
stmt, _, err := db.Prepare(`SELECT id, name FROM users`)
if err != nil {
log.Fatal(err)
}
defer stmt.Close()
for stmt.Step() {
fmt.Println(stmt.ColumnInt(0), stmt.ColumnText(1))