Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

sql to api count

Mark Burggraf5d4ed62d5949
diff --git a/web/docs/guides/database/sql-to-api.mdx b/web/docs/guides/database/sql-to-api.mdx
index 58585294e0e..b646c160305 100644
--- a/web/docs/guides/database/sql-to-api.mdx
+++ b/web/docs/guides/database/sql-to-api.mdx
@@ -58,6 +58,19 @@ const { data, error } = await supabase
.or('and(team_id.eq.CHN,age.gt.35),and(team_id.neq.CHN,.not.age.is.null)')
```
+Get a count of rows, but don't return any data.
+
+```sql
+select count(*) from players
+where team_id = 'NYM'
+```
+
+```js
+const { data, error } = await supabase
+.from('players')
+.select('*', { count: 'exact', head: true }) // exact, planned, or executed
+.eq('team_id', 'NYM')
+```
## Resources