feat: allow using sqlite in memory database

This allows running vikunja for testing purposes. You almost never want to run this in production.
This commit is contained in:
kolaente 2024-02-15 10:48:48 +01:00
parent 827c43fe12
commit 2dab2ccedd
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 0 deletions

View File

@ -179,6 +179,10 @@ func initSqliteEngine() (engine *xorm.Engine, err error) {
path = "./db.db"
}
if path == "memory" {
return xorm.NewEngine("sqlite3", "file::memory:?cache=shared")
}
// Try opening the db file to return a better error message if that does not work
var exists = true
if _, err := os.Stat(path); err != nil {