forked from External/ergo
prevents default create/open of buntdb, requires user to call initdb
This commit is contained in:
parent
55503961cb
commit
c20afab7c2
1 changed files with 4 additions and 0 deletions
|
|
@ -81,6 +81,10 @@ func OpenDatabase(config *Config) (*buntdb.DB, error) {
|
||||||
|
|
||||||
// open the database, giving it at most one chance to auto-upgrade the schema
|
// open the database, giving it at most one chance to auto-upgrade the schema
|
||||||
func openDatabaseInternal(config *Config, allowAutoupgrade bool) (db *buntdb.DB, err error) {
|
func openDatabaseInternal(config *Config, allowAutoupgrade bool) (db *buntdb.DB, err error) {
|
||||||
|
_, err = os.Stat(config.Datastore.Path)
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
db, err = buntdb.Open(config.Datastore.Path)
|
db, err = buntdb.Open(config.Datastore.Path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue