feat: add products table
This commit is contained in:
parent
e17cea65cb
commit
4bad9655be
4 changed files with 150 additions and 10 deletions
8
crud.py
8
crud.py
|
|
@ -228,3 +228,11 @@ async def get_product(user_id: str, product_id: str) -> Optional[Product]:
|
|||
product = Product.from_row(row) if row else None
|
||||
|
||||
return product
|
||||
|
||||
|
||||
async def get_products(user_id: str, stall_id: str) -> List[Product]:
|
||||
rows = await db.fetchall(
|
||||
"SELECT * FROM nostrmarket.products WHERE user_id = ? AND stall_id = ?",
|
||||
(user_id, stall_id),
|
||||
)
|
||||
return [Product.from_row(row) for row in rows]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue