moved database init to own file

This commit is contained in:
array-in-a-matrix 2024-07-04 03:19:42 -04:00
parent 4fd51c0367
commit 5716b84f4d

6
src/database.nim Normal file
View file

@ -0,0 +1,6 @@
import norm/[model, sqlite]
import types/[users, files]
# using sqlite as it makes setup faster
# once project is stable enough this will switch to postgresql
let db* = open("storage.db", "", "", "")
db.createTables(newFile()) # file objects require a user object, thus a tables for both are created