Preventing unintended clause mutation in Knex.js query builders
Knex.js query builders are mutable objects. When a partially constructed builder is passed to a helper function or service layer, that external code can append additional clauses like .where() , join() , or select() to the original instance. This risks accidental data exposure or logic bypass if the developer assumes the query is immutable once passed. Since