mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Data layer restructuring (#997)
* Move query builders to sqlite package * Add transaction system * Wrap model resolvers in transaction * Add error return value for StringSliceToIntSlice * Update/refactor mutation resolvers * Convert query builders * Remove unused join types * Add stash id unit tests * Use WAL journal mode
This commit is contained in:
@@ -68,9 +68,9 @@ func Initialize(databasePath string) bool {
|
||||
|
||||
func open(databasePath string, disableForeignKeys bool) *sqlx.DB {
|
||||
// https://github.com/mattn/go-sqlite3
|
||||
url := "file:" + databasePath
|
||||
url := "file:" + databasePath + "?_journal=WAL"
|
||||
if !disableForeignKeys {
|
||||
url += "?_fk=true"
|
||||
url += "&_fk=true"
|
||||
}
|
||||
|
||||
conn, err := sqlx.Open(sqlite3Driver, url)
|
||||
|
||||
Reference in New Issue
Block a user