new upsert(table, uuid, record, options) → {Operation}
Insert or update a record using SQL MERGE
Parameters:
Name | Type | Description |
---|---|---|
table |
string | The target table |
uuid |
string | The uuid column to determine a matching/existing record |
record |
object | Payload data for the record as a JS object |
options |
object | Optional options argument |
- Source:
Returns:
- Type
- Operation
Example
execute(
upsert(table, uuid, record, { setNull: "'undefined'", logValues: false})
)(state)
execute(
upsert(table, [uuid1, uuid2], record, { setNull: "'undefined'", logValues: false})
)(state)