mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
create-pull-request/patch
436
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
59cddd41a9 |
feat(studio): group database access settings (#54350)
> [!WARNING] > This PR relies on #54282 being merged first. ## Problem Database password and token access appear as separate sections in Database Settings, although both control connections to Postgres. ## Solution Group the existing controls under **Database access**, with **Password access** first and the switch beside **Token access**. Nest **Members** inside the Token access card and label its action **Add member**. Preserve the existing feature gates, permissions, toggle behaviour, dialogs and section anchors. Use shared card headings for Members, centre the token switch beside its description, and darken the Members table header. Update the matching token-access and password-reset docs instructions. ```text Database access ├── Password access └── Token access [switch] └── Members [Add member] ``` | After | | --- | | <img width="735" height="818" alt="CleanShot 2026-12-01 at 15 56 50" src="https://github.com/user-attachments/assets/f1207a2f-80d5-480a-9529-e110b960f427" /> | | _App [token] access coming separately in https://github.com/supabase/supabase/pull/53917._ | ## Review instructions 1. Open a project's **Database → Settings** page. Check that **Database access** contains **Password access** first, with the existing **Reset database password** button. 2. With the database token access preview enabled, check that **Token access** has its switch on the same row and **Members** appears inside the same card when enabled. Check that **Add member** opens the existing access rule sheet. 3. Check the existing enable confirmation and password reset dialog. Projects requiring SSL enforcement or a Postgres upgrade should keep their existing notices and actions. |
||
|
|
450939ce86 |
docs: fix the pages the Option 1 nav friction logs got stuck on (#53881)
Part of DOCS-1739 ## Problem People who tried the Option 1 navigation got stuck on these pages: - **Slow queries:** readers looked for a way to debug a slow query and didn't find the guide in the nav. Its title, "Log slow and failing queries", names the mechanism, not the task. - **JWT:** The Supabase way to build says Auth "issues a signed JWT" without saying what a JWT is. - **Docker self-hosting:** the guide opens with its own contents list, which repeats the table of contents beside it. - **Launch readiness:** readers who opened Deploy to production to ask "am I ready to launch?" found a page about branching and environments. Neither checklist is linked from it. ## Solution - **Slow-query title.** The title becomes "Find slow and failing queries", and the nav label in both navigations becomes "Find slow queries". The description still says "log slow queries", so search keeps matching. Five inbound links now use the new title. - **JWT link.** The first mention reads "JSON Web Token (JWT)" and links to the JWT guide. - **Launch intro.** Two sentences near the top of Deploy to production link the production checklist and the production security checklist. - **Docker contents list.** The in-page list is gone. Nothing linked to its anchor. ## Manual testing 1. Open [the slow-query guide on the preview](https://docs-git-docs-nav-friction-content-supabase.vercel.app/docs/guides/observability/log-slow-queries). The title reads "Find slow and failing queries", and the sidebar entry reads "Find slow queries". 2. Open [The Supabase way to build](https://docs-git-docs-nav-friction-content-supabase.vercel.app/docs/guides/getting-started/the-supabase-way-to-build). Under Auth, "JSON Web Token (JWT)" links to the JWT guide. 3. Open [Deployment and branching](https://docs-git-docs-nav-friction-content-supabase.vercel.app/docs/guides/deployment). The third paragraph links both production checklists. 4. Open [Self-hosting with Docker](https://docs-git-docs-nav-friction-content-supabase.vercel.app/docs/guides/self-hosting/docker). The page goes from the intro straight to Before you begin, with no Contents list. |
||
|
|
ce80792683 | feat(docs): Improve Pipelines docs (#54045) | ||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
4e15414929 |
docs(guides): rework five more explainer pages to the explainer template (#53757)
## Problem Five more concept pages are close to the explainer template from #53751. They have short or missing descriptions, generic or question headings, a pointer-only heading, and no Related resources. Several also have filler, marketing language, or time phrases. Closes DOCS-1617. This is a second batch on top of #53755. ## Solution The PR is one squashed commit. It covers a style pass, the restructure to the template, critic-pass fixes, tables and lists, the opener change, content moved in from other pages, and two headings renamed to `X vs Y`. ### Structure | Page | Change | | --- | --- | | `ai/keyword-search` | Value statement, `Using full-text search` (a pointer-only heading) and `See also` folded into Related resources | | `ai/vector-indexes` | Value statement, a `## Limits` section for the dimension limits and version check, `Resources` to Related resources | | `storage/buckets/fundamentals` | Retitled `Storage buckets`, value statement, an access model table, the bucket types promoted to H2, `Example use cases` headings to lead-in sentences, Related resources | | `storage/analytics/introduction` | Retitled `Analytics buckets`, value statement, question and generic headings made descriptive, Related resources | | `realtime/architecture` | Retitled `Realtime architecture`, value statement, `Elixir & Phoenix` to `Elixir and Phoenix`, Related resources | - **Linked headings**: headings that other pages link to keep their text: `#distance-operators`, `#public-buckets`, `#private-buckets`, and `#access-model`. Moving a bucket type from H3 to H2 keeps its slug. - **Openers and tables**: only the value statement and a cross-reference come before the first heading, and each concept opener moves into the first H2, per the template change in #53751. Prose comparisons and parallel facts become tables and lists. On Realtime architecture, the WAL streaming steps are a numbered list. - **Moved content**: each explainer now owns its concept, and the page that held it links back. Nothing is newly written; every added fact comes from an existing page: - Keyword search: `## How keyword search works`, summarized from the Usage section of [Full text search](/docs/guides/database/full-text-search#usage), which links back. - Vector indexes: `## Trade-offs` and `## When to use each index type`, from [HNSW indexes](/docs/guides/ai/vector-indexes/hnsw-indexes) and [IVFFlat indexes](/docs/guides/ai/vector-indexes/ivf-indexes). Both now link back, and their copies of the index list and dimension limits are replaced with links. - Analytics buckets: `## Services`, moved from the Architecture overview in [Iceberg Catalog](/docs/guides/storage/analytics/connecting-to-analytics-bucket), and `## Limits`, from [Create an analytics bucket](/docs/guides/storage/analytics/creating-analytics-buckets) and [Analytics buckets limits](/docs/guides/storage/analytics/limits). - **Facts**: unchanged. The value statements, the access model table, and Related resources are the only new text, and the table summarizes facts already on the page. ### Style - **Descriptions**: add or rewrite one per page, 150 to 160 characters. - **Alt text**: rewrite the Realtime diagram's alt text against the image. It was `Architecture`. - **Terms**: `WORD_LIST.md` passes for numbers, _will_, _since_, _allows you to_, _performant_, _here_ as link text, filler, and marketing language such as "perfect for" and "an amazing Supabase user". - **Critic pass**: shorter sentences, repeated points and idioms cut, fewer repeated links, lowercase SQL, code-formatted type names, and external links that name their destination. ### Structure numbers These numbers are from before the opener and table changes. | Page | Chars before → after | Headings | Generic headings | Description chars | | --- | --- | --- | --- | --- | | `ai/keyword-search` | 2,611 → 2,544 | 3 → 2 | 1 → 0 | 40 → 156 | | `ai/vector-indexes` | 2,557 → 2,890 | 3 → 4 | 1 → 0 | 28 → 153 | | `storage/buckets/fundamentals` | 2,128 → 3,189 | 5 → 4 | 2 → 0 | 41 → 156 | | `storage/analytics/introduction` | 1,698 → 2,332 | 2 → 3 | 0 → 0 | 0 → 158 | | `realtime/architecture` | 4,474 → 5,185 | 6 → 7 | 0 → 0 | 45 → 153 | ### How the template did - **New learnings, added to #53751**: an optional `## When to use <concept>` section, because the template's own reader question asks "when do I use it?". One H2 per Process stage, for `realtime/architecture`. More than one Parts section, because `ai/vector-indexes` has index types and distance operators. - **Fit well**: `storage/buckets/fundamentals` is a parts table followed by one H2 per part, which is the rule from the first batch. - **Still loose**: `realtime/architecture` maps to the template only as a run of Process stages. A future rework could group them, or split `Broadcast from Postgres` into its own page. `storage/analytics/introduction` keeps a descriptive comparison heading instead of `## Trade-offs`. Skipped on purpose: the Realtime PNG diagram isn't converted to Mermaid, because that's new content. ### Preview | Page | Live | Preview | | --- | --- | --- | | Keyword search | [Live](https://supabase.com/docs/guides/ai/keyword-search) | [Preview](https://docs-git-docs-explainer-rework-batch-2-supabase.vercel.app/docs/guides/ai/keyword-search) | | Vector indexes | [Live](https://supabase.com/docs/guides/ai/vector-indexes) | [Preview](https://docs-git-docs-explainer-rework-batch-2-supabase.vercel.app/docs/guides/ai/vector-indexes) | | Storage buckets | [Live](https://supabase.com/docs/guides/storage/buckets/fundamentals) | [Preview](https://docs-git-docs-explainer-rework-batch-2-supabase.vercel.app/docs/guides/storage/buckets/fundamentals) | | Analytics buckets | [Live](https://supabase.com/docs/guides/storage/analytics/introduction) | [Preview](https://docs-git-docs-explainer-rework-batch-2-supabase.vercel.app/docs/guides/storage/analytics/introduction) | | Realtime architecture | [Live](https://supabase.com/docs/guides/realtime/architecture) | [Preview](https://docs-git-docs-explainer-rework-batch-2-supabase.vercel.app/docs/guides/realtime/architecture) | ## Review instructions 1. Open each page's live and preview links from the Preview table side by side. 2. Check that each page opens with a value statement and ends with Related resources. 3. Open `/docs/guides/ai/vector-indexes#distance-operators` and `/docs/guides/storage/buckets/fundamentals#public-buckets` on the preview, and check that each jumps to its heading. 4. On Storage buckets, check that the access model table matches the Private buckets and Public buckets sections. ## Checklist Check all before review: - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] 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) |
||
|
|
8e50db7952 |
docs: link the SQL to REST API Translator from the joins guide (#53771)
## Problem Readers who know the SQL join they want have to work out the matching embedding syntax by hand. The joins and nesting guide never mentions the SQL to REST API Translator, which does that conversion, so readers don't find it. Related to [FDBKIN-7994](https://linear.app/supabase/issue/FDBKIN-7994/improve-documentation-and-tooling-for-postgrest-join-syntax) Closes [DOCS-1729](https://linear.app/supabase/issue/DOCS-1729) ## Solution In the "Join types and join modifiers" section of `/guides/database/joins-and-nesting`, a new paragraph in the section's intro points readers who think in SQL to the translator. The paragraph says that the translator turns a SQL `select` query into a Data API request and Supabase JavaScript client code, with SQL joins as embedded relations. It also says that not every query translates, and names the translator's join limits: it handles only left and inner joins that compare columns with `=`, and the request it returns works only when a foreign key links the two tables. The paragraph follows the intro's explanation of left joins and `!inner`, so the translator's left-and-inner limit builds on it, and readers see the shortcut before the syntax table and the example tabs. Existing text is unchanged. ## How to verify 1. On the docs preview, open `/docs/guides/database/joins-and-nesting` and go to "Join types and join modifiers". 2. After the paragraph that ends "use `!inner` on the embedded relation", a paragraph names the SQL to REST API Translator and says that it converts SQL joins into embedded relations and client code. 3. The link opens `/docs/guides/api/sql-to-rest`. 4. The paragraph says that some queries won't translate. ## Checks Ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and Prettier on the changed file. All pass. Skipped the docs tests, because they need Docker. Checked the facts against `apps/docs/content/guides/api/sql-to-rest.mdx` (the subset note), the translator component in `packages/ui-patterns/src/SqlToRest/` (cURL, HTTP, and JavaScript outputs), and the join handling in `@supabase/sql-to-rest` 0.1.6: it throws on join types other than inner and left and on join conditions other than `=`, and it does not check for a foreign key. ## Second reader First read: ready, no blockers, three nits. All three applied: the paragraph moved after the syntax table, two sentences merged, and the join limits named. Second read: one blocker. The join-limit sentence had the Data API as its subject, but the foreign key limit belongs to the translator, and the Data API also supports computed relationships. Fixed by making the translator the subject. Third read, after the first sentence was split in two: one blocker. The translator doesn't check foreign keys, so a join without one still translates, and the request then fails. Fixed: the sentence now says the translator handles only left and inner joins that compare columns with `=`, and that the request works only when a foreign key links the two tables. Nits left as they are: the translator outputs joins as flattened spread embeddings (`...relation(...)`), which this page doesn't explain; "client code" could read "supabase-js code". Fourth read, after the join-limits sentence was split in two: ready, no blockers. Nit left as it is: "For example" introduces translator limits after a sentence about Data API limits. Fifth read, after the paragraph moved into the section intro: ready, no blockers, and the placement matches the section's topic. Nits left as they are: when two foreign keys link the same tables, the translator's request is ambiguous and fails, because it never adds a foreign key hint (ambiguous foreign keys are out of scope here); and the last two sentences could form their own paragraph. Left as follow-ups outside the scope: the page intro says "data APIs" in lowercase, `guides/api/sql-to-api.mdx` doesn't link to the translator, and "We can get…" on the page uses _we_ for the reader. ## 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> Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> |
||
|
|
a74afc61cd |
docs(hypopg): fix function names in the functions list (#53514)
## Problem Three entries in the [HypoPG functions list](https://supabase.com/docs/guides/database/extensions/hypopg#functions) name functions that don't exist, so copying them fails with `function ... does not exist`: - `hypo_create_index(text)` is `hypopg_create_index(text)` (the example on the same page already uses it) - `hypopg_get_index_def(oid)` is `hypopg_get_indexdef(oid)` - `hypopg_get_relation_size(oid)` is `hypopg_relation_size(oid)` Source: [`hypopg--1.4.5.sql`](https://github.com/HypoPG/hypopg/blob/REL1_STABLE/hypopg--1.4.5.sql) and the upstream [usage docs](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes). ## Solution Use the real function names. ## Review instructions 1. Compare the list with the `CREATE FUNCTION` statements in the linked `hypopg--1.4.5.sql`. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] 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: Nik Richers <nrichers@gmail.com> |
||
|
|
5fb0be08b1 |
docs: say where to reset the database password in the connection guide (#53697)
## Problem Step 4 of "Get your connection string" in the Postgres connection guide tells readers to put their database password in the connection string. It doesn't say that the dashboard stops showing the password after the project is created, or how to get a new one. Related to [FDBKIN-4770](https://linear.app/supabase/issue/FDBKIN-4770/improve-documentation-and-navigation-for-finding-the-database-password) Closes [DOCS-1717](https://linear.app/supabase/issue/DOCS-1717/say-where-to-reset-the-database-password-in-the-connection-guide) ## Solution A new paragraph, indented under step 4 of `/guides/database/connecting-to-postgres`, says that the dashboard doesn't show the database password after you create the project. It points readers to the **Reset database password** option in the Connect dialog and to the Database Settings section (`#database-password`), and warns that a reset breaks existing connections that use the old password. The wording matches the quickstart connection-string partial and the dashboard's own copy. Step 4's own text, including the percent-encoding guidance, is unchanged, and no other section changes. ## Checks I ran `pnpm turbo run typecheck --filter='...[origin/master]'`, `pnpm turbo run lint --filter='[origin/master]'`, and Prettier on the changed file. All of them pass. I checked the facts against the Studio code: the `database-password` section and its copy in `ResetDbPassword.tsx`, and the **Reset database password** button in the Connect sheet's connection step. The `docs` tests were skipped because they need Docker. On the preview, step 4 of "Get your connection string" should: - keep its original text, with a second paragraph that stays inside step 4 - say in that paragraph that the Supabase Dashboard doesn't show the database password after you create the project - name **Reset database password** and say that a reset breaks existing connections - link Database Settings to the dashboard's database settings page, at `#database-password` ## 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> |
||
|
|
6bdb443398 |
docs(guides): fix code fence languages in three guides (#53722)
## Problem
Three code blocks in the docs guides use the wrong language tag, so they
are highlighted and type-checked as JavaScript or TypeScript instead of
what they are:
- `guides/database/arrays.mdx`: a SQL query is tagged `js`
- `guides/database/import-data.mdx`: the `pgloader config.load` command
is tagged `jsx`
- `guides/ai/hybrid-search.mdx`: a cURL command is tagged `tsx`
The docs style guide says JavaScript and TypeScript blocks get type
hints and are formatted by Prettier, which does not apply to these
blocks.
## Solution
Retag the blocks: `sql` for the query and `bash` for the two shell
commands (`bash` is the most common shell tag in the guides).
For the SQL block I also lowercased the keywords, per the style guide's
"Prefer lowercase for SQL". Prettier's SQL plugin rewrites
`textarray[1]` to `textarray as [1]`, which is not valid Postgres, so
the block is preceded by `{/* prettier-ignore */}`, the same convention
already used in `guides/ai/engineering-for-scale.mdx` and
`guides/api/query-plans.mdx`.
Earlier PRs fixed the same kind of problem: #11870, #19033, #14856,
#11235.
## Review instructions
1. Open the diff: only the language tags change, plus the lowercase SQL
and the `prettier-ignore` comment in `arrays.mdx`.
2. Check the three pages in the preview: the SQL block in the SQL tab of
"Working with arrays", the `pgloader` step in "Import data into
Supabase", and the cURL block in "Hybrid search".
3. Run `pnpm test:prettier`. It passes for these files with the repo's
`prettier.config.mjs`.
## Checklist
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] 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).
(Not run: this edit only changes code fence languages, and I applied the
style guide's code block rules by hand.)
Co-authored-by: Santhosh-x23 <185920429+Santhosh-x23@users.noreply.github.com>
|
||
|
|
c18904c171 |
kb: add how to use Drizzle with Supabase as just Postgres article (#53295)
## Problem There aren't much guides on how to use Supabase as just Postgres and use it with Drizzle. ## Solution Adds a simple tutorial article in the KB for how to create an app with Drizzle & TanStack, and use Supabase as just Postgres. ## Preview links https://kb-git-tylershukert-devrel-615-drizzle-supabase-1159ba-supabase.vercel.app/kb/guides/setup-drizzle-with-postgres-and-tanstack-start <!-- ## Additional context Optionally add any other context or screenshots. --> ## Review instructions Provide a clear numbered procedure that the PR reviewer can walk through. Make sure the tone and the content in general follow what we would want within KB. ## Checklist Check all before review: - [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: kodster28 <kody.jackson@supabase.io> |
||
|
|
1479013fd8 |
docs(guides): rework five how-to pages to the how-to template (#53650)
Closes DOCS-1614 ## Problem This PR is to apply the template to top-five low-hanging fruit pages -- ones that nearly match the template already and do not need to break out new topics. This PR also tests the template to see that it is working as expected. ## Solution Apply the How-to Template to 5 how-to pages. ## Preview links | Site | Live | Preview | Search for | | --- | --- | --- | --- | | Docs | [/docs/guides/storage/analytics/creating-analytics-buckets](https://supabase.com/docs/guides/storage/analytics/creating-analytics-buckets) | [/docs/guides/storage/analytics/creating-analytics-buckets](https://docs-git-docs-howto-rework-easy-pages-supabase.vercel.app/docs/guides/storage/analytics/creating-analytics-buckets) | Create an analytics bucket | | Docs | [/docs/guides/functions/debugging-tools](https://supabase.com/docs/guides/functions/debugging-tools) | [/docs/guides/functions/debugging-tools](https://docs-git-docs-howto-rework-easy-pages-supabase.vercel.app/docs/guides/functions/debugging-tools) | Debug Edge Functions locally | | Docs | [/docs/guides/queues/consuming-messages-with-edge-functions](https://supabase.com/docs/guides/queues/consuming-messages-with-edge-functions) | [/docs/guides/queues/consuming-messages-with-edge-functions](https://docs-git-docs-howto-rework-easy-pages-supabase.vercel.app/docs/guides/queues/consuming-messages-with-edge-functions) | Consume queue messages | | Docs | [/docs/guides/database/postgres/setup-replication-external](https://supabase.com/docs/guides/database/postgres/setup-replication-external) | [/docs/guides/database/postgres/setup-replication-external](https://docs-git-docs-howto-rework-easy-pages-supabase.vercel.app/docs/guides/database/postgres/setup-replication-external) | Replicate to an external Postgres | | Docs | [/docs/guides/security/rotate-leaked-api-keys](https://supabase.com/docs/guides/security/rotate-leaked-api-keys) | [/docs/guides/security/rotate-leaked-api-keys](https://docs-git-docs-howto-rework-easy-pages-supabase.vercel.app/docs/guides/security/rotate-leaked-api-keys) | Rotate a leaked API key | ## Review instructions 1. Open the live and preview links for each page side by side. 2. Check that each page opens with a value statement and ends with Next steps. 3. Check that the code blocks and the Dashboard steps match the live page. 4. On the debugging page, check that the steps run in order across the two phases. 5. On the replication page, check that the code blocks and notes render under the right steps and the numbering runs 1 to 5. 6. On the rotate page, check that the "Retire the compromised key" link in Prerequisites still jumps to its heading. ## Checklist Check all before review: - [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) |
||
|
|
656aa60b20 |
docs(database): explain which role a security_invoker view checks (#53641)
## Problem The "View security" section of the views guide explains `security_invoker` but not which role is checked when the view is queried through the Data API, or why a `security_invoker` view over `auth` tables fails with every API key. Related to [FDBKIN-21897](https://linear.app/supabase/issue/FDBKIN-21897) Closes [DOCS-1687](https://linear.app/supabase/issue/DOCS-1687) ## Solution Adds two paragraphs of body text after the SQL example in "View security" (`apps/docs/content/guides/database/views.mdx`). The existing paragraph and SQL are unchanged. - The first paragraph says that through the Data API, Postgres checks the role from the request's API key or JWT (`anon`, `authenticated`, or `service_role`). That role needs privileges, such as `select`, on every table the view reads, not only on the view. Postgres logs show `authenticator`, the role the Data API connects as, not the role the view checks. - The second paragraph says that by default, API roles have no privileges on tables in the `auth` schema, so a `security_invoker` view over `auth.users` fails with `permission denied for table users`, even with a secret key. It points readers to storing user data in a `public` table, with a link to the User management guide. It does not recommend granting `auth` tables to any role. Needs review: the text says "by default" for `auth` grants because older projects may carry extra grants. Checks run: `prettier --check` on the changed file and `pnpm turbo run lint --filter='[origin/master]'` pass on the latest commit. `pnpm turbo run typecheck --filter='...[origin/master]'` passed on the first commit; the second commit changes only MDX prose. Docs tests were skipped because they need a local Supabase stack (Docker). ## 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> |
||
|
|
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> |
||
|
|
9437334289 | feat(pipelines): Update docs and UI (#53665) | ||
|
|
9006cd43dc |
docs: fix article error in pgTAP guide (#53397)
## Problem In `apps/docs/content/guides/database/extensions/pgtap.mdx:14`, the pgTAP description reads "It is an framework …". "framework" starts with a consonant sound, so the article should be "a". ## Solution Change "an framework" to "a framework". Docs-only change, no behavior change. Fixes #53396 Co-authored-by: Kody Jackson <kody.jackson@supabase.io> |
||
|
|
671c94e868 |
chore(docs,kb) - Update 301 destinations to final resolution + fix some 404s (#53553)
## Context Lots of links that initially go to 301's within docs / kb. Updates these to their resolved target. Ask your Claude Code to review the new destinations programmatically. --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
ceae23e199 |
docs: add cross-links in guides (AI, API, Auth, Database, Functions, deployment) (#53560)
## What Adds internal cross-links to docs guides ## Testing - Prettier passes on the changed lines. - Docs build passes (`pnpm build --filter=docs`). - Docs link e2e run locally against the production build for every changed page across this PR --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
e20bf8829c |
chore(studio,docs,www) - update [YOUR-PASSWORD] to be [YOUR-DATABASE-PASSWORD] for semantics + subsequent search terms (#53531)
## Problem Flavor of #41370 , but we can see that at least some traffic for this search query is searching using phrases like `supabase password reset` and `supabase password` and then accidentally find themselves on the `/docs/guides/auth/passwords` page. You can see this through user flow mappings in PostHog + also in search query traffic in Google Search Console. <img width="1261" height="669" alt="image" src="https://github.com/user-attachments/assets/70af109c-dbc8-42c2-887a-63133f3f82d5" /> <img width="1128" height="669" alt="image" src="https://github.com/user-attachments/assets/52358d87-55a8-4491-ad26-a0d390ebe55b" /> ## Solution Renames the placeholder across docs / studio / www to `[YOUR-DATABASE-PASSWORD]` and adds an admonition to the current `/docs/guides/auth/passwords` to direct folks to the correct place. Might also be a UX fix in the dash.... but poking into it feel like we already have a lot of affordances there already (`Reset database password` button on the direct connection panel + quick search action for `Reset database password`). ## Preview links ### Studio `https://studio-staging-obj7agk56-supabase.vercel.app/dashboard/project/$PROJECT?showConnect=true&connectTab=direct` <img width="1128" height="801" alt="image" src="https://github.com/user-attachments/assets/420c8582-97bd-45ff-914e-ea9bb25aed91" /> ### Docs https://docs-git-kody-devrel-866-database-password-placeholder-supabase.vercel.app/docs/guides/auth/passwords <img width="838" height="463" alt="image" src="https://github.com/user-attachments/assets/c4bb0242-6ff7-4de7-90c7-386818649209" /> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
2a9b02a99a | feat(docs): Improve Pipelines docs and UI (#53450) | ||
|
|
39cf54f3c4 |
docs: add cross-links to related guides and references (#53384)
## What Adds internal cross-links where a page mentions a product, feature, or concept that has its own canonical page. This PR covers docs guides under `apps/docs/content/guides`, excluding the shared partials (separate PR). ## How links were chosen - One canonical target per keyword, preferring docs guides over marketing or blog pages for docs content. - Only plain prose mentions: nothing inside headings, code, frontmatter, existing links, or UI labels. - One link per sentence, and no second link to the same target on a page. ## Testing - Prettier passes on all changed files. - Not yet run: docs build and internal link test, KB build. Draft until those are checked. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
5ca501cd24 |
chore(docs) - Remove inline Accordion component for machine readability -> details/summary instead (#53274)
## Problem Accordion components -- as currently constructed -- aren't machine readable b/c they require JS. Additionally, they aren't heavily used at all. ## Solution Removes accordion component from codebase + moves existing usage into `<details>` / `<summary>` components. Adds some default styling for the new HTML pattern so they look similar. Could also refactor accordion to auto-template out details/summary too. No strong pref here. ## Limits The sidebar navigation accordions use radix-ui directly and are unchanged. ## Preview links ### Before [Creating a client (before)](https://supabase.com/docs/guides/auth/server-side/creating-a-client#nextjs-utility-functions) https://github.com/user-attachments/assets/fd320358-7a35-46f8-b7b4-177b023e748e ### After [Creating a client (before)](https://docs-git-kody-devrel-850-remove-accordions-docs-mdx-supabase.vercel.app/docs/guides/auth/server-side/creating-a-client#nextjs-utility-functions) https://github.com/user-attachments/assets/22049184-9157-46d2-a3a6-64ca2c991e24 --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
628557490e |
docs: fix grammar in RUM extension guide (#50291)
Tiny docs fix in the RUM extension guide: - `The does` → `This does` - `allows to order` → `allows ordering` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Corrected a grammatical typo in the `rum_anyarray_addon_ops` description. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: mrchatam <mrchatam@users.noreply.github.com> Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
396358c7cb |
chore(docs,www) - added, deleted, redirected URLs (#53097)
## Problem added, deleted, redirected URLs + urls for new blog posts ## Preview links N/A --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
c1da930c40 |
chore(www) - crosslink + footer for dbarena.com (#52732)
## Problem dbarena.com launch, but not tied into other relevant areas of blog or www ecosystem. ## Solution Adds to the footer + some relevant cross-links from older blog posts. ## Preview links TBD |
||
|
|
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> |
||
|
|
1d50816f47 |
docs: enforce duplicate ID a11y rules and fix duplicates (#52720)
Closes DOCS-1573 ## Problem Recently, @antlio surfaced that our side nav was visually breaking. This is caused by a duplicate-id issue. The docs E2E axe scan reports duplicate `id` attributes as a warning only, so pages with duplicate IDs ship. A full scan of production guides found duplicate IDs on 25 of 586 pages. **Causes:** - **Repeated headings:** a page uses the same heading text twice, for example `#### Example` under two sections. Each heading slugs to the same ID. - **Pricing partials:** three usage pages put `## Pricing` directly above a shared partial that starts with its own Pricing heading. - **Components:** Mermaid diagrams hardcode SVG marker and node IDs. The Apple secret generator renders `id="undefined-optional"` on each field label. Each "Build it" listing on the Supabase way page renders `#build-it`. ## Solution - **Enforce the rules:** add `duplicate-id`, `duplicate-id-active`, and `duplicate-id-aria` to `ENFORCED_RULES`. - **Repeated headings:** give each later duplicate a `[#parent-section-heading]` anchor. The first occurrence keeps its ID. - **Pricing headings:** remove the page heading above the three partials that start with `## Pricing`. The PITR partial starts with `### Pricing`, so it gets `[#pitr-pricing]` and the page keeps its H2. - **Mermaid:** prefix the SVG IDs of each diagram with `useId()`. - **Apple secret generator:** give each field an ID. The label now also points at its input. - **Content listings:** add an optional `headingAnchor` to listing groups, and set it on the repeated "Build it" groups. - **pg_net:** the `http_delete` signature had `[#post-signature]`, copied from `http_post`. It is now `[#delete-signature]`. **Cross-references:** no link in the repo targets a changed ID. Each first occurrence keeps its ID, so existing links resolve to the same heading as before. **Not changed:** the www suite and `packages/ui-patterns`. All fixes stay in `apps/docs`. **Verification:** - Against production, `/docs/guides/platform/manage-your-usage/log-drains` fails the @a11y test with `duplicate-id`. - Against a local docs server, the @a11y test passes on all 28 changed or affected pages. **Unverified:** a full-site run with `A11Y_ENFORCE_ALL=1`. Run it against the preview before merge. ## Review instructions 1. From `e2e/docs`, run the a11y test against production. See it fail with `duplicate-id`: ```bash DOCS_E2E_PAGE_PATHS=/docs/guides/platform/manage-your-usage/log-drains PLAYWRIGHT_BASE_URL=https://supabase.com pnpm exec playwright test --grep @a11y ``` 2. Run the same command with `PLAYWRIGHT_BASE_URL` set to the docs preview URL from the Vercel bot comment. See it pass. 3. On the preview, open `/docs/guides/platform/manage-your-usage/log-drains`. In the table of contents, select **Pricing** under **Log Drain Events**. See the page scroll to the second Pricing section. 4. On the preview, open `/docs/guides/integrations/partner-integration-guide`. See both sequence diagrams render with arrowheads. ## Checklist Check all before review: - [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) |
||
|
|
e6e5c56264 |
docs(pgvector): fix duplicate heading and code block formatting (#48440)
## 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? Docs update — small structural and formatting fixes to `apps/docs/content/guides/database/extensions/pgvector.mdx`. ## What is the current behavior? **Duplicate `## Usage` heading.** The guide has `## Usage` at two places — once above "Enable the extension", and again above "Create a table to store vectors". Anchor IDs are generated from heading text, so both render as `#usage`. The table of contents shows two identical "Usage" entries, and clicking the second one scrolls to the first section. **Untagged code fence.** The iterative-search example uses a bare ``` fence, so it gets no syntax highlighting, unlike every other block on the page. Its SQL is also uppercase, while the rest of the guide (and the docs style guide) uses lowercase keywords. **Stray leading space** before `-- Example: enable the "vector" extension.` inside the enable-extension SQL block. **Typo:** the prose says "Transformer.js"; the library is Transformers.js (the code comment two lines below already spells it correctly). ## What is the new behavior? - Second `## Usage` renamed to `## Storing vectors`, which describes the two subsections it introduces ("Create a table to store vectors" and "Storing a vector / embedding"). The TOC now has unique entries and unique anchors. - Iterative-search fence tagged ` ```sql ` and its keywords lowercased. - Stray leading space removed. - "Transformer.js" → "Transformers.js". Content-only; no components, navigation, or generated output touched. ## Additional context Before renaming the heading I checked for anything linking to the old anchor: ``` grep -rn "#usage" apps/docs/content ``` No in-page or cross-file link targets `pgvector#usage` — the hits are unrelated pages and external URLs — so the rename doesn't break any links. Verified locally against the repo's own tooling: - `supa-mdx-lint` with `supa-mdx-lint.config.toml` → no errors or warnings (the new heading is sentence case, per `Rule001HeadingCase`). - Prettier 3.8.1 with `prettier.config.mjs` and `prettier-plugin-sql-cst` → already formatted, including the newly tagged `sql` block. One thing I deliberately left alone: the JS sample still imports `@xenova/transformers`, which has since been superseded by `@huggingface/transformers`. That's a behavioral change rather than a formatting one, so it felt out of scope here — happy to open a separate PR if you'd like it updated. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
0e0f84ac30 |
Remove MGMT API examples (#52676)
Updated log configuration settings to reflect changes in the CLI usage and removed API examples. ## Problem MGMT API overrode previous overrides ## Solution Remove MGMT API references --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> |
||
|
|
fca0f99354 |
docs: move the explain() guide to guides/api/query-plans (#52471)
Closes DOCS-1496 ## Problem The Debugging performance issues page is moved to the Data API as a part of the Information Architecture plan laid out in Option 1 of the [Docs navigation architecture proposal](https://app.notion.com/p/supabase/Q4-2027-Proposal-Docs-navigation-architecture-3f25004b775f81f49dbad710a732ef61). The [docs tree tests](https://github.com/supabase/evals/tree/docs/ia-tree-tests/evals/docs-tree-tests) in supabase/evals drove the rename. Each test gives an agent a developer goal and only the navigation labels, with no page content and no search. - **The task:** [one test](https://github.com/supabase/evals/tree/docs/ia-tree-tests/evals/docs-tree-tests/investigate-tree-036-client-call-execution-plan) asks how to see the plan Postgres uses for a slow supabase-js `.from('orders').select()` call. Its answer is this page. - **Today's label:** the page sits under Database as "Debugging performance issues". That label names a symptom many pages share, not the tool the page teaches. - **The change:** round 4 of the tests split the `explain()` content into its own topic, labeled "Query plans with explain()" and placed in Data API, Tools, next to the other client tools. Option 1 fixed every task its new topics targeted. - **Why the whole page moves:** `explain()` is the only thing the page covers, so a split would leave an empty source. The page takes the topic's label as its title. ## Solution - **Move, not split:** the whole page covers `explain()`, so a split would leave an empty source. The page moves to `guides/api/query-plans`, and the old URL redirects there. The existing `api/rest/debugging-performance` redirect now points straight to the new URL, so there's no chain. - **Anchors:** the four H2s keep their anchors, so the client reference link to `#enabling-explain` resolves through the redirect. The two H3s, Example data and Expected response, are gone. Nothing links to them. - **Navigation:** both entries in today's navigation point to the new URL, with the label "Query plans with explain()". In Option 1, the Data API, Tools entry points to the new page, and the Database entry is gone, since it would list the page twice. This was the last Option 1 topic that linked to a section of its source page, so the test that tracked those topics is removed. - **Inbound link:** Realtime reports links to the new URL. - **Cross-links:** the page links Query Performance for finding slow queries, Query optimization for plans of SQL you run yourself, Row Level Security performance for slow policies, and the `explain()` client reference. Query optimization and Row Level Security performance link back to it. - **Guide shape:** a value-statement opener with the reason `explain()` is off by default, and the sample table before the query that reads it. The SQL samples have no comments, and the `format` option has an example. Production readers are told to set up the filter before enabling, and the options paragraph warns that `analyze` on a write changes data. - **Row Level Security performance:** the caution about restricting plans now sits above the step that enables them. - **Sample fix:** `pgrst.db_pre_request` holds one function, so the production step now checks for an existing one and says to call the filter from it. The disable step clears the pre-request setting only for readers who set the filter directly. The filter function sets `search_path`, so the Security Advisor doesn't flag it. It matches the `Accept` header case-insensitively anywhere in the list, because PostgREST accepts `Application/vnd.pgrst.plan+text` and the old prefix check let it through. The check for an existing pre-request function reads `pg_db_role_setting`, which also shows per-database settings that `pg_roles.rolconfig` leaves out. When both a global and a per-database setting exist, the page says PostgREST uses the per-database one. The function is created and set as `public.filter_plan_requests`, because PostgREST resolves an unqualified name against the requested schema first. After the filter, the page says the Supabase Platform sets `cf-connecting-ip`, and that a self-hosted project needs a header its proxy overwrites. ### Verification `test-the-docs`, local stack, Supabase CLI v2.39.2. Each SQL fence ran in document order. The `supabase-js` calls were checked through the HTTP request they send, with `Accept: application/vnd.pgrst.plan`. | Step | Result | | --- | --- | | Plan request before enabling | 406, as expected | | Enable, then request a plan | 200, text plan, and JSON with `+json` | | Sample table, no extra grant | readable by `anon` | | Pre-request filter with `set search_path = ''`, non-matching IP | 401 `Not allowed to use application/vnd.pgrst.plan`, normal requests 200 | | Filter, mixed-case `Application/vnd.pgrst.plan+text` | old filter 200 with a plan, new filter 401; matching IP 200 | | Insert plan with `options=analyze` | row persists after the request; without `analyze`, no row | | Existing-function check with an `in database` setting | `pg_db_role_setting` shows it, `rolconfig` doesn't | | Disable | plan requests 406, normal requests 200 | | `cf-connecting-ip` on a hosted project | checked in review on a test project: Cloudflare sets it, and a request that sends its own value is rejected at the edge with `error code: 1000` | ### Not verified - **Deferred:** the TypeScript fences, because the sandbox runs Node only for example apps. The plan values in the example response come from the old page and differ slightly from a local run. - **Old links left on the redirect:** the client reference specs (`supabase_{dart,py,kt,swift}`), the supabase-js doc comment, and one `www` blog post still link to the old URL. ## Manual testing 1. Open [Query plans with explain()](https://docs-git-docs-query-plans-supabase.vercel.app/docs/guides/api/query-plans). See the enable, use, production, and disable sections. 2. Open [the old URL](https://docs-git-docs-query-plans-supabase.vercel.app/docs/guides/database/debugging-performance#enabling-explain). See it redirect to the new page at Enabling `explain()`. 3. In the Database sidebar under Debugging, click **Query plans with explain()**. See the new page open. |
||
|
|
d97a410577 |
docs: add a Supabase CLI v2 to v3 migration guide (#52147)
## 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? Docs update ## What is the current behavior? There's no page covering the breaking changes between Supabase CLI v2 and v3. v3.0.0 was released on 2026-11-02. ## What is the new behavior? Adds a migration guide at `/docs/guides/local-development/cli/migrating-to-v3`, linked from the Local Dev / CLI nav just under "Install and run the CLI". It's modelled on [Vite's migration guide](https://vite.dev/guide/migration): a short summary, what to do before upgrading, how to install (or stay on v2), a CI quick-reference table, then one section per change, ending with the removed commands, flags, config keys and env vars as tables. The content comes from the `BREAKING CHANGE` footers of the breaking PRs on supabase/cli `next`, checked against the code there: supabase/cli#6609, supabase/cli#7064, supabase/cli#7066, supabase/cli#7074, supabase/cli#7109, supabase/cli#7116, supabase/cli#7172, supabase/cli#7176, supabase/cli#7188 and supabase/cli#7221. ## Additional context The page describes v3.0.0 as released: npm `latest`, Homebrew, Scoop and the Linux packages all install v3. The "Staying on v2" channels are live with v2.122.1: npm `v2.stable`, `supabase/tap/supabase@2`, `supabase-v2-stable` on Scoop, and `version: v2.stable` or a semver range like `^2` on `supabase/setup-cli@v3` (ranges need v3.2.0). It also updates about 60 existing guides and troubleshooting pages for v3. Hosted examples pass `--remote`, CI examples that change a hosted project pass `--yes`, deprecated target flags and removed commands are replaced, and pages that described migra as the default now describe pg-delta. It adds a new concept page, "Running commands against local and hosted projects" at `/docs/guides/local-development/local-and-hosted-projects`, linked from the Local Dev nav after "Local development workflow". It covers how a command picks its target (local by default, `--remote` and its forms, the linked project, the `Target:` line), how settings resolve (flag, then shell env, then project env files, then config), and when the CLI asks before changing a hosted project (`--yes`, `SUPABASE_YES`, `--dry-run`, seeding), with a CI recipe and a section for AI coding agents. The migration guide links to it from its target, consent and config sections. Tracks CLI-2747 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
||
|
|
cd0b65c03e | feat(logs): Add Pipelines to unified logs and rename ETL to Pipelines (#52555) | ||
|
|
28d9157aab |
docs: stop guide subtitles from repeating the first sentence (#52568)
Closes DOCS-1553 ## Problem Some guides set a subtitle that says almost exactly what the first sentence of the page says, so the reader reads the same line twice. ## Solution - Add a **Write good frontmatter** section to the style guide, with **Title**, **Subtitle**, and **Description** subsections. A title is 35 characters or fewer, in sentence case, and follows the Google developer style guide's title rules. A subtitle is optional and decorative. If it matches the first sentence, leave it out. A description is 150–160 characters, with relevant keywords. - Remove the subtitle on 12 guides where it repeated the first sentence. On the 6 of those with no description, move the subtitle to `description` so the meta description doesn't change. - Change the Vault subtitle to `Manage secrets in Postgres` to match the rule's example. - In `CONTRIBUTING.md`, mark `description` as required and link to the new section. ## Manual testing 1. Open [Creating a client](https://docs-git-docs-guide-subtitles-supabase.vercel.app/docs/guides/auth/server-side/creating-a-client). See no subtitle under the title. 2. Open [Vault](https://docs-git-docs-guide-subtitles-supabase.vercel.app/docs/guides/database/vault). See `Manage secrets in Postgres` under the title. 3. Read [Write good frontmatter](https://github.com/supabase/supabase/blob/docs/guide-subtitles/apps/docs/style-guide/03-page-structure.md#write-good-frontmatter). |
||
|
|
b7144f7ff0 |
docs: clarify pool size scope and override behavior (#50521)
## 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? Docs update ## Additional context Clarifications on pooler settings override behavior <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated pool-size guidance to link default values to Compute Add-On limits. * Added default pool-size values for each Compute instance size. * Removed guidance stating that manually configured pool sizes remain fixed after Compute resizing. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
57b659d47f |
docs: move slow and failing query logging to its own page (#52469)
Closes DOCS-1495 ## Problem The `log_min_duration_statement`, `auto_explain.*`, and `log_min_error_statement` sections of Postgres log configurations are split out as a part of the Information Architecture plan laid out in Option 1 of the [Docs navigation architecture proposal](https://app.notion.com/p/supabase/Q4-2027-Proposal-Docs-navigation-architecture-3f25004b775f81f49dbad710a732ef61). ## Solution - **Structure:** move `log_min_duration_statement`, `auto_explain.*`, and `log_min_error_statement` to `guides/observability/log-slow-queries`. Postgres log configurations keeps each heading and its anchor, with a one-sentence pointer. The page is in the Database sidebar after Postgres log configuration. - **Option 1 navigation:** the "Log slow and failing queries" entry in Run and manage points to the new page. The Option 1 test no longer expects the anchor. `/edit-the-docs` and `/test-the-docs` ran as well. - **Cross-links:** the Customizing Postgres config table links this guide from its `auto_explain.*`, `log_min_duration_statement`, and `log_min_error_statement` rows, and the intro links Query logs with SQL for searching the logs. ## Manual testing 1. Open [Log slow and failing queries](https://docs-git-docs-log-slow-queries-supabase.vercel.app/docs/guides/observability/log-slow-queries). See the slow queries, query plans, errors, and restore-defaults sections. 2. Open [Postgres log configurations](https://docs-git-docs-log-slow-queries-supabase.vercel.app/docs/guides/database/postgres/postgres-log-config#logmindurationstatement). See the heading with a one-sentence pointer to the new page. 3. In the Database sidebar, click **Log slow and failing queries**. See the new page open. |
||
|
|
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. |
||
|
|
804a3c0969 |
chore(docs) - add in unique titles where appropriate (#52452)
## Problem Dupe titles in docs. ## Solution Adds unique titles where appropriate + high confidence. ## Preview links | Before | After | |---|---| | [Database Migrations \| Supabase Docs](https://supabase.com/docs/guides/deployment/database-migrations) | [Deploy Database Migrations \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/deployment/database-migrations) | | [Database Migrations \| Supabase Docs](https://supabase.com/docs/guides/local-development/database-migrations) | [Local Database Migrations \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/local-development/database-migrations) | | [Limits \| Supabase Docs](https://supabase.com/docs/guides/storage/uploads/file-limits) | [Storage Upload Limits \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/storage/uploads/file-limits) | | [Limits \| Supabase Docs](https://supabase.com/docs/guides/functions/limits) | [Edge Functions Limits \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/functions/limits) | | [Error Codes \| Supabase Docs](https://supabase.com/docs/guides/storage/debugging/error-codes) | [Storage Error Codes \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/storage/debugging/error-codes) | | [Views \| Supabase Docs](https://supabase.com/docs/guides/database/views) | [Database Views \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/guides/database/views) | | [Self-Hosting \| Supabase Docs](https://supabase.com/docs/reference/self-hosting-auth/introduction) | [Self-Hosting Auth \| Supabase Docs ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/reference/self-hosting-auth/introduction) | | [Supabase Docs](https://supabase.com/docs/reference) | [Supabase API references ✅](https://docs-git-kody-devrel-780-docs-dupe-titles-supabase.vercel.app/docs/reference) | --------- Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
038e68b777 |
docs: unify pooler guidance across the docs (#52332)
Closes DOCS-1519 ## Problem DOCS-1519 asks the docs team to do two things: unify the connection recommendations, and remove PgBouncer deprecation notices. PgBouncer isn't deprecated. It runs the dedicated pooler. **Deprecation notices:** no page in `apps/docs` says PgBouncer is deprecated. The last notice was in a 2021 blog post, and #52249 removed it. Two notices remain outside the docs: - **Studio:** the support form's IPv4 alert links to a "PGBouncer and IPv4 Deprecation" discussion. - **Blog:** a September 2023 update says PgBouncer is deprecated as of January 2024. **Recommendations:** Supabase runs two server-side poolers. The shared pooler runs on Supavisor and is on every plan. The dedicated pooler runs on PgBouncer and is on the Pro Plan and above. The docs name the two poolers in many ways, and many pages leave out the dedicated pooler. Some pages contradict the recommendations table in [Connect to your database](https://supabase.com/docs/guides/database/connecting-to-postgres#choose-a-connection-method): - **Prepared statements:** `connecting-to-postgres` says transaction mode doesn't support them. That is true for the shared pooler only. The dedicated pooler supports them on PgBouncer 1.21 and later. - **Migrations:** the restore pages, the quickstart partial, and the RedwoodJS quickstart send migrations and `pg_dump` through session mode. The table says to use the direct connection. - **Dedicated pooler:** `pooling-and-limits` says to use it on any IPv6 network. The table keeps it for high-load apps. ## Solution - **Names:** pages say _shared pooler_ and _dedicated pooler_, in lowercase. Each page names Supavisor or PgBouncer once, after the pooler name. _Session pooler_ and _Transaction pooler_ stay only where a page quotes the Connect dialog. - **Plans:** pooler and connection pages say _Pro Plan and above_ instead of _paid plans_. - **Recommendations:** every page above now matches the table. The shared pooler in session mode is the fallback for IPv4-only networks. - **Dedicated pooler coverage:** Managing connections and the IPv4 add-on page now cover the dedicated pooler. - **Word list:** `WORD_LIST.md` gets `dedicated pooler`, `shared pooler`, and `paid plan` entries. **Also fixed:** - The direct connection examples in both restore pages had the wrong username and `.supabase.com`. - The Managing connections heading changed. It keeps the `#configuring-supavisors-pool-size` anchor, because Studio links to it. **Not changed:** billing and usage pages that say _paid plans_, self-hosting pages, `apps/www`, and Studio. The Postgres and Render migration guides moved to `apps/kb` on `master` while this PR was open, so their edits are no longer in this diff. **Troubleshooting articles:** production redirects `/docs/guides/troubleshooting/` to `/kb/troubleshooting/`, which builds from the troubleshooting repo. The troubleshooting edits move there under DOCS-1521. **Size:** 25 files, 115 lines added and 97 removed. ## Preview links | Page | Live | Preview | Search for | | ---- | ---- | ------- | ---------- | | /connecting-to-postgres | [Live](https://supabase.com/docs/guides/database/connecting-to-postgres) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connecting-to-postgres) | A high-load application on the Pro Plan and above | | /pooling-and-limits | [Live](https://supabase.com/docs/guides/database/connecting-to-postgres/pooling-and-limits) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connecting-to-postgres/pooling-and-limits) | Use it for high-load applications | | /connection-management | [Live](https://supabase.com/docs/guides/database/connection-management) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connection-management) | The pool size applies to both the shared pooler | | /ipv4-address | [Live](https://supabase.com/docs/guides/platform/ipv4-address) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/platform/ipv4-address) | When using the dedicated pooler in an IPv6-incompatible network | | /backup-restore | [Live](https://supabase.com/docs/guides/platform/migrating-within-supabase/backup-restore) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/platform/migrating-within-supabase/backup-restore) | Use the direct connection string. If your network | | /dashboard-restore | [Live](https://supabase.com/docs/guides/platform/migrating-within-supabase/dashboard-restore) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/platform/migrating-within-supabase/dashboard-restore) | Use the direct connection string. If your ISP | | /redwoodjs | [Live](https://supabase.com/docs/guides/getting-started/quickstarts/redwoodjs) | [Preview](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/getting-started/quickstarts/redwoodjs) | This quickstart uses two connection strings | ## Review instructions 1. Open [Connect to your database](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connecting-to-postgres). The table and the **Dedicated pooler** section say _Pro Plan and above_. 2. Open [Connection pooling and limits](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connecting-to-postgres/pooling-and-limits). It recommends the dedicated pooler for high-load apps only. 3. Open [Managing connections](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/database/connection-management). The pool size section covers both the shared pooler and the dedicated pooler. 4. Open [Backup and restore](https://docs-git-docs-unify-pooler-guidance-supabase.vercel.app/docs/guides/platform/migrating-within-supabase/backup-restore). Step 3 says to use the direct connection string. ## Checklist Check all before review: - [ ] 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) |
||
|
|
07e69b9737 |
docs: fix broken anchor links (#52181)
## Problem A full docs E2E run with the anchor check from #52174 found 58 broken anchor links on 53 guide pages. Most point to renamed or removed headings. Fixing them sets a baseline of zero for the IA restructure. Closes DOCS-1516 ## Solution - Retarget each link to the section that covers it today, verified on production. - Add a custom id where links already use a hand-written slug, such as `#phx_join`. - Drop the anchor where no section fits. ## Preview links Rows with an anchor link straight to a new custom id, which is broken on live and works on the preview. For the rest, search the page for the phrase to find the changed link. | Live | Preview | Search for | Change | | --- | --- | --- | --- | | [with-react](https://supabase.com/docs/guides/getting-started/tutorials/with-react) | [with-react](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/getting-started/tutorials/with-react) | Row Level Security | `auth#row-level-security` → `database/postgres/row-level-security` (20 links, 15 files) | | [nextjs](https://supabase.com/docs/guides/auth/quickstarts/nextjs) | [nextjs](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/auth/quickstarts/nextjs) | Supabase Auth docs | `auth#authentication` → `auth` | | [astrojs](https://supabase.com/docs/guides/auth/quickstarts/astrojs) | [astrojs](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/auth/quickstarts/astrojs) | Supabase Auth docs | `auth#authentication` → `auth` | | [custom-domains](https://supabase.com/docs/guides/platform/custom-domains) | [custom-domains](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/platform/custom-domains) | Owner or Admin permissions | `access-control#manage-team-members` → `#manage-organization-members` | | [network-restrictions](https://supabase.com/docs/guides/platform/network-restrictions) | [network-restrictions](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/platform/network-restrictions) | Owner or Admin permissions | `access-control#manage-team-members` → `#manage-organization-members` | | [postgres-connection-logging](https://supabase.com/docs/guides/platform/postgres-connection-logging) | [postgres-connection-logging](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/platform/postgres-connection-logging) | Owner or Admin permissions | `access-control#manage-team-members` → `#manage-organization-members` | | [ssl-enforcement](https://supabase.com/docs/guides/platform/ssl-enforcement) | [ssl-enforcement](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/platform/ssl-enforcement) | Owner or Admin permissions | `access-control#manage-team-members` → `#manage-organization-members` | | [with-expo-react-native-social-sign-in](https://supabase.com/docs/guides/auth/quickstarts/with-expo-react-native-social-sign-in) | [with-expo-react-native-social-sign-in](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/auth/quickstarts/with-expo-react-native-social-sign-in) | copied earlier | `#get-the-api-keys` → `#get-api-details` | | [with-expo-react-native-social-sign-in](https://supabase.com/docs/guides/auth/quickstarts/with-expo-react-native-social-sign-in) | [with-expo-react-native-social-sign-in](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/auth/quickstarts/with-expo-react-native-social-sign-in) | Apple Developer Console | `auth-apple#configuration-web` → `#configuration-web-oauth` | | [with-expo-react-native-social-sign-in](https://supabase.com/docs/guides/auth/quickstarts/with-expo-react-native-social-sign-in) | [with-expo-react-native-social-sign-in](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/auth/quickstarts/with-expo-react-native-social-sign-in) | Google Sign In | Dropped `#react-native`, a non-default tab | | [with-flutter](https://supabase.com/docs/guides/getting-started/tutorials/with-flutter) | [with-flutter](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/getting-started/tutorials/with-flutter) | copied earlier | `#get-the-api-keys` → `#get-api-details` | | [going-to-prod](https://supabase.com/docs/guides/ai/going-to-prod#hnsw-understanding-efconstruction--efsearch--and-m) | [going-to-prod](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/ai/going-to-prod#hnsw-understanding-efconstruction--efsearch--and-m) | HNSW, understanding | Custom id matching the links from `ai/choosing-compute-addon` | | [rag-with-permissions](https://supabase.com/docs/guides/ai/rag-with-permissions) | [rag-with-permissions](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/ai/rag-with-permissions) | query plan analyzer | `platform/performance#optimizing-poor-performing-queries` → `database/query-optimization#analyze-the-query-plan` | | [ivf-indexes](https://supabase.com/docs/guides/ai/vector-indexes/ivf-indexes) | [ivf-indexes](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/ai/vector-indexes/ivf-indexes) | Distance operators | `#distance-operators` → `ai/vector-indexes#distance-operators` | | [custom-claims-and-role-based-access-control-rbac](https://supabase.com/docs/guides/api/custom-claims-and-role-based-access-control-rbac) | [custom-claims-and-role-based-access-control-rbac](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/api/custom-claims-and-role-based-access-control-rbac) | local development | `auth-hooks#local-development` → `#developing` | | [native-mobile-deep-linking](https://supabase.com/docs/guides/auth/native-mobile-deep-linking) | [native-mobile-deep-linking](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/auth/native-mobile-deep-linking) | password reset | `passwords#resetting-a-users-password-forgot-password` → `#resetting-a-password` | | [mcp-authentication](https://supabase.com/docs/guides/auth/oauth-server/mcp-authentication) | [mcp-authentication](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/auth/oauth-server/mcp-authentication) | authorization UI | `getting-started#build-your-authorization-endpoint` → `#build-your-authorization-ui` | | [passwords](https://supabase.com/docs/guides/auth/passwords) | [passwords](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/auth/passwords) | implicit flow | `sessions#implicit-flow`, `sessions#pkce-flow` → `sessions/implicit-flow`, `sessions/pkce-flow` | | [redirect-urls](https://supabase.com/docs/guides/auth/redirect-urls) | [redirect-urls](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/auth/redirect-urls) | third-party providers | Dropped the `auth-signinwithoauth` example anchor | | [users](https://supabase.com/docs/guides/auth/users) | [users](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/auth/users) | User Identity | `auth-identity-linking#the-user-identity` → `identities#the-user-identity-object` | | [upgrading](https://supabase.com/docs/guides/platform/upgrading#upgrading-to-pg_graphql-160) | [upgrading](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/platform/upgrading#upgrading-to-pg_graphql-160) | Upgrading to pg_graphql | Custom id matching the link from `database/extensions/pg_graphql` | | [import-data](https://supabase.com/docs/guides/database/import-data) | [import-data](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/database/import-data) | disk management | `database-size#disk-management` → `#disk-size` | | [multigres](https://supabase.com/docs/guides/database/multigres) | [multigres](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/database/multigres) | Private Alpha | Dropped the link. `getting-started/features` redirects to `/features` | | [data-deletion](https://supabase.com/docs/guides/database/postgres/data-deletion) | [data-deletion](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/database/postgres/data-deletion) | Check for blocked queries | `#monitoring-locks` → `#check-for-blocked-queries` | | [postgres-log-config](https://supabase.com/docs/guides/database/postgres/postgres-log-config) | [postgres-log-config](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/database/postgres/postgres-log-config) | Supavisor | `connecting-to-postgres#poolers` → `pooling-and-limits#shared-pooler` and `#dedicated-pooler` | | [partner-catalog](https://supabase.com/docs/guides/integrations/partner-catalog) | [partner-catalog](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/integrations/partner-catalog) | Project GraphQL API | `api#graphql-api-overview` → `graphql` | | [vercel-marketplace](https://supabase.com/docs/guides/integrations/vercel-marketplace) | [vercel-marketplace](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/integrations/vercel-marketplace) | How your Vercel team maps | `#permissions` → `#how-your-vercel-team-maps-to-supabase` | | [managing-config](https://supabase.com/docs/guides/local-development/managing-config) | [managing-config](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/local-development/managing-config) | Managing secrets for branches | `branching#managing-secrets-for-branches` → `branching/configuration#managing-secrets-for-branches` | | [reports](https://supabase.com/docs/guides/observability/reports) | [reports](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/observability/reports) | Query Performance Advisory | `performance#examine-query-performance` → `#examining-query-performance` | | [backups](https://supabase.com/docs/guides/platform/backups) | [backups](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/platform/backups) | legacy logical backup | `backup-restore#backup-database-using-the-cli` → `#back-up-database-using-the-cli` | | [backups](https://supabase.com/docs/guides/platform/backups#pitr-restoration-process) | [backups](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/platform/backups#pitr-restoration-process) | Restoration process | Custom id matching the link from `read-replicas/getting-started` | | [branching](https://supabase.com/docs/guides/platform/manage-your-usage/branching) | [branching](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/platform/manage-your-usage/branching) | persistent branches | `branching#persistent-branches` → `#how-branching-works` | | [point-in-time-recovery](https://supabase.com/docs/guides/platform/manage-your-usage/point-in-time-recovery) | [point-in-time-recovery](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/platform/manage-your-usage/point-in-time-recovery) | backup frequency | `backups#frequency-of-backups` → `backups` | | [read-replicas](https://supabase.com/docs/guides/platform/read-replicas) | [read-replicas](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/platform/read-replicas) | IPv4 add-on | `ipv4-address#read-replicas` → `#read-replicas-and-ipv4-add-on` | | [protocol](https://supabase.com/docs/guides/realtime/protocol#access-token) | [protocol](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/realtime/protocol#access-token) | access_token | Custom id matching the link from `realtime/authorization` | | [postgres-changes](https://supabase.com/docs/guides/realtime/postgres-changes#negating-a-filter-not) | [postgres-changes](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/realtime/postgres-changes#negating-a-filter-not) | Negating a filter | Custom id matching the existing in-page link | | [protocol](https://supabase.com/docs/guides/realtime/protocol#phx_join) | [protocol](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/realtime/protocol#phx_join) | phx_join | Custom id matching the existing in-page link | | [reports](https://supabase.com/docs/guides/realtime/reports) | [reports](https://docs-git-docs-fix-broken-anchors-supabase.vercel.app/docs/guides/realtime/reports) | Broadcast via REST API | `broadcast#broadcast-via-rest-api` → `#broadcast-using-the-rest-api` | <details> <summary>The 15 files with Row Level Security links</summary> - `_partials/quickstart_intro.mdx`, used by the framework tutorials - `auth/phone-login` - `auth/quickstarts/with-expo-react-native-social-sign-in` - `database/postgres/column-level-security` - `getting-started/tutorials/`: `with-flutter`, `with-ionic-angular`, `with-ionic-react`, `with-ionic-vue`, `with-kotlin`, `with-nuxt-3`, `with-redwoodjs`, `with-solidjs`, `with-svelte`, `with-swift`, `with-vue-3` </details> ## Review instructions 1. Open a few live and preview links side by side, and click the changed link on each to confirm the preview lands on the right section. 2. From a checkout of `docs/e2e-anchor-links`, run the anchor check against the preview with the changed pages, as described in `e2e/docs/README.md`: `DOCS_E2E_PAGE_PATHS=<changed /docs/... paths> PLAYWRIGHT_BASE_URL=https://docs-git-docs-fix-broken-anchors-supabase.vercel.app pnpm exec playwright test --grep-invert @a11y` 3. Confirm the anchor check reports no failures. ## Checklist Check all before review: - [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) |
||
|
|
7f9d4cd7c6 |
docs: add Vault secret deletion example (#52004)
## Problem The Vault guide explains creating, viewing, and updating secrets but has no deletion example. Addresses https://github.com/supabase/vault/issues/32. ## Solution Add a “Deleting secrets” section with an ID-filtered SQL example. Use `returning id, name` to show the deleted entry and explain its removal from `vault.decrypted_secrets`. ## Review instructions 1. Check that “Deleting secrets” appears after “Updating secrets.” 2. Create two dummy secrets and record their IDs. 3. Run the example using one secret’s ID. Confirm the returned row identifies that secret and the other remains readable. 4. Clean up the remaining dummy secret. Manually verified on hosted Vault 0.3.1 using the `postgres` role. Prettier passed with the repository configuration. Full docs build not run. Docker sandbox verification deferred because Docker is unavailable in the review environment. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md). - [x] I used the docs authoring skills and applied the documentation style guide. |
||
|
|
7e76ef25f7 |
fix(docs): link to Database Settings for SSL certificate download (#51327)
## Problem On the psql guide, the "Connecting with SSL" section says "Download your [SSL certificate](#connecting-with-ssl)", but that link points back to the same section. It never says where the certificate is, so readers can't find the download. Reported in the issue linked below. ## Solution Point the link at the Dashboard's Database Settings page (`/dashboard/project/_/database/settings`), where the SSL certificate download lives. This is the same link other database guides already use (for example the DBeaver and Beekeeper Studio guides). One line changed in `apps/docs/content/guides/database/psql.mdx`. ## Review instructions 1. Open `apps/docs/content/guides/database/psql.mdx`, "Connecting with SSL". 2. Check that "Database Settings" now links to `/dashboard/project/_/database/settings` instead of the same page. --------- Co-authored-by: hallidayo <22655069+Hallidayo@users.noreply.github.com> Co-authored-by: Nik Richers <nrichers@gmail.com> |
||
|
|
3232bbb3e4 |
docs: fix four typos across docs pages (#50755)
Doc-only typo fixes (no behavior affected): - `content/guides/database/json.mdx`: `indentity` -> `identity` - `content/guides/database/postgres/cascade-deletes.mdx`: `INITIALLY DEFFERED` -> `INITIALLY DEFERRED` (SQL keyword) - `docs/ref/csharp/v0/release-notes.mdx`: `futher` -> `further` - `docs/ref/self-hosting-analytics/introduction.mdx`: `environement` -> `environment` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Corrected spelling and wording errors across database, PostgREST, and self-hosting analytics documentation. * Clarified the Dashboard instruction for automatically generating identity values. * Corrected terminology in guidance for deferred actions and encryption-key rotation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Dextheking1 <4175097+Dextheking1@users.noreply.github.com> |
||
|
|
2f548a69a3 |
docs(postgis): link to the Security Advisor troubleshooting guide (#51439)
## 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? New troubleshooting guide on Security Advisor flagging spatial_ref_sys and other PostGIS objects in the public schema ## What is the current behavior? ## What is the new behavior? New guide PR: https://github.com/supabase/troubleshooting/pull/339 Link to the guide preview: - [Security Advisor flags spatial_ref_sys and other PostGIS objects in the public schema](https://docs-git-docs-troubleshooting-postgis-security-advisor-supabase.vercel.app/docs/guides/database/extensions/postgis#security-advisor-flags-publicspatialrefsys) |
||
|
|
8a78b7e5be |
docs: call Edge Functions from Postgres with the secret key (#51990)
Found during my dogfooding project :) ## Problem Three guides give conflicting guidance on how Postgres should authenticate when it calls an Edge Function: - **Securing Edge Functions:** calls from `pg_net` and cron jobs send the secret key on `apikey`, with `auth: 'secret'` and `verify_jwt = false`. The Dashboard agrees: the webhook and cron job forms only offer **Add secret key**. - **Scheduling Edge Functions:** the only example that stores a key in Vault sends the publishable key. A request with only the publishable key passes the `verify_jwt` check, so anyone who has that public key can call the function. - **Database Webhooks:** doesn't cover calling an Edge Function or authenticating to it. Its SQL example writes headers inline, so a webhook created in a migration puts the secret key in a committed file. Resolves [DOCS-1458](https://linear.app/supabase/issue/DOCS-1458), [FDBKIN-19992](https://linear.app/supabase/issue/FDBKIN-19992) ## Solution All three pages now recommend the secret key for calls from Postgres. - **Scheduling Edge Functions:** stores and sends the secret key, explains why the publishable key isn't safe here, and links to the function-side setup. - **Database Webhooks:** a new Call an Edge Function section covers the Supabase Dashboard flow and a migration. The migration reads the key from Vault in a `security definer` trigger function. The section explains that the definer is required, because the roles that insert rows can't read Vault. - **Securing Edge Functions:** the service-to-service section is now a two-step setup. It shows how to disable the `verify_jwt` check in `supabase/config.toml`, with a link to the Authorization headers guide, and how to use `auth: 'secret'` in the function. It then links to Database Webhooks and Scheduling Edge Functions. - **`pg_net` queue:** Database Webhooks and Scheduling Edge Functions show a caution that any role that can log in to the database can read the secret key while the request waits, because `pg_net` writes the decrypted key to `net.http_request_queue` until it sends the request. Both pages include the caution from a new partial, `_partials/pg_net_queued_key.mdx`, which links to the troubleshooting article. ## Verification (`/test-the-docs`) | Snippet / step | Class | Sandbox | Result | Notes | | --- | --- | --- | --- | --- | | Function with `auth: 'secret'` and `verify_jwt = false`, called with the secret key on `apikey` | runnable-with-setup | Compose runner + `supabase start` | pass | Returns `200` | | Same function, called with the publishable key, then no key | runnable-with-setup | Compose runner + `supabase start` | pass | Rejected with `INVALID_API_KEY`, then `MISSING_CREDENTIALS` | | Scheduling Edge Functions: Vault secrets, then `cron.schedule` | runnable-with-setup | Compose runner + `supabase start` | pass | The cron run succeeded, and the function returned `200` | | Database Webhooks: Vault-based trigger function and trigger | runnable-with-setup | Compose runner + `supabase start` | pass | Inserts as `postgres` and as `authenticated` both reached the function with the documented payload | | Same trigger function as `security invoker`, insert as `authenticated` | runnable-with-setup | Compose runner + `supabase start` | pass | Fails with `permission denied for schema vault`, which confirms the page's explanation | | Database Webhooks: Dashboard steps | deferred | — | deferred | Needs a hosted project. Labels confirmed in the Studio source. | **Tier A path:** Vault secrets → `pg_cron` job → `pg_net` request → Edge Function with `auth: 'secret'` returns `200`. **Environment:** OrbStack; compose sandbox (`sandbox/run.sh`); fences in-container only. Two deviations from the stock sandbox, neither committed: - The sandbox pins Supabase CLI v2.39.2, which predates `sb_secret_` and `sb_publishable_` keys. The run used v2.121.0. - The `dind` service doesn't mount `/work`, so local functions fail with `failed to determine entrypoint`. The function file was copied into the DinD filesystem. `project_url` pointed at the local API gateway, because the database container can't reach the runner's `127.0.0.1`. ## Preview links - [Database Webhooks](https://docs-git-alexisa-docs-1458-supabase.vercel.app/docs/guides/database/webhooks) - [Scheduling Edge Functions](https://docs-git-alexisa-docs-1458-supabase.vercel.app/docs/guides/functions/schedule-functions) - [Securing Edge Functions](https://docs-git-alexisa-docs-1458-supabase.vercel.app/docs/guides/functions/auth) ## Post-merge > [!IMPORTANT] > After this PR merges, post the following comment on [FDBKIN-19992](https://linear.app/supabase/issue/FDBKIN-19992) and close it: > > The "Missing required headers" error happens when the webhook doesn't send an auth header to the Edge Function. Database Webhooks send only the headers you configure. [Database Webhooks → Call an Edge Function](https://supabase.com/docs/guides/database/webhooks#call-an-edge-function) shows how to add the secret key, either in the Dashboard with **Add secret key** or in a migration that reads the key from Vault. [Securing Edge Functions](https://supabase.com/docs/guides/functions/auth#service-to-service-calls) covers the function side: disable `verify_jwt` and use `auth: 'secret'`. |
||
|
|
d4a2c464b2 |
chore(docs) - update troubleshooting links to new destinations (#52095)
## Problem KB now has definitive version of the troubleshooting guides. Need to update the in content links to match work happening in #52088. ## Preview links N/A... all atomic changes to links, so previews not very helpful here. |
||
|
|
8bcbe3dcc7 |
feat(docs): extracts code block component (#51661)
## Problem new surfaces display code blocks their own way while docs has the full implementation but it lives inside `apps/docs` ## Solution - moves the docs code block parts to `ui-patterns/CodeBlock` as separate imports - kb code blocks now show line numbers, which matches docs | state | preview | | -------|------| | before | <img width="913" height="509" alt="image" src="https://github.com/user-attachments/assets/76ff0096-433a-4b06-9eca-1d79c4940e24" /> | | after | <img width="913" height="509" alt="image" src="https://github.com/user-attachments/assets/4f5d91d9-13df-44a0-9e65-edf605773c5f" /> | <!-- ## Preview links If relevant, include links to changed pages for easy review access. Copy the preview base URL from the Vercel bot comment on this PR. Use the following table as an example template. | Site | Live | Preview | Search for | | -------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------- | | WWW | [/blog/your-post](https://supabase.com/blog/your-post) | [/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post) | unique phrase from the change | | Docs | [/docs/guides/your-page](https://supabase.com/docs/guides/your-page) | [/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page) | unique phrase from the change | | Studio | [/dashboard](https://supabase.com/dashboard) | [/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard) | unique phrase from the change | | Design system | [/design-system](https://supabase.com/design-system) | [/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system) | unique phrase from the change | | UI library | [/library](https://supabase.com/library) | [/library](https://ui-library-git-branch-name-supabase.vercel.app/library) | unique phrase from the change | | Knowledge base | [/kb/guides/your-page](https://supabase.com/kb/guides/your-page) | [/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page) | unique phrase from the change | --> <!-- ## Additional context Optionally add any other context or screenshots. --> ## Review instructions 1. visit /[docs/guides/database/tables#enabling-row-level-security ](https://docs-git-feat-shared-code-block-parts-supabase.vercel.app/docs/guides/database/tables#enabling-row-level-security)code blocks, line numbers, colors in light and dark mode, copy, and word wrap match 2. visit [/docs/guides/auth/passwords](https://docs-git-feat-shared-code-block-parts-supabase.vercel.app/docs/guides/auth/passwords) hover over a typed identifier tooltip should still show 3. visit a kb guide with code, for example [/kb/guides/migrate-from-mysql](https://kb-git-feat-shared-code-block-parts-supabase.vercel.app/kb/guides/migrate-from-mysql) 4. visit the [design system code block page](https://design-system-git-feat-shared-code-block-parts-supabase.vercel.app/design-system/docs/fragments/code-block) ## Checklist Check all before review: - [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) |
||
|
|
e854b84ed4 |
docs - broken link in serverless drivers page (#52042)
## Problem broken link |
||
|
|
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. |