19 lines
588 B
TypeScript
19 lines
588 B
TypeScript
import type { APIResponseObject, BunSQLiteConfig, SQLInsertGenValueType } from "../types";
|
|
type Param = {
|
|
query: string;
|
|
values?: SQLInsertGenValueType[];
|
|
config?: BunSQLiteConfig;
|
|
};
|
|
/**
|
|
* # Main DB Handler Function
|
|
* @description Any statement that produces columns (SELECT, WITH, PRAGMA,
|
|
* RETURNING, ...) returns rows. Everything else goes through `run`, which
|
|
* also handles multiple statements.
|
|
*/
|
|
export default function dbHandler<T extends {
|
|
[k: string]: any;
|
|
} = {
|
|
[k: string]: any;
|
|
}>({ query, values, config }: Param): APIResponseObject<T>;
|
|
export {};
|