# Warn about not limiting the number of returns for a query (`@greenpoint/limit-db-query-results`)

⚠️ This rule _warns_ in the ✅ `recommended` config.

<!-- end auto-generated rule header -->

## Rule Details

This rule aims to limit the maximum number of data that can be returned by a single SQL query to reduce the amount of transferred data and limit it to the bare minimum.

## Examples

Examples of **non-compliant** code for this rule:

```js
const query = "SELECT * FROM clients";
```

Examples of **compliant** code for this rule:

```js
const query = "SELECT columns FROM table_name FETCH FIRST number ROWS ONLY";
```

## Further Reading

- [cnumr/best-practices/Optimize database queries](https://github.com/cnumr/best-practices/blob/fc5a1f865bafb196e4775cce8835393751d40ed8/chapters/BP_075_en.md)
