Use Env variables for database

This will enable us to use postgres/sqlite without any code changes

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2022-04-11 09:36:04 +05:30
parent 869820bc19
commit a87f37f689
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5

View file

@ -7,6 +7,7 @@ type
ftype*: string
fhash*: string
fileid*: string
time*: float
caption*: string
type
@ -27,7 +28,7 @@ func NewCensoredData*(ftype = ""; fhash = ""; fileid = ""; caption = ""):
func NewBannedUsers*(userid = int64(0), bantime = 0.0, bantype = ""):
BannedUsers = BannedUsers(userid: userid, bantime: bantime, bantype: bantype)
let dbConn* = sqlite.open("censordata.db", "", "", "")
let dbConn* = getDb()
proc ManageRateLimit(): void=
for i in RateLimiter.keys().toSeq():