14th Commit
This commit is contained in:
parent
b735bdefb1
commit
c02afc5321
@ -56,8 +56,6 @@ import
|
|||||||
email: string
|
email: string
|
||||||
password: string
|
password: string
|
||||||
db = newDatabase()
|
db = newDatabase()
|
||||||
# db3 = newDatabase3()
|
|
||||||
# db1 = newDatabase1()
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
email = ctx.cookies["email"]
|
email = ctx.cookies["email"]
|
||||||
@ -87,8 +85,6 @@ import
|
|||||||
email: string
|
email: string
|
||||||
password: string
|
password: string
|
||||||
db = newDatabase()
|
db = newDatabase()
|
||||||
# db3 = newDatabase3()
|
|
||||||
# db1 = newDatabase1()
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
email = ctx.cookies["email"]
|
email = ctx.cookies["email"]
|
||||||
@ -118,8 +114,6 @@ import
|
|||||||
email: string
|
email: string
|
||||||
password: string
|
password: string
|
||||||
db = newDatabase()
|
db = newDatabase()
|
||||||
# db3 = newDatabase3()
|
|
||||||
# db1 = newDatabase1()
|
|
||||||
|
|
||||||
products: seq[Products]
|
products: seq[Products]
|
||||||
|
|
||||||
|
@ -2,14 +2,6 @@ import db_connector/db_sqlite, strutils
|
|||||||
|
|
||||||
import ../a3pkg/models
|
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) =
|
proc close*(db: DbConn) =
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
|
@ -2,14 +2,6 @@ import db_connector/db_sqlite
|
|||||||
|
|
||||||
import ../a3pkg/models
|
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) =
|
proc close*(db: DbConn) =
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
|
@ -2,14 +2,6 @@ import db_connector/db_sqlite, strutils
|
|||||||
|
|
||||||
import ../a3pkg/models
|
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) =
|
proc close*(db: DbConn) =
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
|
@ -4,14 +4,6 @@ import
|
|||||||
|
|
||||||
import ../a3pkg/models
|
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) =
|
proc close*(db: DbConn) =
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
|
@ -6,14 +6,9 @@ import
|
|||||||
proc newDatabase*(filename = "db5.sqlite3"): DbConn =
|
proc newDatabase*(filename = "db5.sqlite3"): DbConn =
|
||||||
result = open(filename, "", "", "")
|
result = open(filename, "", "", "")
|
||||||
|
|
||||||
# proc newDatabase1*(filename = "db5.sqlite3"): DbConn =
|
|
||||||
# result = open(filename, "", "", "")
|
|
||||||
|
|
||||||
proc micsGetProducts*(email, password: string): seq[Products]=
|
proc micsGetProducts*(email, password: string): seq[Products]=
|
||||||
var
|
var
|
||||||
# db1 = newDatabase1()
|
|
||||||
db = newDatabase()
|
db = newDatabase()
|
||||||
# db3 = newDatabase3()
|
|
||||||
|
|
||||||
userId = db.getUserId(email, password)
|
userId = db.getUserId(email, password)
|
||||||
cart = db.getUserCart(userId)
|
cart = db.getUserCart(userId)
|
||||||
|
Loading…
Reference in New Issue
Block a user