Get rid of in-memory DB
This commit is contained in:
parent
7af6822af3
commit
492fb07e66
@ -18,14 +18,9 @@ type Store struct {
|
|||||||
genString GenString
|
genString GenString
|
||||||
}
|
}
|
||||||
|
|
||||||
const InMemory = ":memory:"
|
|
||||||
|
|
||||||
func NewStore(filename string, genString GenString) (*Store, error) {
|
func NewStore(filename string, genString GenString) (*Store, error) {
|
||||||
var needCreate bool
|
var needCreate bool
|
||||||
if filename == InMemory {
|
if _, err := os.Stat(filename); os.IsNotExist(err) {
|
||||||
filename = "file::memory:?mode=memory"
|
|
||||||
needCreate = true
|
|
||||||
} else if _, err := os.Stat(filename); os.IsNotExist(err) {
|
|
||||||
needCreate = true
|
needCreate = true
|
||||||
}
|
}
|
||||||
// If the file exists, then assume it was created properly.
|
// If the file exists, then assume it was created properly.
|
||||||
|
Loading…
Reference in New Issue
Block a user