Skip to content

Commit

Permalink
set default BUSY_TIMEOUT(5000)
Browse files Browse the repository at this point in the history
  • Loading branch information
glebarez committed Mar 6, 2023
1 parent f07eb50 commit 5314c3c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,12 @@ func applyQueryParams(c *conn, query string) error {
return err
}

// set default BUSY_TIMEOUT, just like mattn/go-sqlite3 does.
_, err = c.exec(context.Background(), `pragma BUSY_TIMEOUT(5000)`, nil)
if err != nil {
return err
}

for _, v := range q["_pragma"] {
cmd := "pragma " + v
_, err := c.exec(context.Background(), cmd, nil)
Expand Down

0 comments on commit 5314c3c

Please sign in to comment.