count_rows
Retrieve row count for a table, optionally filtered by a WHERE clause, to gauge table size before running a full query.
Instructions
Return the row count for a table, optionally filtered by a WHERE clause. Use before run_query to gauge table size and decide whether to add a row limit. Returns {table, where, count}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | Yes | Database key from list_databases. | |
| table | Yes | Table name. Automatically uppercased. | |
| where | No | Optional WHERE clause (without the WHERE keyword) to count a subset of rows. Example: 'STATUS = 0 AND CREATED_AT > ''2024-01-01'''. Omit to count all rows. |