Commit Graph
43 Commits
Author SHA1 Message Date
supabase-vercel-tedd[bot] 74cb5aa97a docs(rls): warn that an auth.uid() is null branch exposes every row (#53995)
## Problem

The RLS guide explains that `auth.uid()` is `null` for a request without
a user, but not what happens when a policy tests for `null` on purpose.
A condition such as `auth.uid() is null or auth.uid() = user_id` returns
every row to such a request. The guide also never says which roles a
policy with no `to` clause applies to.

Related to
[FDBKIN-31059](https://linear.app/supabase/issue/FDBKIN-31059/update-rls-documentation-to-warn-against-common-anon-leak-policy)
Closes
[DOCS-1798](https://linear.app/supabase/issue/DOCS-1798/warn-that-an-authuid-is-null-or-policy-condition-exposes-every-row)

## Solution

The `auth.uid()` section of the RLS guide now states in body text when
`auth.uid()` is `null` and what an owner comparison returns then. A
`danger` admonition replaces the old caution: it shows the insecure `is
null` branch, explains why `to authenticated` alone doesn't fix it, and
gives a safe owner-only policy to copy. "Specify roles in your policies"
now says that a policy with no `to` clause applies to `public`, which
includes `anon`. The old advice to add `auth.uid() IS NOT NULL AND` is
removed, because the plain comparison already returns no rows for such
requests.

## How to verify

1. Open
https://docs-git-tedd-docs-1798-supabase.vercel.app/docs/guides/database/postgres/row-level-security#authuid
and
https://docs-git-tedd-docs-1798-supabase.vercel.app/docs/guides/database/postgres/row-level-security#specify-roles-in-your-policies.
2. The `auth.uid()` section says it returns `null` for any request whose
JWT has no `sub`, including every `anon` request.
3. A danger admonition warns that an `auth.uid() is null` branch returns
every row to such requests, and that `to authenticated` doesn't remove
the risk.
4. The admonition ends with a copyable policy that uses `to
authenticated` and `(select auth.uid()) = user_id`, with no `is null`
branch.
5. "Specify roles in your policies" says a policy with no `to` clause
applies to `public`, which every role, including `anon`, is a member of.
6. The new link from "Specify roles in your policies" (`#authuid`) jumps
to the `auth.uid()` section.

## Checks

Ran `pnpm exec oxfmt --check` on the changed page. ESLint ignores MDX
files. Ran both SQL snippets in PGlite 0.4.5 with `anon` and
`authenticated` roles, Supabase's `auth.uid()` definition, a two-row
table with `select` granted to both roles, and RLS on. With the insecure
policy and no `to`, `anon` reads both rows. With `to authenticated`, a
request with no `sub` reads both rows. With the safe policy, a user
reads only their own row and a request with no `sub` reads none. A
policy with no `to` lists `public` in `pg_policies.roles`, which matches
the Postgres `CREATE POLICY` docs. `pnpm build:guides-markdown` was not
run, because its federated-content step needs GitHub credentials.

## Checklist

- [x] I have read the [Contributing
Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] I have checked that the change works in the preview deployment

## Feedback for Tedd

To ask Tedd for a change to this PR, reply in Tedd's session on
[DOCS-1798](https://linear.app/supabase/issue/DOCS-1798/warn-that-an-authuid-is-null-or-policy-condition-exposes-every-row).
Tedd doesn't read comments on this PR.

---------

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
2026-11-24 20:02:38 -07:00
JerryandNik Richers 3389756a4c fix(docs): correct the JWT team policy example (#53777)
## Problem

Fixes #53776

We hit this while adding team-scoped RLS to a project from the guide.
Creating the policy fails with:

```text
ERROR:  operator does not exist: uuid = jsonb
```

The example uses `team_id in (select auth.jwt() -> 'app_metadata' ->
'teams')`. `->` returns a single `jsonb` value, so `in (select ...)`
compares `team_id` to that jsonb value.

## Solution

Expand the claim with `jsonb_array_elements_text`, cast each team ID to
`uuid`, and compare it with `= any (array(...))`:

```sql
using (
  team_id = any (
    array(
      select (jsonb_array_elements_text((select auth.jwt()) -> 'app_metadata' -> 'teams'))::uuid
    )
  )
);
```

`app_metadata.teams` must be an array of UUID strings, for example
`{"app_metadata": {"teams": ["22222222-2222-2222-2222-222222222222"]}}`.
Objects such as `[{"id": "..."}]` fail the cast.

Comparing UUID to UUID means uppercase values in the claim still match
and Postgres can use an index on `team_id`. The guide and the AI prompt
in `examples/prompts/database-rls-policies.md` both document the
expected claim shape and that `team_id` is a `uuid`; for other ID types,
cast the array element to that type instead.

## Review instructions

1. Open the `auth.jwt()` section of the [RLS
guide](https://supabase.com/docs/guides/database/postgres/row-level-security#auth-jwt).
2. Run the updated `create policy` statement against Postgres. It should
create without error.
3. Check that a user whose `app_metadata.teams` is an array of UUID
strings containing the row's `team_id` sees the row, including when the
claim uses an uppercase UUID, and that a user without it does not.

I checked these steps on Postgres 14.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

I used AI to help debug this. The fix and this pull request are mine; I
reviewed the change before opening it.

---------

Co-authored-by: Nik Richers <nrichers@gmail.com>
2026-11-24 22:20:38 +00:00
supabase-vercel-tedd[bot] cce655195d docs(rls): explain how policy conditions let Postgres use partial indexes (#53970)
## Problem

The "Add indexes" section of the Row Level Security guide covers plain
and composite btree indexes, but not partial indexes. A reader whose
policy filters on a fixed condition, such as a status flag, can't tell
how to index it.

Related to
[FDBKIN-31278](https://linear.app/supabase/issue/FDBKIN-31278/clarify-coordination-between-rls-policies-and-partial-indexes-for)
Closes
[DOCS-1761](https://linear.app/supabase/issue/DOCS-1761/explain-how-rls-policy-predicates-let-postgres-use-partial-indexes)

## Solution

"Add indexes" in the RLS guide now explains that Postgres applies a
policy's condition like a `where` clause. A condition that doesn't
depend on the user therefore lets queries use a partial index with the
same predicate. Postgres matches only some equivalent forms, so the
section tells readers to write the policy condition and the index
predicate the same way. The example follows the section's existing
pattern, a `test_table` policy followed by the index that serves it, and
the section links to the partial indexes section of the indexes guide.

## How to verify

1. Open `/docs/guides/database/postgres/row-level-security#add-indexes`
on the preview.
2. The section explains that a policy's fixed condition lets queries use
a partial index with the same predicate, and that both should be written
the same way.
3. The section has a `test_table` policy `using ( not is_archived )`,
then a partial index `where not is_archived`, in the same style as the
other examples in the section.
4. The section says a `using ( is_archived is false )` policy can't use
that index.
5. The "partial index" link opens the Partial indexes section of the
indexes guide.

## Checks

I ran `pnpm turbo run typecheck`, `pnpm turbo run lint`, and `pnpm exec
oxfmt --check` on the changed file. To test the snippets, I ran them in
PGlite (Postgres 17) on a 200k-row `test_table`, then ran `explain` as
`authenticated` on an `order by created_at desc limit 10` query.
Policies `not is_archived` and `is_archived = false` both used the
partial index. Policies `is_archived is false` and `using (true)` both
used a sequential scan. Behavior checked against the Postgres docs for
[partial
indexes](https://www.postgresql.org/docs/current/indexes-partial.html)
and [CREATE
POLICY](https://www.postgresql.org/docs/current/sql-createpolicy.html).
I skipped the docs tests because they need Docker.

## Checklist

- [x] I have read the [contributing
guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md).
- [x] My change follows the docs style guide.
- [x] I have checked that the links resolve.

## Feedback for Tedd

To ask Tedd for a change to this PR, reply in Tedd's session on
[DOCS-1761](https://linear.app/supabase/issue/DOCS-1761/explain-how-rls-policy-predicates-let-postgres-use-partial-indexes).
Tedd doesn't read comments on this PR.

---------

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
2026-11-24 13:49:27 -07:00
supabase-vercel-tedd[bot] 58e0d8067d docs(rls): add an example for rows shared by two users (#53640)
## Problem

The RLS guide shows policies for rows that belong to one user
(`user_id`), but not for a row that two users share through two columns,
such as the buyer and the seller of an order.

Related to
[FDBKIN-27655](https://linear.app/supabase/issue/FDBKIN-27655)
Closes [DOCS-1686](https://linear.app/supabase/issue/DOCS-1686)

## Solution

Adds a `### Share rows between users` section to the RLS guide, between
"Write a policy for each operation" and "Specify roles in your
policies". The section spans operations, so it sits beside the
per-operation subsections, not among them. It has:

- An `orders` table with `buyer_id` and `seller_id`. RLS is enabled,
grants are revoked from `anon, authenticated`, and `select, update` are
granted to `authenticated`, following the page's grant pattern.
- A select policy and an update policy that both use `(select
auth.uid()) in (buyer_id, seller_id)`. The update policy uses the same
expression in `using` and `with check`, so the updated row must still
include the user as buyer or seller.
- A sentence on `insert` and `delete`: check only the user who can
create or remove the row, because a delete policy that checks both
columns lets one user remove the row for both.
- A note that this needs no `security definer` function, with a link to
"Use security definer functions" for checks against another table.
- A note to index `buyer_id` and `seller_id` separately, with a link to
"Add indexes".

No existing section is changed.

### Verification

- I ran the SQL in PGlite (Postgres 17) with an `authenticated` role, an
`auth.uid()` that reads `request.jwt.claim.sub`, and an index on each of
`buyer_id` and `seller_id`:
- Buyer: selects 1 row and updates 1 row. Setting both IDs to a third
user fails with `new row violates row-level security policy for table
"orders"`.
  - Seller: same as the buyer.
  - Another user: selects 0 rows and updates 0 rows.
- `explain select * from orders` with `enable_seqscan=off` shows a
`BitmapOr` over both indexes, with `auth.uid()` in InitPlans.
- `pnpm turbo run lint --filter='[origin/master]'` passes, with no
findings on the changed file.
- Prettier `--check` passes on the changed file.
- The page compiles with `@mdx-js/mdx`.
- `build:guides-markdown` could not run in the sandbox: it needs GitHub
credentials for federated content.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

---------

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
2026-11-19 22:23:39 +00:00
6891fc4cc6 docs: cross-link RLS and signing keys to the pages readers look for (#52670)
## I have read the CONTRIBUTING.md file.

YES

## What kind of change does this PR introduce?

**Docs fix: three missing or buried cross-links.** Readers who need
Securing your API, custom claims and role-based access control, or the
API key migration guide land on Row Level Security or Signing keys and
stop there, because those pages do not point clearly to the page they
need. This PR adds a tip near the top of Row Level Security, one link in
its `auth.jwt()` section, and two links on Signing keys. It changes
links and one sentence each, nothing else.

Closes DOCS-1572.

## What is the current behavior?

- Linear item: Cross-link RLS and signing keys to the pages readers are
looking for
- The IA scoring v2 comparison on the live site (2026-11-01) found three
findability tasks that fail under both the production nav and Option 1.
A nav change does not fix them.

| Agent lands on | Should reach | Runs that miss (production / Option 1)
|
| --- | --- | --- |
| Row Level Security | Custom claims and RBAC | 9 / 9 of 10 |
| Row Level Security | Securing your API | 10 / 10 of 10 |
| Signing keys | Migrating to new API keys | 9 / 9 of 10 |

- Row Level Security already links to Securing your API in passing and
in its related list, but not where a reader decides to stay or leave.

## What is the new behavior?

| File | Change |
| --- | --- |
| `guides/database/postgres/row-level-security.mdx` | Tip after the
opening admonition, with "refer to": Securing your API for what the Data
API exposes, Custom claims and RBAC for role-based policies. One more
RBAC link in the `auth.jwt()` section. |
| `guides/auth/signing-keys.mdx` | Link to Migrating to new API keys in
the intro and in the step that tells readers to switch to publishable
and secret keys. |

## Additional context

- Worktree:
`~/GitHub/supabase/supabase-worktrees/nikrichers/docs-1572-cross-link-rls-and-signing-keys-to-the-pages-readers-are`
- The `<Admonition type="tip">` matches the admonition syntax already on
the page.

| Check | Result |
| --- | --- |
| Target pages exist | Pass, all three |
| Prettier, stand-in check on both files | Pass |
| Repo `pnpm run format` | Not run locally: `pnpm install` needs Node
22.23.4 or later. CI runs it. |

### Before & After

| Page | Before (production) | After (preview) |
| --- | --- | --- |
| Row Level Security |
[production](https://supabase.com/docs/guides/database/postgres/row-level-security)
|
[preview](https://docs-git-nikrichers-docs-1572-cross-link-rls-an-d0b526-supabase.vercel.app/docs/guides/database/postgres/row-level-security)
|
| Signing keys |
[production](https://supabase.com/docs/guides/auth/signing-keys) |
[preview](https://docs-git-nikrichers-docs-1572-cross-link-rls-an-d0b526-supabase.vercel.app/docs/guides/auth/signing-keys)
|

Both preview pages return 200 and contain the new links.

### Test plan

- [ ] Row Level Security shows the tip near the top, and both links open
the right pages.
- [ ] The `auth.jwt()` section links to Custom claims and RBAC.
- [ ] Signing keys links to Migrating to new API keys in the intro and
in the switch step.
- [ ] After merge: rerun the three affected IA scoring tasks on
production, 10 runs each.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Nik Richers <nik@validmind.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 13:39:08 -07:00
Miranda Limonczenko 76f3d06a8b docs: add Test Row Level Security policies with pgTAP guide (#52344)
Closes DOCS-1499

## Problem

The testing overview teaches RLS tests, in pgTAP and from application
code, in sections that have grown into their own task.


## Solution

This goes above and beyond the initial ask, which was just to move a
section into a new topic.
Because I was here anyway, I aimed to improve the experience and improve
our RLS Evals score on tests. A companion Evals PR will split out a new
Eval for the new topic, migrating the checks that were in the RLS guide.

Some fixes are also included from running our docs skills, including:

- **Structure:** move the pgTAP example and the Application-Level
testing section to
`guides/database/postgres/testing-row-level-security`. The overview
keeps both headings, each with a short pointer. The "RLS policies
testing" nav entry points to the new page, and so does "Test RLS
policies with pgTAP" in the Option 1 nav.
- **Style:** a value-statement opener, lowercase SQL, and the command
split from its output.
- **Technical fixes:** test 2 asserts the `returning` value. Test 4 uses
`is_empty`. The output is the output `supabase test db` prints.
- **Additions:** `supabase start`, the table as a migration applied with
`supabase db reset`, and two sentences on how the test isolates its data
and user. A note for readers who use an agent to write their tests,
linking to a `## Write quality tests with agents` reference section. One
sentence in the RLS guide's `### Run the test suite` links to that
section.


## Review instructions

1. Open [Test Row Level Security policies with
pgTAP](https://docs-git-docs-test-rls-pgtap-supabase.vercel.app/docs/guides/database/postgres/testing-row-level-security)
on the preview. See five steps and a passing `Tests=4` output.
2. Open [Testing
overview](https://docs-git-docs-test-rls-pgtap-supabase.vercel.app/docs/guides/local-development/testing/overview#database-unit-testing-with-pgtap).
See the heading with a one-sentence pointer to the new page.
3. In the sidebar under Local development, Testing, click **RLS policies
testing**. See the new page open.
4. On the [Testing
overview](https://docs-git-docs-test-rls-pgtap-supabase.vercel.app/docs/guides/local-development/testing/overview#application-level-testing),
click **Test the policy from your application**. See the TypeScript
suite on the new page.
5. On the new page, click **Write quality tests with agents** in the
agent note's prompt. See the five rules for agents near the bottom of
the page.
6. On [Row Level
Security](https://docs-git-docs-test-rls-pgtap-supabase.vercel.app/docs/guides/database/postgres/row-level-security#run-the-test-suite),
click **Write quality tests with agents** under Run the test suite. See
the new page open at that section.
7. Open the [Database guides with the Option 1
nav](https://docs-git-docs-test-rls-pgtap-supabase.vercel.app/docs/guides/database/overview?docs-ia-mvp-v1=option-1).
Under Row Level Security, roles and Vault, click **Test RLS policies
with pgTAP**. See the new page open.
2026-10-29 14:23:36 -07:00
ec11e10d35 chore(docs) -- add in relevant crosslinks over to /kb troubleshooting pages (#52503)
## Problem

relevant cross-links missing to KB articles.

## Solution

Claude pass with an attempt to inline these where possible. Some were a
new sentence, but spot check felt like they were mostly appropriate.

## Preview links

N/A b/c too many atomic changes to help that much.

---------

Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-10-29 10:30:15 -05:00
Alexis Aguilar ae991bb19e docs: correct default privilege and function revoke guidance (#51960)
Issue found during my dogfooding project :)

## Problem

The docs on default privileges in `public` don't match what Postgres
grants or what the revoke statements do:

- **Default privileges:** Securing your API and the Row Level Security
guide say new tables grant `SELECT`, `INSERT`, `UPDATE`, and `DELETE`.
New tables grant every table privilege, which also includes `TRUNCATE`,
`REFERENCES`, `TRIGGER`, and, on Postgres 17, `MAINTAIN`.
- **Revoking them:** the statements in Revoke default privileges match
what the Dashboard runs. They remove the privileges the Data API uses,
and leave the other four on new tables and `UPDATE` on new sequences.
- **Functions:** `alter default privileges ... in schema public revoke
execute on functions from public` has no effect. Postgres grants
`EXECUTE` to `PUBLIC` through a global default, and a revoke limited to
one schema can't remove it ([Postgres
docs](https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html)).
New functions stay callable by `anon` and `authenticated` through the
Data API. Securing your API, Working with branches, and Database
functions each say they don't.
- **Dashboard label:** Working with branches refers to a **Default
privileges for new entities** setting. The Data API settings label it
**Automatically expose new tables**.

Resolves
[DOCS-1457](https://linear.app/supabase/issue/DOCS-1457/default-privilege-docs-miss-truncate-references-trigger-and-maintain).

## Solution

The pages describe what Postgres grants and what the Dashboard setting
leaves behind. The revoke procedure removes every default privilege on
new objects.

- **Securing your API:** Default privileges shows the defaults in a
table, and lists what turning off **Automatically expose new tables** in
the Data API settings leaves behind. Revoke default privileges revokes
every privilege on new tables, sequences, and functions, including the
`execute` grant to `PUBLIC`. A caution explains that this revoke also
restricts functions in other schemas, such as helper functions that RLS
policies call. A new Check your default privileges section has a query,
run in the SQL Editor or with `psql`, that lists what each Data API role
receives on new objects.
- **Row Level Security:** the grants table lists every privilege, which
matches its introduction.
- **Working with branches:** uses the current setting label, and says
what the revoke migration leaves, with `maintain` marked as Postgres 17
only.
- **Database functions:** revokes `EXECUTE` from `PUBLIC` without `in
schema`, and notes that the change applies to functions in every schema.

Each changed snippet was run in page order on a hosted project on
Postgres 17.11, inside a transaction that rolled back.

## Product issue

The Dashboard's **Automatically expose new tables** setting runs the
same function revoke
(`packages/pg-meta/src/sql/studio/database/privileges.ts`), so turning
it off leaves new functions callable.
[DAT-192](https://linear.app/supabase/issue/DAT-192) tracks it.

cc @supabase/data-api @avallete

## Preview links

- [Securing your
API](https://docs-git-alexisa-docs-1457-supabase.vercel.app/docs/guides/api/securing-your-api)
- [Row Level
Security](https://docs-git-alexisa-docs-1457-supabase.vercel.app/docs/guides/database/postgres/row-level-security)
- [Working with
branches](https://docs-git-alexisa-docs-1457-supabase.vercel.app/docs/guides/deployment/branching/working-with-branches)
- [Database
functions](https://docs-git-alexisa-docs-1457-supabase.vercel.app/docs/guides/database/functions)

## Additional context

- The Working with branches sentence about new functions on branches
follows from the Postgres default. It wasn't tested on a branch.
- Securing your API and the Row Level Security guide still describe
defaults "on existing projects". That wording changes when the new
default reaches every project, so this PR leaves it.
2026-10-20 11:52:57 -07:00
Miranda Limonczenko f5b00a5237 docs: use the standard run snippet for run-this-query steps (#51974)
## Problem

Many pages tell readers to run SQL in the SQL Editor only. An agent
can't use the Dashboard, so it has no way to run the query.
supabase/supabase#51973 adds a standard snippet that also offers `psql`.
Existing pages don't use it yet.

## Solution

- **Snippet swap:** each simple run-SQL instruction now uses the
standard snippet, placed before the SQL block. Where the old sentence
said what the SQL does, that part stays as its own sentence before the
snippet.


## Preview links

On each page, search for `over a direct connection`.

| Page | Live | Preview |
| --- | --- | --- |
| `ai/automatic-embeddings` |
[Live](https://supabase.com/docs/guides/ai/automatic-embeddings) |
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/ai/automatic-embeddings)
|
| `database/connecting-to-postgres/pooling-and-limits` |
[Live](https://supabase.com/docs/guides/database/connecting-to-postgres/pooling-and-limits)
|
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/database/connecting-to-postgres/pooling-and-limits)
|
| `database/extensions/pg_net` |
[Live](https://supabase.com/docs/guides/database/extensions/pg_net) |
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/database/extensions/pg_net)
|
| `database/postgres/dropping-all-tables-in-schema` |
[Live](https://supabase.com/docs/guides/database/postgres/dropping-all-tables-in-schema)
|
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/database/postgres/dropping-all-tables-in-schema)
|
| `database/postgres/first-row-in-group` |
[Live](https://supabase.com/docs/guides/database/postgres/first-row-in-group)
|
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/database/postgres/first-row-in-group)
|
| `database/postgres/row-level-security` |
[Live](https://supabase.com/docs/guides/database/postgres/row-level-security)
|
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/database/postgres/row-level-security)
|
| `database/postgres/which-version-of-postgres` |
[Live](https://supabase.com/docs/guides/database/postgres/which-version-of-postgres)
|
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/database/postgres/which-version-of-postgres)
|
| `deployment/managing-environments` |
[Live](https://supabase.com/docs/guides/deployment/managing-environments)
|
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/deployment/managing-environments)
|
| `getting-started/quickstarts/hono` |
[Live](https://supabase.com/docs/guides/getting-started/quickstarts/hono)
|
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/getting-started/quickstarts/hono)
|
| `getting-started/quickstarts/refine` |
[Live](https://supabase.com/docs/guides/getting-started/quickstarts/refine)
|
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/getting-started/quickstarts/refine)
|
| `getting-started/quickstarts/spring-boot` |
[Live](https://supabase.com/docs/guides/getting-started/quickstarts/spring-boot)
|
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/getting-started/quickstarts/spring-boot)
|
| `platform/database-size` |
[Live](https://supabase.com/docs/guides/platform/database-size) |
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/platform/database-size)
|
| `platform/postgres-connection-logging` |
[Live](https://supabase.com/docs/guides/platform/postgres-connection-logging)
|
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/platform/postgres-connection-logging)
|
| `platform/upgrading` |
[Live](https://supabase.com/docs/guides/platform/upgrading) |
[Preview](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/platform/upgrading)
|

## Manual testing

1. Open [Which version of
Postgres](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/database/postgres/which-version-of-postgres).
The snippet appears before the query.
2. Click **Direct connection** in the snippet. It goes to the **Direct
connection** section of the connection guide.
3. Open [Row Level
Security](https://docs-git-docs-sql-run-sentence-sweep-supabase.vercel.app/docs/guides/database/postgres/row-level-security).
The snippet comes before the SQL, and the migration option follows it.
2026-10-20 16:45:08 +00:00
Danny White 24be387cdb docs: use sign in terminology across guides and style guides (#49877)
## What kind of change does this PR introduce?

Docs update. Aligns documentation and style guides with the **Sign in /
Sign out / Sign up** platform standard.

Closes DOCS-1328. Related to
[#49874](https://github.com/supabase/supabase/pull/49874).

## What is the current behavior?

Docs style guides prefer _login_ / _log in_. Guide prose uses mixed
login and sign in wording.

## What is the new behavior?

- [WORD_LIST.md](apps/docs/WORD_LIST.md) and
[copywriting.mdx](apps/design-system/content/docs/copywriting.mdx)
document the sign in standard
- Design-system auth examples updated
- Guide prose and API reference spec descriptions updated

### Terminology

**Standard:** Use _sign in_, _sign out_, and _sign up_ as verbs. Use
_sign-in_, _sign-out_, and _sign-up_ as nouns and adjectives. Match
Studio UI labels (**Sign in**, **Sign out**, **Sign up**).

**Preserved intentionally:**

| Category | Keep as-is | Example |
| -------- | ---------- | ------- |
| Feature name | social login | `/social-login`, `features.mdx` heading,
OAuth provider section |
| URL slugs | `login` in paths | `/phone-login`, `/login-flows`,
`choosing-login-flow` |
| CLI | `supabase login` / `supabase logout` | Reference ids
`supabase-login` / `supabase-logout`; executable commands unchanged |
| SDK methods | `logout()` | Kotlin/Swift method names in API reference
titles and examples |
| Third-party UI | Provider product labels | Facebook Login, Kakao
Login, portal **Login** buttons |
| Postgres | Database terminology | login privileges, login credentials,
login via role |
| Audit/logging | Log prose | "Generates the following **log** in the
Postgres Logs" |
| Code and routes | Paths and filenames | `app/login/`, `Login.tsx`,
`demos/android-login` |
| External URLs | Third-party login pages | `dash.cloudflare.com/login`,
`console.neon.tech/login`, `vercel.com/login` |
| API identifiers | Event and field names | Audit actions
`login`/`logout`, `should_logout_user` |

## To test

- Run `pnpm lint:mdx` in `apps/docs`
- Spot-check `features.mdx`, `social-login.mdx`, and a provider guide
(e.g. Facebook, Kakao)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Standardized authentication terminology across guides, reference
material, CLI documentation, and copywriting guidance using “sign in,”
“sign out,” and “sign up.”
* Updated authentication instructions, headings, link text, examples,
and SSO guidance for clearer, more consistent wording.
* Corrected related grammar, spelling, hyphenation, and documentation
links while preserving established product names and implementation
commands.
* **Style**
  * Refined code examples with consistent import ordering and spacing.
* **Examples**
* Updated authentication button and menu labels to “Sign in” and “Sign
out.”
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-04 09:10:25 +10:00
Miranda LimonczenkoandClaude Opus 5 21265b2e59 docs(database): make writing and running the tests part of the procedure (#49276)
Ref DOCS-1274

Follow-up to #49017, now merged.

This is the go-to-green piece: everything aimed at the three failing
eval checks, and nothing else. Technical corrections follow in the PR
stacked on this one.

## Problem

`build-docs-002-rls-guide` points an agent at this guide with a
vibe-coder prompt that never says RLS, policy, role, or test. Grants,
policies, access probes, indexes, and security-definer placement all
pass. Three checks fail, and have failed on every recorded run:

| Check | What it measures | Why it failed |
| --- | --- | --- |
| `pgTAP test file(s) written under supabase/tests/` | Any `.sql` file
exists | The agent never wrote one. |
| `supabase test db runs at least 8 assertions and all pass` | Suite
runs, ≥8 assertions, none failing | Nothing to run. The only example was
`plan(4)`, under the floor even if copied perfectly. |
| `tests assert allow and deny per operation … for anon and
authenticated` | LLM judge on coverage | Never reached the judge: "no
test files to review". |

The guide already had a `Test your policies` section, so this isn't a
strength problem. Agents don't read the page. They fetch it through an
LLM extraction guided by their own query, and that query asked for
enabling RLS, policy syntax, `auth.uid()`, indexes, and security definer
functions. It never mentioned tests. A section about testing never
enters the extract, so more testing prose cannot reach the agent.

There was also a plain documentation bug underneath it: `Secure a table
with RLS` said a table isn't secured until the suite passes, but the
procedure beneath it ran 1–3 and ended on `grant`. A reader following
the numbered steps finished without ever being told to write a test.

## Solution

Put the tests where the procedure and the examples already are.

- **`Secure a table with RLS`** opens with the four steps that finish a
table, ending on `supabase test db`. Until the suite passes, you don't
know whether the policies do what you intended.
- **`Enable RLS and set the grants` gains step 4** — `supabase test new
<table>_rls.test`, then `supabase test db`. The procedure ends on a
passing suite instead of a grant.
- **The public-read example** gains its policy and
`announcements_rls.test.sql`, so a test file rides along in the
enable-RLS extract.
- **The four policy examples** are followed immediately by
`profiles_rls.test.sql`, so one rides along in the `create policy`
extract too.
- **`Run the test suite` shrinks** to creating and running the files. It
no longer carries content that has to survive extraction.
- Each file leads with its own path as a comment, so it survives if the
fence metadata is dropped.

### How that maps to the three checks

| Check | Addressed by |
| --- | --- |
| Test files written | A complete test file now sits inside both
extracts an agent's own query pulls, and step 4 of the procedure names
the command that creates one. |
| ≥8 assertions, all passing | `announcements_rls.test.sql` is
`plan(10)`, `profiles_rls.test.sql` is `plan(14)`. Either alone clears
the floor; together, 24. |
| Coverage judge | `profiles` asserts allow **and** deny for all four
operations. Allowed writes use `returning` + `results_eq`, proving state
changed rather than that nothing raised. `using`-filtered denials use
`is_empty`, asserting the row is unchanged rather than that an error was
raised — the case the rubric explicitly fails suites for getting wrong.
Both files switch role with `set local role` and identity with `set
local request.jwt.claim.sub`, and cover `anon` as well as
`authenticated`. |



## Manual testing

1. Open the [Row Level Security
guide](https://docs-git-docs-rls-tests-in-procedure-supabase.vercel.app/docs/guides/database/postgres/row-level-security)
on the preview. `Secure a table with RLS` opens with a four-step
definition of done ending on `supabase test db`.
2. Read `Enable RLS and set the grants`. The procedure runs 1–4 and ends
on writing and running the test, not on the grant.
3. Scroll to `DELETE policies`. The four policies are followed
immediately by `profiles_rls.test.sql`, not a pointer to a later
section.
4. Open the [markdown
version](https://docs-git-docs-rls-tests-in-procedure-supabase.vercel.app/docs/guides/database/postgres/row-level-security.md),
which is what agents fetch. Both test files are present, each leading
with its path.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Documentation

- Updated database security guidance for enabling row-level security and
configuring grants.
- Added per-table pgTAP testing requirements and revised `supabase test
db` examples.
- Expanded examples for permitted and denied access across public and
authenticated roles.
- Added dedicated guidance for profile testing and security-definer
member/non-member cases.
- Documented recursive-policy `42P17` failures and the security-definer
workaround.
- Clarified indexing, denial diagnosis, returned-row verification, and
table-hardening links.
- Streamlined the general policy-testing guidance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-24 09:23:33 -07:00
Miranda LimonczenkoandClaude Opus 5 6368f00ca0 docs(database): restructure the RLS guide by information type (#49017)
## Problem

The guide alternated between context, procedure, and reference on almost
every heading. A reader who wanted to write a policy passed through four
context or reference sections to reach one. A reader who wanted the
model had to skip three procedures.

## Solution

- Group into three sections by information type: `Understand Row Level
Security`, `Secure a table with RLS`, and `RLS reference`, with a
navigation intro.
- Merge the four policy sections. They repeated the same setup block,
burying the clause that differed. One setup block now precedes four
short policy examples.
- Move the auto-enable recipe into `event-triggers.mdx`, whose stub
section's entire body was a link back here.
- Relocate the stranded `auth.uid()` caution into the `auth.uid()`
reference.
- Lift the revoke-and-grant procedure out of the danger admonition and
merge it with the two other places that taught `enable row level
security`.
- Point the Grafana IO chart entry at the performance guide. Its
`#rls-performance-recommendations` anchor went away when tuning split
out in #49016.

765 lines to 582. 30 headings to 25.

Headings are demoted rather than renamed wherever anything links to
them. Every inbound anchor in the repo still resolves; the only one
removed, `#auto-enable-rls-for-new-tables`, was referenced solely by the
`event-triggers.mdx` stub this PR replaces.

## Note on the history

Rebuilt from `master` after #49011, #49015, and #49016 merged. The
branch previously carried those 10 commits plus rebase churn against
them.

Rebasing naively would have reverted review feedback from #49016
(`70fa812`), which removed the benchmarks table and the "This guide"
opener from the performance guide. Those are deliberately not restored
here. The only changes to that file are two missing `await`s and a join
predicate that was a tautology while unqualified.

The three PRs stacked on this one (#49268, #49269, #49270) have been
rebased onto the new base.

## Manual testing

1. Open the [Row Level Security
guide](https://docs-git-docs-rls-restructure-supabase.vercel.app/docs/guides/database/postgres/row-level-security)
on the preview. Three top-level sections appear in the table of
contents.
2. Select each link in the intro. All three jump to their section.
3. Open [Event
triggers](https://docs-git-docs-rls-restructure-supabase.vercel.app/docs/guides/database/postgres/event-triggers).
The auto-enable section holds the full recipe instead of a link.
4. Open the [performance
guide](https://docs-git-docs-rls-restructure-supabase.vercel.app/docs/guides/database/postgres/row-level-security-performance).
No benchmarks table, and the three bullets at the top link into the RLS
guide.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Reworked the Row Level Security guide with clearer guidance on grants,
policies, permissions, performance, testing, views, and secure
functions.
* Added a complete example for automatically enabling RLS on newly
created public tables.
* Improved SQL examples and clarified table references in RLS
performance guidance.
* Corrected grammar in the Grafana chart troubleshooting documentation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 14:51:06 -07:00
Miranda LimonczenkoandClaude Opus 5 edf50668aa docs(database): split RLS tuning into its own guide (#49016)
Stacked on #49015, which is stacked on #49011. Review those first.

## Problem

The Row Level Security guide spent 225 lines and 5 benchmark tables on
performance, 29% of the page. The `RLS Performance and Best Practices`
troubleshooting entry already covers the same six tips with the same
numbers, from the same source. Neither page tells you how to check
whether RLS is your bottleneck in the first place.

Four of the six tips are not tuning advice. Indexes, `select`-wrapping,
role scoping, and `security definer` safety change whether a policy is
correct and safe, not just fast.

## Solution

- Add `guides/database/postgres/row-level-security-performance`. It
carries the client-filter rule, the join-rewrite rule, all 5 benchmark
tables merged into one, and a new `Diagnose whether RLS is the
bottleneck` section: toggle RLS off to confirm it's the cost, then read
the plan under an impersonated role. That diagnostic exists in the
troubleshooting entry and has never been in the guide.
- Keep every rule that affects correctness on the RLS guide, grouped
under `Write policies that scale`. These are also the four the
`build-docs-002-rls-guide` eval grades, and an agent reads the guide
top-down.
- Repoint the Grafana IO troubleshooting entry at the new page.
- Rewrite `More resources` as `Related content`. Every link now says
what it is and when to use it. Adds `Advanced pgTAP testing`, the
deepest RLS testing content in the docs, which nothing here linked.
Drops discussion 14576: locked, mislabeled here as "RLS Guide and Best
Practices" when it is "RLS **Performance** and Best Practices", and
superseded by the troubleshooting entry and this new page.

**Ownership rule** so the two pages don't drift: the RLS guide owns the
rule and the correct form. The performance page owns the measurement and
the optimizer explanation. If a sentence on the performance page tells
you what to write, it belongs on the guide.

Scoped out of this PR: `More resources` was assigned to the restructure
PR in the plan, but the 14576 link is what this PR supersedes, so
leaving it would ship a stale pointer.

## Manual testing

1. Open the [RLS performance
guide](https://docs-git-docs-rls-performance-split-supabase.vercel.app/docs/guides/database/postgres/row-level-security-performance)
on the preview. It appears in the left nav under Database, Access and
security, directly below Row Level Security.
2. Select the three rule links in its intro. Each lands on the matching
section of the RLS guide.
3. Open the [Row Level Security
guide](https://docs-git-docs-rls-performance-split-supabase.vercel.app/docs/guides/database/postgres/row-level-security)
and go to `Write policies that scale`. It holds indexes,
`select`-wrapping, and role scoping, with one link out to the
performance page.
4. Open the [Grafana IO troubleshooting
entry](https://docs-git-docs-rls-performance-split-supabase.vercel.app/docs/guides/troubleshooting/interpreting-supabase-grafana-io-charts-MUynDR)
and select the RLS performance guide link. It lands on the new page.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Added a dedicated guide for diagnosing and improving PostgreSQL Row
Level Security performance.
* Expanded guidance on indexing, query filters, role targeting, function
usage, and avoiding costly policy joins.
* Updated the Row Level Security guide with streamlined, scalable policy
recommendations and links to related resources.
* Added the new performance guide to the Database documentation
navigation.
* Updated troubleshooting guidance to reference the dedicated
performance guide.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 10:41:08 -07:00
45bb7c30ce docs(database): fix RLS guide copy and two SQL examples (#49015)
Stacked on #49011. Base is `docs/rls-revision`, so review that one
first.

## Problem

An audit of the Row Level Security guide against
`apps/docs/CONTRIBUTING.md` and `WORD_LIST.md` turned up 4 lint warnings
and 3 things that are wrong rather than just untidy.

- Two SQL examples contradict the guide's own advice. The own-profile
`SELECT` policy has no `TO` clause. The `security definer` example has
no `set search_path`.
- `## Bypassing Row Level Security` says Service Keys bypass RLS, then a
note says Supabase adheres to the signed-in user's policy anyway. The
condition that separates the two is never stated.
- `#using-functions` is linked twice from the RBAC guide and has never
existed on the RLS page.

## Solution

Copy and correctness only. No section moves, no heading renames.

- Replace the italic emphasis on `never` with bold. CONTRIBUTING permits
**bold** for a term the reader must not miss, not italics for general
emphasis. The matching fix for `must` lives in #49011, which rewrites
that line anyway.
- Drop marketing language from the opener, the Supabase intro, and the
policies and performance leads. Removes the idiom "get the hang of them"
and the filler `just`.
- Replace `we` with second person in two places.
- Scope the own-profile `SELECT` example with `to authenticated`.
- Pin `search_path = ''` on the `security definer` example,
schema-qualify its body to match, and state the requirement in prose.
- State when a Service Key actually bypasses RLS.
- Repoint the two RBAC links to `#use-security-definer-functions` and
`#helper-functions`.

`supa-mdx-lint` on the RLS guide goes from 4 warnings to 0.

## Manual testing

1. Open the [Row Level Security
guide](https://docs-git-docs-rls-copy-fixes-supabase.vercel.app/docs/guides/database/postgres/row-level-security)
on the preview. The own-profile SELECT example shows `to authenticated`,
and the security definer example shows `set search_path = ''`.
2. Open the [RBAC
guide](https://docs-git-docs-rls-copy-fixes-supabase.vercel.app/docs/guides/api/custom-claims-and-role-based-access-control-rbac)
and select the "RLS helper functions" link near the end. It lands on the
Helper functions section instead of the top of the page.
3. From `apps/docs`, run `pnpm lint:mdx`. The RLS guide reports no
warnings.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Documentation**
- Updated access-control guidance with clearer links for
security-definer functions and RLS helper functions.
- Clarified that exposed tables require Row Level Security (RLS), while
table grants and row policies provide separate controls.
- Added least-privilege and grant-revocation examples, plus explanations
for authorization errors.
- Expanded testing guidance for CRUD policies, identity switching, and
denied operations.
- Improved recommendations for service keys, policy performance,
indexing, and secure function configuration.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-17 23:40:09 +00:00
Miranda LimonczenkoandClaude Opus 5 d2ccbe5d46 docs(database): close the RLS guide gaps the eval flagged (#49011)
Closes DOCS-1274

## Problem

The `build-docs-002-rls-guide` eval points an agent at the Row Level
Security guide with a vibe-coder prompt that never says RLS, policy,
role, or test. It failed 6 of 35 checks. Each failure traces to
something the guide doesn't say.

- **Grants.** `anon` kept insert, update, and delete on all four to-do
tables. Both client roles kept writes on the weather feed. 24 privileges
untouched.
- **Indexes.** Missing on `list_members.user_id`. The agent indexed the
other three, so it missed the composite-primary-key case specifically.
- **Tests.** No pgTAP files. `Result: NOTESTS`, so the coverage judge
never ran.

## Solution

- **Add a `Grants and policies` section.**
- **Rewrite the opening danger admonition around revoke-then-grant.** It
previously showed `grant` only, which reads as though privileges start
from nothing.
- **Drop the `(or primary keys)` carve-out from `Add indexes`.** A
column counts as indexed only when it leads a `btree` index, shown with
a composite-primary-key example.
- **Add a `Test your policies` section.** Covers file location under
`supabase/tests/`, `supabase test db`, role and identity switching,
which assertion matches which denial, and an 11-assertion example
spanning allow and deny for all four operations across `anon` and
`authenticated`.

Used the supacademy RLS course as a second reference. Its framing of
grants running before RLS shaped the new section.

## Manual testing

1. Open the [Row Level Security
guide](https://docs-git-docs-rls-revision-supabase.vercel.app/docs/guides/database/postgres/row-level-security)
on the preview. `Grants and policies` and `Test your policies` appear in
the table of contents.
2. Select the `Grants and policies` link at the end of the first
admonition. It jumps to the new section.
3. Open the [markdown
version](https://docs-git-docs-rls-revision-supabase.vercel.app/docs/guides/database/postgres/row-level-security.md),
which is what agents fetch. Both new sections and the revised `Add
indexes` text are present.
4. From `apps/docs`, run `pnpm lint:mdx`. The 4 warnings on this file
match `master`, with no new ones.



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Documentation

* Clarified that exposed tables must enable row-level security.
* Explained the distinction between database grants and row-level
security policies.
* Added least-privilege examples for client roles, including read-only
access.
* Added pgTAP testing guidance with a complete `profiles` example.
* Clarified that composite indexes support policy filters only on their
leading columns.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 15:05:39 -07:00
3dffdefd6e fix(docs) Resolve 196 mdx lint warnings for just, quickly, actually, PostgreSQL (#47358)
Closes DOCS-1057
Contributes to DOCS-1052

## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## Problem

We have hundreds of MDX lint warnings in our docs going against style
best practices.

## Solution

Remove and replace in context the following:

- PostgreSQL. There was only one. There was concern about exceptions,
but I found none.
- Just
- Quickly
- Actually

### What changed

Edits follow the [Google developer documentation style
guide](https://developers.google.com/style): concise, direct, active
voice. The flagged words were removed when the sentence still read well,
or replaced when meaning needed to be preserved.

### Common patterns

| Flagged word | Approach | Example |
|---|---|---|
| **just** (filler) | Removed | "you just installed" → "you installed" |
| **just** (limiting) | **only** | "just one row" → "only one row" |
| **just like** | **like** / **the same as** | "function just like
regular users" → "function like regular users" |
| **not just** | **not only** | "not just errors" → "not only errors" |
| **quickly** (performance) | **efficiently** or removed | "find rows
quickly" → "find rows efficiently" |
| **quickly** (time) | **soon** / **rapidly** / removed | "expires too
quickly" → "expires too soon" |
| **actually** (filler) | Removed | "actually execute" → "execute"; "is
actually the most common" → "is the most common" |

## Tophatting

1. See the diff.
2. See that content continues to make sense in context.
3. Locally, `cd apps/docs` and run `pnpm run lint:mdx`.
4. Search for "just," "actually," "quickly", and "PostgreSQL" and see
there are 0 warnings.




<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Updated wording across quickstarts, guides, and troubleshooting
articles for grammar, clarity, and consistent step-by-step phrasing.
* Clarified key concepts including Row Level Security policy evaluation
across Supabase products, deferred foreign key constraint behavior, and
when `EXPLAIN ANALYZE` executes queries (and related side effects).
* Refined several troubleshooting instructions and added guidance to cap
log payload size to reduce billed Logs Ingest volume.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nik Richers <nrichers@gmail.com>
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
2026-06-29 09:40:25 -07:00
0aa7b4965f chore(docs) Remove instances of let's to resolve mdx lint warnings (#47013)
Contributes to DOCS-1052

Contributes to DOCS-1057

## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Resolves linting warning for "let's" and adds an exception for product
name.

## Tophatting

1. Read the diff and see if changes make sense in context.
2. Run `pnpm lint:mdx`, search for "let's" and see no instances. 


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Updated instructional copy across multiple AI, authentication,
database, functions, realtime, storage, and troubleshooting guides to
improve clarity and consistency.
* Replaced conversational phrasing (for example, “Let’s…/Let’s see…”)
with direct imperatives, tightened example lead-ins, and adjusted a few
step explanations for readability.
* Refreshed some tutorial text and code-sample presentation in guides
(no behavioral changes).
  * Added/adjusted minor MDX lint guidance in a couple of documents.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nik Richers <nrichers@gmail.com>
2026-06-17 11:24:59 -07:00
Danny WhiteandChris Chinchilla 9c03ad6b02 chore(docs): migrate Admonition labels to titles (#46053)
## What kind of change does this PR introduce?

Docs update. Related to DEPR-551.

## What is the current behavior?

Docs MDX still uses the legacy `label` prop for Admonitions, even though
#45618 added `title` and kept `label` only as a backwards-compatible
alias after #45302 was reverted in #45535.

## What is the new behavior?

Migrates Docs-owned Admonitions from `label=` to `title=` without
changing rendered copy, component APIs, Studio callsites, design-system
examples, or the legacy `label` alias.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Standardized admonition headings across the docs by switching how
admonition headings are provided (preserving all visible guidance and
examples). Content and instructions remain unchanged; this ensures
consistent rendering of callouts and improves uniformity across guides
and reference pages.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46053?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
2026-05-18 19:00:09 +10:00
Chris ChinchillaandCopilot 0e736457c8 docs: update docs to reflect new permission models for data api (#45288)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Instructed granting least-privilege table permissions for anon,
authenticated, and service roles prior to enabling Row Level Security
across multiple guides and quickstarts.
* Clarified SQL examples and inline comments, added explicit GRANT steps
and RLS SELECT policies, rephrased policy guidance, and adjusted example
ordering and section numbering for clearer setup and testing.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-29 06:54:49 +00:00
Chris Chinchillaandfadymak 1644030dcd docs: RLS and wrapper Key changes (#45166)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Updated SDK initialization examples to reflect current authentication
patterns across multiple Supabase integration guides
* Enhanced security documentation with expanded guidance on protecting
sensitive credentials like secrets and service role keys in frontend and
Edge Function environments
* Clarified Row-Level Security access patterns and data availability
considerations when using publishable keys

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: fadymak <dev@fadymak.com>
2026-04-24 14:01:44 +00:00
Inian 84ccde68c2 Add auto-enable RLS example to rls docs instead (#42493)
Summary
- move the auto-enable RLS trigger SQL example from the event trigger
guide into the row-level-security guide with a full example
- keep a reference in the event trigger guide that points to the
row-level-security section instead of duplicating the SQL snippet

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Reorganized PostgreSQL Row Level Security documentation with a new
dedicated guide section on automatically enabling RLS for newly created
tables
* Note: Auto-enable RLS applies only to tables created after
installation; existing tables require manual enabling

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-06 10:25:03 +07:00
neinja.dev 1f9b9504a7 docs: Remove the resource that links to the page the user is already on. (#41697)
Removed duplicate link to Row Level Security and Supabase Auth.
2026-01-12 16:03:44 +07:00
e6548079ed 📚 Docs: Clarify that auth.uid() returns null when unauthenticated in RLS policies (#37336)
* 📚 Fix: Clarify behavior of auth.uid() when unauthenticated in RLS

* Update row-level-security.mdx

* Update row-level-security.mdx

* Update row-level-security.mdx

* Update apps/docs/content/guides/database/postgres/row-level-security.mdx

* Update apps/docs/content/guides/database/postgres/row-level-security.mdx

* Update apps/docs/content/guides/database/postgres/row-level-security.mdx

* Update apps/docs/content/guides/database/postgres/row-level-security.mdx

* Update warning about `auth.uid()` behavior

Clarified behavior of `auth.uid()` when unauthenticated and recommended explicit authentication checks.

* Change admonition type from warning to caution

* Update SQL condition for row-level security

Clarify row-level security SQL condition for unauthenticated users.

---------

Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
2025-10-09 08:32:14 +02:00
CharisandChris Chinchilla 47705a8968 chore: replace all supabase urls with relative urls (#38537)
* fix: rewrite relative URLs when syncing to GitHub discussion

Relative URLs back to supabse.com won't work in GitHub discussions, so
rewrite them back to absolute URLs starting with https://supabase.com

* fix: replace all supabase urls with relative urls

* chore: add linting for relative urls

* chore: bump linter version

* Prettier

---------

Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
2025-09-09 12:54:33 +00:00
GaryAustin1 f9e5e25a64 Fix security definer RLS example (#37800)
Seems like at some point surrounding the security definer function private.has_good_role() with a select (like all functions should have for RLS) was changed.   I can't find the PR doing it though.
2025-08-12 14:29:39 -04:00
TheOtherBrian1 a38da5620f Update row-level-security.mdx | correct example (#37361) 2025-07-31 23:19:00 -04:00
Sabu Siyad d30478cc22 doc: postgres/row-level-security: wrong link to auth (#33900) 2025-02-27 22:00:58 +00:00
Charis a820c56ed0 chore: docs linting (#33574) 2025-02-21 14:13:00 -05:00
Charis 16eddf08d6 make rls admonition more prominent with stronger language (#33620) 2025-02-14 10:54:39 -05:00
Charis 2d55512553 chore: activate spelling and admonitions lints for docs (#33292) 2025-02-04 13:18:31 -05:00
1c1b4c815d Add caution on Update Policy section for need to create Select Policy (#28678)
* Add caution on Update Policy section for need to create Select Policy

* Update apps/docs/content/guides/database/postgres/row-level-security.mdx

---------

Co-authored-by: bulut yerli <bulut@buluts-Mac-mini.local>
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2024-09-18 13:49:08 +00:00
0ac056dd5d Add resource links to RLS docs pages (#22465)
* add resource links to both RLS pages

* Merge master resolve conflicts

* Update apps/docs/content/guides/database/postgres/row-level-security.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2024-08-16 10:25:17 +07:00
4574951962 docs: warn about user_metadata used in RLS (#21561)
* docs: warn about `user_metadata` used in RLS

Adds a warning to the Row Level Security page that using `user_metadata` can be insecure.

* Update apps/docs/content/guides/auth/row-level-security.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2024-08-15 16:53:13 +08:00
mio256 8f616dfee3 docs: row-level-security.mdx, syntax error in create table user_id field (#28055)
Update row-level-security.mdx

syntax in create table user_id field
2024-07-19 20:12:27 +00:00
GaryAustin1 85de650034 Invalid SQL syntax in rls bypass section (#27738)
Unless there is some new SQL I'm not familiar the code shown:
`grant bypassrls on "table_name" to "role_name";`
Will not work and instead should be:
`alter role "role_name" with bypassrls;`
2024-07-01 17:54:54 -04:00
hallidayoandCharis e606e1e5ca docs: metadata changes (#26626)
metadata changes

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2024-05-21 23:29:06 +00:00
raaedandCharis 29d96774fd Update row-level-security.mdx (#26155)
Fix typo: add missing "to"

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2024-05-13 18:58:30 +00:00
ec86bbc4fe feat: new auth ia (#22812)
Co-authored-by: Kang Ming <kang.ming1996@gmail.com>
Co-authored-by: Joel Lee <lee.yi.jie.joel@gmail.com>
2024-05-07 20:15:06 +00:00
Kevin Grüneberg e6bbe8e4d5 fix: rls example (#22853) 2024-04-18 09:35:25 +02:00
GaryAustin1 ed6205ea2a Update row-level-security.mdx to fix aggressive bad SQL cleanup (#22746)
The cleanup last done to show better RLS SQL changed the bad example and is causing user confusion now that it is highlighted by the linter.
2024-04-15 12:23:43 -04:00
Charis 5d8cef6040 fix: update all examples and snippets to use select for auth rls func… (#22632)
fix: update all examples and snippets to use select for auth rls functions
2024-04-11 12:56:11 -04:00
Charis cb7c67864b chore: linting rule tweaks and error fixes (#21678) 2024-03-04 23:32:46 -05:00
Charis b0b8b6b6e3 refactor: finish moving mdx to content directory (#21321) 2024-02-16 13:43:02 -05:00