Skip to main content

@rtorcato/db-common / where

Function: where()

where(filter): Condition[]

Defined in: where.ts:42

Normalize a filter object into a flat list of { col, op, val }. Bare values become eq; nested objects use operator keys. The caller maps these to its driver's placeholders — a val of null is left as-is (map to IS NULL).

where({ status: 'active', age: { gte: 18 } }) // → [{ col: 'status', op: 'eq', val: 'active' }, // { col: 'age', op: 'gte', val: 18 }]

Parameters

filter

Filter

Returns

Condition[]