The build_where_sql() function always started parameter numbering from 1, regardless of how many parameters were already bound before calling it. This caused placeholder collisions on Postgres (which uses numbered $1, $2 placeholders) but worked on SQLite (which uses ? and ignores indices).
For example, a filtered query would generate: WHERE record.collection = $1 AND json->>'uri' = $1 Instead of: WHERE record.collection = $1 AND json->>'uri' = $2
This follows the same pattern as the pagination fix in commit d2dd4a0.
Fixes #7
Confirmed on my local build that this does solve the general issue with filtering (as long as
sortByuses a generated field).