mysql-all-in-one
Version:
A package that allows you to have a complete interaction with a MYSQL database, allowing to connect to the database, retrieve data and create queries.
30 lines (29 loc) • 1.02 kB
TypeScript
import { SqlValues } from '../types';
export declare const defaultInsertOptions: InsertOptions;
export interface InsertOptions {
/**
* @description Adds IGNORE modifier if true.
* @default false
*/
ignore?: boolean;
/**
* @description Interts only the columns specified on this array. If no value is informed will use the keys of the first InsertRow object as columns to insert.
* @default null
*/
columns?: Array<string>;
/**
* @description Returns a PreparedStament object if true
* @default false
* @example ({
* statement: "INSERT INTO `table` (id, name) VALUES (?,?)",
* values: [1, "John"]
* })
*/
returnPreparedStatement?: boolean;
}
export declare type InsertRows = Array<InsertRow> | InsertRow;
export declare const isInsertRow: (val: any) => val is InsertRow;
export declare const isInsertRows: (val: any) => val is InsertRows;
export interface InsertRow {
[key: string]: SqlValues | undefined | Record<string, any>;
}