The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix: Rephrasing and improved output for framework quick starts instructions (#47576)
Jeremias Menichellic84d8b91d112
diff --git a/apps/docs/content/_partials/quickstart_db_setup.mdx b/apps/docs/content/_partials/quickstart_db_setup.mdxindex 49dc1e2431a..e639c4e05c8 100644--- a/apps/docs/content/_partials/quickstart_db_setup.mdx+++ b/apps/docs/content/_partials/quickstart_db_setup.mdx@@ -1,27 +1,27 @@-export const sqlSetup = ` -- Create the table- create table instruments (- id bigint primary key generated always as identity,- name text not null- );-- -- Insert sample data into the table- insert into instruments (name)- values- ('violin'),- ('viola'),- ('cello');-- -- Grant the privileges the role needs, which is read access- grant select on public.instruments to anon;-- -- Enable row level security for the table- alter table instruments enable row level security;-- -- Create a policy to allow the anon role to read from the instruments table- create policy "public can read instruments"- on public.instruments- for select to anon- using (true);`+export const sqlSetup = `-- Create the table+create table instruments (+ id bigint primary key generated always as identity,+ name text not null+);++-- Insert sample data into the table+insert into instruments (name)+values+('violin'),+('viola'),+('cello');++-- Grant the privileges the role needs, which is read access+grant select on public.instruments to anon;++-- Enable row level security for the table+alter table instruments enable row level security;++-- Create a policy to allow the anon role to read from the instruments table+create policy "public can read instruments"+on public.instruments+for select to anon+using (true);`## 1. Create a Supabase project@@ -82,60 +82,42 @@ npx skills add supabase/agent-skills## 3. Set up your database-When your Supabase project is up and running, create an `instruments` table with some sample data.+When your Supabase project is up and running, create an `instruments` table with some sample data. Then set only the privileges each Postgres role needs, add [Row Level Security (RLS)](/docs/guides/database/postgres/row-level-security) for enhanced security for database data by default, and create an RLS policy to make the data in the table publicly readable.-Then set a secure baseline by setting only the privileges each Postgres role needs, add [Row Level Security (RLS)](/docs/guides/database/postgres/row-level-security) for enhanced security for database data by default, and create an RLS policy to make the data in your table publicly readable.--You can click this button to prefill all the SQL needed in [the SQL editor of your project](/dashboard/project/_/sql) in the Dashboard.--<Button variant="primary" asChild>- <a href={`/dashboard/project/_/sql/new?content=${encodeURIComponent(sqlSetup)}`}>Prefill SQL</a>-</Button>--<Accordion- type="default"- chevronAlign="right"- justified- size="medium"- className="text-foreground-light mt-8 mb-6"->- <AccordionItem- header="Want to learn more about the SQL and add it manually?"- id="manual-sql"- >-- Run the following snippet in your project's [SQL Editor](/dashboard/project/_/sql/new). You can also choose the SQL and prefill it from the **Reference > Samples** menu at the side of the SQL Editor.-- ```sql SQL_EDITOR- -- Create the table- create table instruments (- id bigint primary key generated always as identity,- name text not null- );-- -- Insert sample data into the table- insert into instruments (name)- values- ('violin'),- ('viola'),- ('cello');-- -- Grant the privileges the role needs, which is read access- grant select on public.instruments to anon;-- -- Enable row level security for the table- alter table instruments enable row level security;+<Admonition type="tip">- -- Create a policy to allow the anon role to read from the instruments table- create policy "public can read instruments"- on public.instruments- for select to anon- using (true);- ```+Save some steps by <a href={`/dashboard/project/_/sql/new?content=${encodeURIComponent(sqlSetup)}`}>clicking here to prefill the SQL</a> in the SQL Editor, and then clicking **Run**.- </AccordionItem>+</Admonition>-</Accordion>+Or do this manually in your project's [SQL Editor](/dashboard/project/_/sql/new), by pasting the SQL below, and clicking **Run**.++```sql SQL_EDITOR+-- Create the table+create table instruments (+ id bigint primary key generated always as identity,+ name text not null+);++-- Insert sample data into the table+insert into instruments (name)+values+ ('violin'),+ ('viola'),+ ('cello');++-- Grant the privileges the role needs, which is read access+grant select on public.instruments to anon;++-- Enable row level security for the table+alter table instruments enable row level security;++-- Create a policy to allow the anon role to read from the instruments table+create policy "public can read instruments"+on public.instruments+for select to anon+using (true);+```<Admonition type="note" label="Disabled the Data API during project setup?">