Skip to content

Commit

Permalink
db: actually set the memory member
Browse files Browse the repository at this point in the history
This was unused and unset previously; let's actually set it so we can use
it later.

Signed-off-by: Tycho Andersen <[email protected]>
  • Loading branch information
Tycho Andersen committed Feb 8, 2017
1 parent 249ccab commit 0be7607
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,18 @@ func OpenWithDSN(dbPath, dsn string) (*DB, error) {

// OpenInMemory opens an in-memory database.
func OpenInMemory() (*DB, error) {
return open(fqdsn(":memory:", ""))
return OpenInMemoryWithDSN("")
}

// OpenInMemoryWithDSN opens an in-memory database with a specific DSN.
func OpenInMemoryWithDSN(dsn string) (*DB, error) {
return open(fqdsn(":memory:", dsn))
db, err := open(fqdsn(":memory:", dsn))
if err != nil {
return nil, err
}

db.memory = true
return db, nil
}

// LoadInMemoryWithDSN loads an in-memory database with that at the path,
Expand Down

0 comments on commit 0be7607

Please sign in to comment.