import { pool } from '@/backend/utils/db'; import { RowDataPacket } from 'mysql2'; /** * Typed query helper for MySQL that ensures safe casting */ export async function typedQuery(sql: string, params: any[] = []): Promise { const [rows] = await pool.query(sql, params); return rows as T[]; }