Jaguar-dart / jaguar_orm

Source-generated ORM with relations (one-to-one, one-to-many, many-to-many), preloading, cascading, polymorphic relations, etc
https://jaguar-dart.github.io
BSD 3-Clause "New" or "Revised" License
217 stars 54 forks source link

how to achieve limit #152

Closed YourksChan closed 5 years ago

YourksChan commented 5 years ago

SELECT c1,c2,cn... FROM table WHERE id>=20000 LIMIT 10;

ishaan1995 commented 5 years ago

@YourksChan If you generated your beans, there is a finder method inside the bean which allows limit query.

Eg:

Let's say your table name is User and generated bean is UserBean.

List<User> users = await userBean.findMany(userBean.finder.gtEq('id', 20000).limit(10));
YourksChan commented 5 years ago

@YourksChan If you generated your beans, there is a finder method inside the bean which allows limit query.

Eg:

Let's say your table name is User and generated bean is UserBean.

List<User> users = await userBean.findMany(userBean.finder.gtEq('id', 20000).limit(10));

Thanks!