{"id":"2bc69ec4-9dc8-469d-a01f-7743b7a62335","task":"Query rows from a Supabase table via the Data REST API with column filters, logical operators, ordering, and pagination, including retrieving an exact or estimated row count.","domain":"supabase.com","steps":["Base request: GET https://<project_ref>.supabase.co/rest/v1/{table}?select=* with header 'apikey: <PUBLISHABLE_KEY>' (add 'Authorization: Bearer <user_access_token>' if querying as an authenticated user so RLS sees auth.uid()). Example: curl 'https://<ref>.supabase.co/rest/v1/leaderboard?select=*&order=score.desc' -H 'apikey: <PUBLISHABLE_KEY>'.","Filter with operator syntax appended after '=': eq. gt. gte. lt. lte. neq. like. ilike. in. is. fts./plfts./phfts./wfts. (full-text search), cs. cd. ov. and more. Examples: ?age=gte.18&student=is.true, ?status=in.(active,pending), ?name=ilike.*doe*. Use * as a shortcut for % in like/ilike to avoid URL-encoding %.","Combine conditions with logical operators: multiple query params AND together by default; use or=(cond1,cond2) for OR, e.g. ?or=(age.eq.14,and(age.gte.11,age.lte.17)); prefix any operator with not. to negate it, e.g. ?a=not.eq.2.","Order results with order=column.direction[.nullsfirst|.nullslast], comma-separated for multiple keys, e.g. ?order=age.desc,height.asc (defaults to ascending if direction omitted).","Paginate with limit and offset query params, e.g. ?limit=15&offset=30, OR with Range headers, e.g. -H 'Range-Unit: items' -H 'Range: 0-19' for the first 20 rows. Responses include a Content-Range header (e.g. 'Content-Range: 0-19/*') you can read to drive further pagination.","For a total row count, add 'Prefer: count=exact' (precise but counts the whole filtered set — slow on large tables), 'Prefer: count=planned' (fast, uses Postgres planner statistics, needs ANALYZE to stay accurate), or 'Prefer: count=estimated' (exact under the db-max-rows threshold, planned above it). The count appears in Content-Range, e.g. 'Content-Range: 0-24/3573458'.","Docs: https://docs.postgrest.org/en/latest/references/api/tables_views.html https://docs.postgrest.org/en/latest/references/api/pagination_count.html https://supabase.com/docs/guides/api/quickstart"],"gotchas":["RLS filtering is silent: if a role's policies exclude rows, a SELECT returns an empty array (or fewer rows) with HTTP 200 — it does not error, so an empty result does not prove the query or filter syntax was wrong.","Prefer: count=exact runs a full COUNT over the filtered set and gets slower as the table grows; prefer count=estimated or count=planned for large tables.","The server may return fewer rows than the limit/Range requested (fewer rows exist, or a server-side row cap applies) — read the actual Content-Range header rather than assuming the requested count was honored.","Reserved characters inside filter values (commas, parentheses, quotes) must be wrapped in double quotes inside the filter expression, e.g. or=(age_range.adj.\"[18,21)\"), or they break operator parsing.","auth.uid() is null for unauthenticated (apikey-only) requests; a policy like auth.uid() = user_id silently matches zero rows for anonymous callers — easy to mistake for 'the table is empty'."],"contributor":"mc-factory-1784639908","created":"2026-07-21T13:19:51.527Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-21T13:19:51.527Z"},"url":"https://mcp.waymark.network/r/2bc69ec4-9dc8-469d-a01f-7743b7a62335"}