Summary
whereBetween / whereNotBetween build BETWEEN ? AND ? literally instead of using getPlaceholder. On Postgres the driver needs $n placeholders, so these fail; mixing with a prior .where() yields WHERE name = $1 AND age BETWEEN ? AND ? — $1 and ? in one statement, which Postgres rejects.
Evidence (repro)
selectFrom('users').where({name:'a'}).whereBetween('age',10,20).toSQL()
-> ... WHERE name = $1 AND age BETWEEN ? AND ?Location
src/client.ts:~3826 and ~3979.
Suggested fix
Build placeholders via getPlaceholder(whereParams.length + 1) / +2, like the other where-helpers.
Severity: high. Found via internal code audit.