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

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

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

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

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