23 lines
715 B
TypeScript
23 lines
715 B
TypeScript
import type { APIResponseObject, BunSQLiteConfig } from "../../types";
|
|
type Params<Schema extends {
|
|
[k: string]: any;
|
|
} = {
|
|
[k: string]: any;
|
|
}, Table extends string = string> = {
|
|
table: Table;
|
|
data: Schema[];
|
|
update_on_duplicate?: boolean;
|
|
/**
|
|
* Append `RETURNING *` so the inserted record(s) come back in
|
|
* `payload`/`singleRes`. Defaults to `true`.
|
|
*/
|
|
returning?: boolean;
|
|
config?: BunSQLiteConfig;
|
|
};
|
|
export default function DbInsert<Schema extends {
|
|
[k: string]: any;
|
|
} = {
|
|
[k: string]: any;
|
|
}, Table extends string = string>({ table, data, update_on_duplicate, returning, config, }: Params<Schema, Table>): Promise<APIResponseObject<Schema>>;
|
|
export {};
|