We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b464f4d commit cb663abCopy full SHA for cb663ab
backend/sqlite/sqlite.go
@@ -33,12 +33,14 @@ import (
33
var migrationsFS embed.FS
34
35
func NewInMemoryBackend(opts ...option) *sqliteBackend {
36
- b := newSqliteBackend("file::memory:?mode=memory&cache=shared", opts...)
+ // Use a unique named in-memory database
37
+ dsn := fmt.Sprintf("file:%s?mode=memory&cache=shared", uuid.NewString())
38
+ b := newSqliteBackend(dsn, opts...)
39
40
b.db.SetConnMaxIdleTime(0)
41
b.db.SetMaxIdleConns(1)
42
- // WORKAROUND: Keep a connection open at all times to prevent hte in-memory db from being dropped
43
+ // WORKAROUND: Keep a connection open at all times to prevent the in-memory db from being dropped
44
b.db.SetMaxOpenConns(2)
45
46
var err error
0 commit comments