Refactoring: Add a query builder class for Postgres
- Add a simple query builder for dynamic SQL queries
- Add a method to make pagination clause consistent
- Refactor 'origin_visit_get_range' to use the builder
First set of re-factoring for pagination changes. No breaking changes. Other functions will be changed to have consistant queries.
Edited by Jayesh