@rtorcato/db-common / setClause
Function: setClause()
setClause(
obj):Assignment[]
Defined in: set-clause.ts:16
Normalize an object into a flat list of { col, val } for an UPDATE's SET,
skipping keys whose value is undefined so partial updates stay safe. Write-
side mirror of where. A null is kept (map it to = NULL); only
undefined — a field the caller didn't touch — is dropped.
setClause({ name: 'Ada', bio: undefined, active: null }) // → [{ col: 'name', val: 'Ada' }, { col: 'active', val: null }]
Parameters
obj
Record<string, unknown>