summary refs log tree commit diff stats
path: root/storage/storage.go
diff options
context:
space:
mode:
Diffstat (limited to 'storage/storage.go')
-rw-r--r--storage/storage.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/storage/storage.go b/storage/storage.go
index 24f770d..33dd29f 100644
--- a/storage/storage.go
+++ b/storage/storage.go
@@ -1,17 +1,23 @@
 package storage
 
 import (
+	"database/sql"
 	"sync"
-
-	"tildegit.org/andinus/perseus/storage/sqlite3"
 )
 
+// DB holds the database connection, mutex & path.
+type DB struct {
+	Path string
+	Mu   *sync.RWMutex
+	Conn *sql.DB
+}
+
 // Init initializes the database.
-func Init() *sqlite3.DB {
-	var db sqlite3.DB = sqlite3.DB{
+func Init() *DB {
+	db := DB{
 		Mu: new(sync.RWMutex),
 	}
 
-	sqlite3.Init(&db)
+	initDB(&db)
 	return &db
 }