UNPKG

next-era

Version:

Welcome to **Next Era**! A comprehensive library designed to supercharge your **Next.js** applications with powerful utilities and significant performance optimizations. Build faster, more efficient, and feature-rich Next.js projects with ease.

12 lines (11 loc) 474 B
import { SQLPluginType } from "./lib/definitions.js"; /** * Around with a try catch block that is able to rollback the transaction. Adapted from vercel/postgres. * @param query - The promise object to query DataBase. * @returns A new promise object that is arounded with. */ export default function withTransaction<T extends SQLPluginType>(sql: T, query: ReturnType<SQLPluginType["query"]>): Promise<{ rows: { [column: string]: string | number; }[]; }>;