21 lines
627 B
TypeScript
21 lines
627 B
TypeScript
import type { ConnectionConfig } from "mariadb";
|
|
import type { BUN_MARIADB_TableSchemaType, DBResponseObject } from "../types";
|
|
type Param = {
|
|
query: string;
|
|
values?: string[] | object;
|
|
noErrorLogs?: boolean;
|
|
database?: string;
|
|
tableSchema?: BUN_MARIADB_TableSchemaType;
|
|
config?: ConnectionConfig;
|
|
};
|
|
/**
|
|
* # Main DB Handler Function
|
|
* @requires DSQL_DB_CONN - Gobal Variable for Datasquirel Database
|
|
*/
|
|
export default function dbHandler<T extends {
|
|
[k: string]: any;
|
|
} = {
|
|
[k: string]: any;
|
|
}>({ query, values, noErrorLogs, database, config, }: Param): Promise<DBResponseObject>;
|
|
export {};
|