mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Docs: Rename serverless apis to data apis (#19256)
* serverless apis -> data apis * capitalization fix
This commit is contained in:
1 parent
7ef690dcc4
commit
f5f039ed05
4 files changed
+10
-10
No files matched your search
@@ -3,12 +3,12 @@ import Layout from '~/layouts/DefaultGuideLayout'
|
||||
export const meta = {
|
||||
id: 'api-keys',
|
||||
title: 'Understanding API Keys',
|
||||
description: 'Securing your Serverless API with Postgres Row Level Security.',
|
||||
description: 'Securing your Data API with Postgres Row Level Security.',
|
||||
}
|
||||
|
||||
Supabase provides two default keys when you create a project: an `anon` key, and a `service_role` key. You can find both keys in the [API Settings](https://supabase.com/dashboard/project/_/settings/api).
|
||||
|
||||
The Serverless APIs are designed to work with Postgres Row Level Security (RLS). These keys both map to Postgres roles. You can find an `anon` user and a `service_role` user in the [Roles](http://supabase.com/dashboard/project/_/database/roles) section of the dashboard.
|
||||
The data APIs are designed to work with Postgres Row Level Security (RLS). These keys both map to Postgres roles. You can find an `anon` user and a `service_role` user in the [Roles](http://supabase.com/dashboard/project/_/database/roles) section of the dashboard.
|
||||
|
||||
The keys are both long-lived JWTs. If you decode these keys, you will see that they contain the "role", an "issued date", and an "expiry date" ~10 years in the future.
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ import Layout from '~/layouts/DefaultGuideLayout'
|
||||
export const meta = {
|
||||
id: 'joins-and-nested-tables',
|
||||
title: 'Querying Joins and Nested tables',
|
||||
description: 'The Serverless APIs automatically detect relationships between Postgres tables.',
|
||||
description: 'The Data APIs automatically detect relationships between Postgres tables.',
|
||||
}
|
||||
|
||||
The Serverless APIs automatically detect relationships between Postgres tables. Since Postgres is a relational database, this is a very common scenario.
|
||||
The data APIs automatically detect relationships between Postgres tables. Since Postgres is a relational database, this is a very common scenario.
|
||||
|
||||
## One-to-many joins
|
||||
|
||||
@@ -176,7 +176,7 @@ GET https://[REF].supabase.co/rest/v1/countries?select=id,name,cities(id,name)
|
||||
|
||||
## Many-to-many joins
|
||||
|
||||
The Serverless APIs will detect many-to-many joins. For example, if you have a database which stored teams of users (where each user could belong to many teams):
|
||||
The data APIs will detect many-to-many joins. For example, if you have a database which stored teams of users (where each user could belong to many teams):
|
||||
|
||||
```sql
|
||||
create table users (
|
||||
|
||||
@@ -3,10 +3,10 @@ import Layout from '~/layouts/DefaultGuideLayout'
|
||||
export const meta = {
|
||||
id: 'securing-your-api',
|
||||
title: 'Securing your API',
|
||||
description: 'Securing your Serverless API with Postgres Row Level Security.',
|
||||
description: 'Securing your Data API with Postgres Row Level Security.',
|
||||
}
|
||||
|
||||
The Serverless APIs are designed to work with Postgres Row Level Security (RLS). If you use [Supabase Auth](/docs/guides/auth), you can restrict data based on the logged-in user.
|
||||
The data APIs are designed to work with Postgres Row Level Security (RLS). If you use [Supabase Auth](/docs/guides/auth), you can restrict data based on the logged-in user.
|
||||
To control access to your data, you can use [Policies](/docs/guides/auth#policies).
|
||||
|
||||
## Enabling Row Level Security
|
||||
|
||||
@@ -3,10 +3,10 @@ import Layout from '~/layouts/DefaultGuideLayout'
|
||||
export const meta = {
|
||||
id: 'using-custom-schemas',
|
||||
title: 'Using Custom Schemas',
|
||||
description: 'You need additional steps to use custom database schemas with Serverless APIs.',
|
||||
description: 'You need additional steps to use custom database schemas with data APIs.',
|
||||
}
|
||||
|
||||
By default, your database has a `public` schema which is automatically exposed on Serverless APIs. You can also expose custom database schemas - to do so you need to follow these steps:
|
||||
By default, your database has a `public` schema which is automatically exposed on data APIs. You can also expose custom database schemas - to do so you need to follow these steps:
|
||||
|
||||
1. Go to [API settings](https://supabase.com/dashboard/project/_/settings/api) and add your custom schema to "Exposed schemas".
|
||||
2. Run the following SQL, substituting `myschema` with your schema name:
|
||||
@@ -21,7 +21,7 @@ ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA myschema GRANT ALL ON ROUTI
|
||||
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA myschema GRANT ALL ON SEQUENCES TO anon, authenticated, service_role;
|
||||
```
|
||||
|
||||
Now you can access these schemas from Serverless APIs:
|
||||
Now you can access these schemas from data APIs:
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
|
||||
Reference in new issue
Block a user