cyjake / leoric

👑 JavaScript ORM for MySQL, PostgreSQL, and SQLite.

Home Page:https://leoric.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a default .limit(10000)?

cyjake opened this issue · comments

tbh, it's quite easy to forget to add limit clause when querying data from database. The query might work well in local or test environment, but go wild in production because large tables happen.

is it necessary to add an option to be able to set a default .limit(10000) when selecting records from database?

I think this option should be left to the users to decide, as querying 10000 rows of non-wide tables should not cause any significant performance issues. It could perhaps be implemented as a configuration item.

yep, it should only take effect if user specifically opt it in