// db/queries.ts
"use server";
import { eq, not , asc} from "drizzle-orm";
import { Product } from '../../schema/Product'
import { db } from '../../index';

// Fetch all account
export async function getAllProducts() {
  return await db.select().from(Product);
}

// Add a new product
export async function addProduct() {
  return await db.insert(Product).values({}).returning();
}

// Update a Product
export async function updateProduct( ) {
  return await db.update(Product).set({  }).where(eq(Product.id, id));
}

// Delete a product
export async function deleteProduct(id: number) {
  return await db.delete(Product).where(eq(Product.id, id));
}