moigagoo / norm

A Nim ORM for SQLite and Postgres
https://norm.nim.town
MIT License
378 stars 34 forks source link

How to apply `LIMIT`, `ORDER BY` and `OFFSET` to norm query (postgres) #169

Closed C-NERD closed 1 year ago

C-NERD commented 1 year ago

Hello I have been using norm lately and it's a great library but I ran into a problem, it's that I could not find a way to apply limit, order by or offset to my SQL query. I now naturally norm selects all tables and can filter tables based upon given conditions. But these conditions are applied after the SQL WHERE clause which causes postgres to throw an error. So is there a way to apply the LIMIT, OFFSET OR ORDER BY clause to the query. Also I know this is meant to be in another issue but while going through norms source code I found out that norm uses a nimble package called ndb to connect to SQLite and postgresql. Why isn't the SQL standard library package db_sqlite and db_postgres used ?