Last active
September 15, 2016 19:18
-
-
Save dgsb/6061941d2185f761848b143f080f4cd9 to your computer and use it in GitHub Desktop.
sqlite3 journal issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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