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.
16 lines (15 loc) • 787 B
TypeScript
import { ConditionOptions } from '../select/conditionals/types';
import { PreparedStatement } from '../types';
import { UpdateOptions, UpdateValues } from './types';
/**
*
* @param table Table to update
* @param values New values, Object where keys are the columns to be updated
* @param whereOpts Where object
* @param opts Extra update options like `ignore`, `order`, `limit`
* @returns UPDATE SQL Query
* @example update('table', {name: "John", bornData: new Date(2020,8,30)}, {id: 1})
* >>> "UPDATE `table` SET `name` = 'John',`bornData` = '2020-09-30 00:00:00.000' WHERE (`table`.`id` = 1);"
*/
declare const update: (table: string, values: UpdateValues, whereOpts?: ConditionOptions, opts?: UpdateOptions | undefined) => PreparedStatement | string;
export default update;