Skip to content

Commit

Permalink
Fix issue with :memory: DBs
Browse files Browse the repository at this point in the history
Previously would get an error when searching complaining about tables
not existing. This was caused by go-sqlite3 creating new connections.
cache=shared is supposed to fix this, but does not seem to work unless
you specify file: before the filename?
  • Loading branch information
JackBister committed Apr 11, 2022
1 parent cc9a577 commit d776fba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/logsuck/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func main() {
},
configSources...)
} else {
db, err := sql.Open("sqlite3", staticConfig.SQLite.DatabaseFile+"?cache=shared&_journal_mode=WAL")
db, err := sql.Open("sqlite3", "file:"+staticConfig.SQLite.DatabaseFile+"?cache=shared&_journal_mode=WAL")
if err != nil {
log.Fatalln(err.Error())
}
Expand Down

0 comments on commit d776fba

Please sign in to comment.