Supabase Extended icon

Supabase Extended

Interact with Supabase database and storage

Database → Count

AI-generated

Summary

Count matching rows in a Supabase database table, with support for filtering, table joins, and grouped batch counts.

Inputs

  • uiMode — Choose between form fields (Simple) or JSON configuration (Advanced) for filters.
  • table (required) — Name of the database table to count rows from.
  • filters — List of filter rules (column, operator, value) used when UI Mode is Simple.
  • advancedFilters — JSON object specifying filter conditions used when UI Mode is Advanced.
  • joins — Configure PostgREST resource embedding joins to filter counts by related tables.
  • batchCounts — Whether to combine input items into a single SQL GROUP BY query using the exec_sql_select RPC function.
  • groupByColumn (required) — Column used to group row counts when Batch Counts is enabled.

Output shape

A JSON object containing row count metrics.

Standard mode returns an object with 'count' and 'table' for each input item. Batch Counts mode returns a single object with 'table', 'groupByColumn', and an array of grouped counts under 'data'.

Examples

Example 1: Count active records in a table

Table: 'users', Filters: status = 'active'

Example 2: Group row counts by category across items

Table: 'products', Batch Counts: true, Group By Column: 'category'

Links

Discussion