Skip to content

Instantly share code, notes, and snippets.

@dgsb
Last active September 15, 2016 19:18
Show Gist options
  • Save dgsb/6061941d2185f761848b143f080f4cd9 to your computer and use it in GitHub Desktop.
Save dgsb/6061941d2185f761848b143f080f4cd9 to your computer and use it in GitHub Desktop.
sqlite3 journal issue
package main
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
"time"
)
func main() {
db, err := sql.Open("sqlite3", "/tmp/test.db")
if nil != err {
panic("Can not open the database")
}
db.Exec("CREATE TABLE profile (name STRING)")
db.Exec("PRAGMA journal_mode = OFF")
tx, _ := db.Begin()
tx.Exec("INSERT INTO profile (name) VALUES ('someone')")
for true {
time.Sleep(time.Second)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment