Skip to content

mapWhereFields

mapWhereFields(where, toColumn): WhereClause

Defined in: knexify.ts:127

Renames the field keys of a where clause via toColumn, recursing into $or/$and branches and leaving operator keys ($lt, $ne, …) and values untouched.

For a dot-path field ("metadata.ownerName"), only the root segment — the actual SQL column — goes through toColumn. The remaining segments are JSON key names inside the stored document, not SQL identifiers, so fieldMap/columnCase (e.g. snake_case) must never touch them: they describe the table’s column-naming convention, not the shape of whatever JSON happens to be stored in one jsonb/JSON column.

WhereClause

(field) => string

WhereClause