052
This commit is contained in:
parent
dbe4e2a6d6
commit
26ee05b083
3 changed files with 21 additions and 7 deletions
10
hh1.nimble
10
hh1.nimble
|
@ -1,8 +1,8 @@
|
|||
# Package
|
||||
|
||||
version = "0.1.0"
|
||||
author = "libexi01"
|
||||
description = "A new awesome nimble package"
|
||||
author = "cereci5049"
|
||||
description = "A new awesome nimble package for Whole Sellers to sell directly to Sellers at low cost."
|
||||
license = "BSD-3-Clause"
|
||||
srcDir = "src"
|
||||
installExt = @["nim"]
|
||||
|
@ -12,6 +12,6 @@ bin = @["hh1"]
|
|||
# Dependencies
|
||||
|
||||
requires "nim >= 2.0.8"
|
||||
# requires "https://github.com/ire4ever1190/mike >= 1.3.3"
|
||||
# requires "nimja"
|
||||
# requires "https://codeberg.org/13thab/turso-nim"
|
||||
requires "mike"
|
||||
requires "nimja"
|
||||
requires "https://codeberg.org/13thab/turso-nim"
|
||||
|
|
|
@ -19,4 +19,7 @@ proc setupProducts*(conn: Turso) =
|
|||
imageLink TEXT,
|
||||
FOREIGN KEY (sellerId) REFERENCES Users(idd)
|
||||
)
|
||||
""")
|
||||
""")
|
||||
|
||||
proc createProduct*(conn: Turso, product: Products) =
|
||||
conn.execute(fmt"""INSERT INTO Products (name, description, price, quantity, sellerId) VALUES ("{product.name}", "{product.description}", "{product.price}", "{product.quantity}", "{product.sellerId}")""")
|
||||
|
|
|
@ -10,7 +10,7 @@ type
|
|||
updatedAt*: string
|
||||
accessLevel*: int
|
||||
|
||||
Orders* = object
|
||||
Orders* = ref object
|
||||
id*: int
|
||||
buyerId*: int
|
||||
orderDate*: string
|
||||
|
@ -19,3 +19,14 @@ type
|
|||
billingAddressId*: int
|
||||
createdAt*: string
|
||||
updatedAt*: string
|
||||
|
||||
Products* = ref object
|
||||
id*: int
|
||||
name*: string
|
||||
description*: string
|
||||
price*: int
|
||||
quantity*: int
|
||||
sellerId*: int
|
||||
createdAt*: string
|
||||
updatedAt*: string
|
||||
imageLink*: string
|
||||
|
|
Loading…
Reference in a new issue