mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## What Adds internal cross-links where a page mentions a product, feature, or concept that has its own canonical page. This PR covers the two shared docs partials, so each link appears once in source and propagates to every page that includes the partial (the social-login setup pages and the quickstarts). ## 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>
78 lines
2.8 KiB
Plaintext
78 lines
2.8 KiB
Plaintext
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);`
|
|
|
|
<$Partial path="quickstart_create_project.mdx" />
|
|
|
|
## 2. Set up your database
|
|
|
|
When your Supabase project is up and running, create an `instruments` table with some sample data. Then set only the privileges each [Postgres role](/docs/guides/database/postgres/roles) 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.
|
|
|
|
Do these steps within your project's dashboard by copying and running the snippet in your project's [SQL Editor](/dashboard/project/_/sql/new).
|
|
|
|
<Admonition type="note">
|
|
|
|
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**.
|
|
|
|
</Admonition>
|
|
|
|
<Admonition type="note" title="Want to setup the database programmatically?">
|
|
|
|
You can use [the Management API](/docs/reference/api/v1-run-a-query) or ask [the MCP server](/docs/guides/ai-tools/mcp#database) to execute SQL queries.
|
|
|
|
</Admonition>
|
|
|
|
```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?">
|
|
|
|
If you disabled the Data API during project setup, enable it in the [**Integrations > Data API**](/dashboard/project/_/integrations/data_api/settings) section of the Dashboard and expose the specific tables or functions you want to access. To automatically grant access for new tables and functions in `public`, enable **Automatically expose new tables**.
|
|
|
|
</Admonition>
|