go-waku/waku/persistence/sqlite/mock.go

18 lines
288 B
Go
Raw Normal View History

package sqlite
import (
"database/sql"
"log"
_ "github.com/mattn/go-sqlite3"
)
func NewMockSqliteDB() *sql.DB {
db, err := sql.Open("sqlite3", ":memory:")
if err != nil {
log.Fatalf("an error '%s' was not expected when opening a stub database connection", err)
}
return db
}