diff options
author | Andinus <andinus@nand.sh> | 2020-03-29 16:10:59 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-03-29 16:10:59 +0530 |
commit | a6826055bf4e6a23f80da047ccfe4509a209f3a6 (patch) | |
tree | f2bb2bec35ee5e61cb42f4edffb04368a0f8ba60 /storage/storage.go | |
parent | 7b95d6b80dd2d1efb26f7c515383abd4f0dc9d42 (diff) | |
download | perseus-a6826055bf4e6a23f80da047ccfe4509a209f3a6.tar.gz |
Initial perseus rewrite
Diffstat (limited to 'storage/storage.go')
-rw-r--r-- | storage/storage.go | 16 |
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 } |