14th Commit

This commit is contained in:
Aritra Banik 2024-02-06 00:38:49 +05:30
parent b735bdefb1
commit c02afc5321
6 changed files with 0 additions and 43 deletions

View File

@ -56,8 +56,6 @@ import
email: string
password: string
db = newDatabase()
# db3 = newDatabase3()
# db1 = newDatabase1()
try:
email = ctx.cookies["email"]
@ -87,8 +85,6 @@ import
email: string
password: string
db = newDatabase()
# db3 = newDatabase3()
# db1 = newDatabase1()
try:
email = ctx.cookies["email"]
@ -118,8 +114,6 @@ import
email: string
password: string
db = newDatabase()
# db3 = newDatabase3()
# db1 = newDatabase1()
products: seq[Products]

View File

@ -2,14 +2,6 @@ import db_connector/db_sqlite, strutils
import ../a3pkg/models
# type
# Database = ref object
# db: DbConn
# proc newDatabase3*(filename = "db5.sqlite3"): Database =
# new result
# result.db = open(filename, "", "", "")
proc close*(db: DbConn) =
db.close()

View File

@ -2,14 +2,6 @@ import db_connector/db_sqlite
import ../a3pkg/models
type
Database = ref object
db: DbConn
proc newDatabase4*(filename = "db5.sqlite3"): Database =
new result
result.db = open(filename, "", "", "")
proc close*(db: DbConn) =
db.close()

View File

@ -2,14 +2,6 @@ import db_connector/db_sqlite, strutils
import ../a3pkg/models
type
Database = ref object
db: DbConn
proc newDatabase1*(filename = "db5.sqlite3"): Database =
new result
result.db = open(filename, "", "", "")
proc close*(db: DbConn) =
db.close()

View File

@ -4,14 +4,6 @@ import
import ../a3pkg/models
# type
# Database = ref object
# db: DbConn
# proc newDatabase2*(filename = "db5.sqlite3"): Database =
# new result
# result.db = open(filename, "", "", "")
proc close*(db: DbConn) =
db.close()

View File

@ -6,14 +6,9 @@ import
proc newDatabase*(filename = "db5.sqlite3"): DbConn =
result = open(filename, "", "", "")
# proc newDatabase1*(filename = "db5.sqlite3"): DbConn =
# result = open(filename, "", "", "")
proc micsGetProducts*(email, password: string): seq[Products]=
var
# db1 = newDatabase1()
db = newDatabase()
# db3 = newDatabase3()
userId = db.getUserId(email, password)
cart = db.getUserCart(userId)