@nerdware/ddb-single-table
Version:
A schema-based DynamoDB modeling tool, high-level API, and type-generator built to supercharge single-table designs!⚡
19 lines • 1.21 kB
TypeScript
import type { GenerateUpdateExpressionOpts } from "./types/index.js";
import type { ClientWrapperUpdateItemInput } from "../../DdbClientWrapper/types/index.js";
import type { UnknownItem } from "../../types/index.js";
/**
* This function uses the provided `itemAttributes` to generate the following `updateItem` args:
*
* - `UpdateExpression` (may include `"SET"` and/or `"REMOVE"` clauses)
* - `ExpressionAttributeNames`
* - `ExpressionAttributeValues`
*
* `UpdateExpression` Clauses:
* - The `"SET"` clause includes all attributes which are _not_ explicitly `undefined`.
* - The `"REMOVE"` clause includes all attributes which are explicitly set to `undefined`.
* - If {@link GenerateUpdateExpressionOpts|nullHandling} is `"REMOVE"` (default), then
* attributes with `null` values are added to the `"REMOVE"` clause, otherwise they are
* added to the `"SET"` clause.
*/
export declare const generateUpdateExpression: (itemAttributes: UnknownItem, { nullHandling }?: GenerateUpdateExpressionOpts) => { [Key in "UpdateExpression" | "ExpressionAttributeNames" | "ExpressionAttributeValues"]: NonNullable<ClientWrapperUpdateItemInput[Key]>; };
//# sourceMappingURL=generateUpdateExpression.d.ts.map