diff --git a/apps/reference/docs/guides/database/functions.mdx b/apps/reference/docs/guides/database/functions.mdx index d5d210d4df9..1573aca9f73 100644 --- a/apps/reference/docs/guides/database/functions.mdx +++ b/apps/reference/docs/guides/database/functions.mdx @@ -8,7 +8,7 @@ import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' Postgres has built-in support for [SQL functions](https://www.postgresql.org/docs/current/sql-createfunction.html). -These functions live inside your database, and they can be [used with the API](/docs/reference/javascript/rpc). +These functions live inside your database, and they can be [used with the API](../../reference/javascript/rpc). ## Quick demo @@ -25,7 +25,7 @@ These functions live inside your database, and they can be [used with the API](/ ## Getting started Supabase provides several options for creating database functions. You can use the Dashboard or create them directly using SQL. -We provide a SQL editor within the Dashboard, or you can [connect](/docs/guides/database/connecting/connecting-to-postgres) to your database +We provide a SQL editor within the Dashboard, or you can [connect](../../guides/database/connecting-to-postgres) to your database and run the SQL queries yourself. 1. Go to the "SQL editor" section. @@ -49,7 +49,7 @@ $$; --6
Show/Hide Details - + At it's most basic a function has the following parts: 1. `create or replace function hello_world()`: The function declaration, where `hello_world` is the name of the function. You can use either `create` when creating a new function or `replace` when replacing an existing function. Or you can use `create or replace` together to handle either. @@ -86,7 +86,7 @@ select hello_world(); const { data, error } = await supabase.rpc('hello_world') ``` -Reference: [rpc()](/docs/reference/javascript/rpc) +Reference: [rpc()](../../reference/javascript/rpc) @@ -97,7 +97,7 @@ final res = await supabase .execute(); ``` -Reference: [rpc()](/docs/reference/dart/rpc) +Reference: [rpc()](../../reference/dart/rpc) @@ -105,7 +105,7 @@ Reference: [rpc()](/docs/reference/dart/rpc) ## Returning data sets -Database Functions can also return data sets from [Tables](/docs/guides/database/tables) or Views. +Database Functions can also return data sets from [Tables](../../guides/database/tables) or Views. For example, if we had a database with some Star Wars data inside: @@ -279,10 +279,10 @@ final res = await supabase ### Database Functions vs Edge Functions -For data-intensive operations we recommend using [Database Functions](/docs/guides/database/functions), which are executed within your database -and can be called remotely using the [REST and GraphQL API](/docs/guides/database/api). +For data-intensive operations we recommend using [Database Functions](../../guides/database/functions), which are executed within your database +and can be called remotely using the [REST and GraphQL API](../../guides/database/api). -For use-cases which require low-latency we recommend [Edge Functions](/docs/guides/functions), which are globally-distributed and can be written in Typescript. +For use-cases which require low-latency we recommend [Edge Functions](../../guides/functions), which are globally-distributed and can be written in Typescript. ### Security `definer` vs `invoker` @@ -305,7 +305,7 @@ This limits the potential damage if you allow access to schemas which the user e ## Resources -- Official Client libraries: [JavaScript](/docs/reference/javascript/rpc) and [Dart](/docs/reference/dart/rpc) +- Official Client libraries: [JavaScript](../../reference/javascript/rpc) and [Dart](../../reference/dart/rpc) - Community client libraries: [github.com/supabase-community](https://github.com/supabase-community) - PostgreSQL Official Docs: [Chapter 9. Functions and Operators](https://www.postgresql.org/docs/current/functions.html) - PostgreSQL Reference: [CREATE FUNCTION](https://www.postgresql.org/docs/9.1/sql-createfunction.html) diff --git a/apps/reference/docs/guides/database/tables.mdx b/apps/reference/docs/guides/database/tables.mdx index 34550cc87c3..b597fa6c648 100644 --- a/apps/reference/docs/guides/database/tables.mdx +++ b/apps/reference/docs/guides/database/tables.mdx @@ -30,7 +30,7 @@ When creating a table, it's best practice to add columns at the same time. You must define the "data type" of each column when it is created. You can add and remove columns at any time after creating a table. Supabase provides several options for creating tables. You can use the Dashboard or create them directly using SQL. -We provide a SQL editor within the Dashboard, or you can [connect](/docs/guides/database/connecting/connecting-to-postgres) to your database +We provide a SQL editor within the Dashboard, or you can [connect](../../guides/database/connecting-to-postgres) to your database and run the SQL queries yourself. API Logs`. These show all network requests for the REST and GraphQL [API](/docs/guides/api). +The API Logs can be found under `Database > API Logs`. These show all network requests for the REST and GraphQL [API](../../guides/api). ### Postgres Logs ![Postgres Logs](/img/guides/platform/logs/logs-database.png) -The Postgres Logs can be found under `Database > Postgres Logs`. These show all queries and activity for your [Database](/docs/guides/database). +The Postgres Logs can be found under `Database > Postgres Logs`. These show all queries and activity for your [Database](../../guides/database). ## Log Explorer diff --git a/apps/reference/docs/guides/platform/performance.mdx b/apps/reference/docs/guides/platform/performance.mdx index f5eb883eb81..300d70674cd 100644 --- a/apps/reference/docs/guides/platform/performance.mdx +++ b/apps/reference/docs/guides/platform/performance.mdx @@ -75,4 +75,4 @@ Using the query plan analyzer to optimize your queries is a large topic, with a - [Postgres Wiki.](https://wiki.postgresql.org/wiki/Using_EXPLAIN) - [Enterprise DB.](https://www.enterprisedb.com/blog/postgresql-query-optimization-performance-tuning-with-explain-analyze) -You can pair the information available from `pg_stat_statements` with the detailed system metrics available [via your metrics endpoint](/docs/guides/platform/metrics) to better understand the behavior of your DB and the queries you're executing against it. +You can pair the information available from `pg_stat_statements` with the detailed system metrics available [via your metrics endpoint](../platform/metrics) to better understand the behavior of your DB and the queries you're executing against it. diff --git a/apps/reference/docs/learn/auth-deep-dive/google-oauth.md b/apps/reference/docs/learn/auth-deep-dive/google-oauth.md index cb6915f3e84..1c9ebe775cc 100644 --- a/apps/reference/docs/learn/auth-deep-dive/google-oauth.md +++ b/apps/reference/docs/learn/auth-deep-dive/google-oauth.md @@ -82,9 +82,9 @@ For any support please get in touch at beta at [supabase.com](https://supabase.c ### Next steps -- Watch [Part One: JWTs](/docs/learn/auth-deep-dive/auth-deep-dive-jwts) -- Watch [Part Two: Row Level Security](/docs/learn/auth-deep-dive/auth-row-level-security) -- Watch [Part Three: Policies](/docs/learn/auth-deep-dive/auth-policies) -- Watch [Part Four: GoTrue](/docs/learn/auth-deep-dive/auth-gotrue) - +- Watch [Part One: JWTs](../../learn/auth-deep-dive/auth-deep-dive-jwts) +- Watch [Part Two: Row Level Security](../../learn/auth-deep-dive/auth-row-level-security) +- Watch [Part Three: Policies](../../learn/auth-deep-dive/auth-policies) +- Watch [Part Four: GoTrue](../../learn/auth-deep-dive/auth-gotrue) + - Sign up for Supabase: [app.supabase.com](https://app.supabase.com) diff --git a/apps/reference/docs/learn/auth-deep-dive/gotrue.md b/apps/reference/docs/learn/auth-deep-dive/gotrue.md index da56e1e3559..b29ce3bfe32 100644 --- a/apps/reference/docs/learn/auth-deep-dive/gotrue.md +++ b/apps/reference/docs/learn/auth-deep-dive/gotrue.md @@ -56,7 +56,7 @@ const { user, session, error } = await supabase.auth.signIn({ If you want to request a feature, or contribute to the project directly, just head to https://github.com/supabase/gotrue and open some issues/PRs, we're always open to help. -In the next guide we'll be looking at how to setup external OAuth providers: Watch [Part Five: Google Oauth](/docs/learn/auth-deep-dive/auth-google-oauth) +In the next guide we'll be looking at how to setup external OAuth providers: Watch [Part Five: Google Oauth](../../learn/auth-deep-dive/auth-google-oauth) ### Resources @@ -64,9 +64,9 @@ In the next guide we'll be looking at how to setup external OAuth providers: Wat ### Next steps -- Watch [Part One: JWTs](/docs/learn/auth-deep-dive/auth-deep-dive-jwts) -- Watch [Part Two: Row Level Security](/docs/learn/auth-deep-dive/auth-row-level-security) -- Watch [Part Three: Policies](/docs/learn/auth-deep-dive/auth-policies) - -- Watch [Part Five: Google Oauth](/docs/learn/auth-deep-dive/auth-google-oauth) +- Watch [Part One: JWTs](../../learn/auth-deep-dive/auth-deep-dive-jwts) +- Watch [Part Two: Row Level Security](../../learn/auth-deep-dive/auth-row-level-security) +- Watch [Part Three: Policies](../../learn/auth-deep-dive/auth-policies) + +- Watch [Part Five: Google Oauth](../../learn/auth-deep-dive/auth-google-oauth) - Sign up for Supabase: [app.supabase.com](https://app.supabase.com) diff --git a/apps/reference/docs/learn/auth-deep-dive/jwts.md b/apps/reference/docs/learn/auth-deep-dive/jwts.md index 67c79c572a0..62ffc0fa5ea 100644 --- a/apps/reference/docs/learn/auth-deep-dive/jwts.md +++ b/apps/reference/docs/learn/auth-deep-dive/jwts.md @@ -130,7 +130,7 @@ If we put this token into https://jwt.io, we see it decodes to: This JWT is signed by a `jwt_secret` specific to the developer's Supabase token (you can find this secret alongside this encoded "anon key" on your Dashboard under Settings > API page) and is required to get past the Supabase API gateway and access the developer's project. -The idea with this particular key is that it's safe to put into your client, meaning it's okay if your end users see this key – but _only_ if you first enable Row Level Security, which is the topic of [Part Two](/docs/learn/auth-deep-dive/auth-row-level-security) in this series. +The idea with this particular key is that it's safe to put into your client, meaning it's okay if your end users see this key – but _only_ if you first enable Row Level Security, which is the topic of [Part Two](../../learn/auth-deep-dive/auth-row-level-security) in this series. The second key, `service role key`, should only ever be used on one of your own servers or environments, and should never be shared with end users. You might use this token to do things like make batch inserts of data. @@ -167,7 +167,7 @@ You'll notice that this token is quite a bit longer, since it contains informati } ``` -Now that you understand what JWTs are and where they're used in Supabase, you can explore how to use them in combination with Row Level Security to start restricting access to certain tables, rows, and columns in your Postgres database: [Part Two: Row Level Security](/docs/learn/auth-deep-dive/auth-row-level-security) +Now that you understand what JWTs are and where they're used in Supabase, you can explore how to use them in combination with Row Level Security to start restricting access to certain tables, rows, and columns in your Postgres database: [Part Two: Row Level Security](../../learn/auth-deep-dive/auth-row-level-security) ### Resources @@ -175,10 +175,10 @@ Now that you understand what JWTs are and where they're used in Supabase, you ca ### Next steps - + -- [Part Two: Row Level Security](/docs/learn/auth-deep-dive/auth-row-level-security) -- [Part Three: Policies](/docs/learn/auth-deep-dive/auth-policies) -- [Part Four: GoTrue](/docs/learn/auth-deep-dive/auth-gotrue) -- [Part Five: Google Oauth](/docs/learn/auth-deep-dive/auth-google-oauth) +- [Part Two: Row Level Security](../../learn/auth-deep-dive/auth-row-level-security) +- [Part Three: Policies](../../learn/auth-deep-dive/auth-policies) +- [Part Four: GoTrue](../../learn/auth-deep-dive/auth-gotrue) +- [Part Five: Google Oauth](../../learn/auth-deep-dive/auth-google-oauth) - Sign up for Supabase: [app.supabase.com](https://app.supabase.com) diff --git a/apps/reference/docs/learn/auth-deep-dive/policies.md b/apps/reference/docs/learn/auth-deep-dive/policies.md index e965fae6835..45af47b03f7 100644 --- a/apps/reference/docs/learn/auth-deep-dive/policies.md +++ b/apps/reference/docs/learn/auth-deep-dive/policies.md @@ -80,7 +80,7 @@ For the curious, try heading to the SQL editor and querying: select * from auth.users; ``` -If supabase-js is loaded on your site (in this case http://localhost:3000) then it will automatically pluck the access_token out of the URL and initiate a session. You can check the [session()](/docs/reference/javascript/auth-session) method to see if there is a valid session: +If supabase-js is loaded on your site (in this case http://localhost:3000) then it will automatically pluck the access_token out of the URL and initiate a session. You can check the [session()](../../reference/javascript/auth-session) method to see if there is a valid session: ```jsx console.log(supabase.auth.session()) @@ -161,9 +161,9 @@ You can get as creative as you like with these policies. ### Next steps -- Watch [Part One: JWTs](/docs/learn/auth-deep-dive/auth-deep-dive-jwts) -- Watch [Part Two: Row Level Security](/docs/learn/auth-deep-dive/auth-row-level-security) - -- Watch [Part Four: GoTrue](/docs/learn/auth-deep-dive/auth-gotrue) -- Watch [Part Five: Google Oauth](/docs/learn/auth-deep-dive/auth-google-oauth) +- Watch [Part One: JWTs](../../learn/auth-deep-dive/auth-deep-dive-jwts) +- Watch [Part Two: Row Level Security](../../learn/auth-deep-dive/auth-row-level-security) + +- Watch [Part Four: GoTrue](../../learn/auth-deep-dive/auth-gotrue) +- Watch [Part Five: Google Oauth](../../learn/auth-deep-dive/auth-google-oauth) - Sign up for Supabase: [app.supabase.com](https://app.supabase.com) diff --git a/apps/reference/docs/learn/auth-deep-dive/row-level-security.md b/apps/reference/docs/learn/auth-deep-dive/row-level-security.md index 01e9ffa4f57..2958a5168fd 100644 --- a/apps/reference/docs/learn/auth-deep-dive/row-level-security.md +++ b/apps/reference/docs/learn/auth-deep-dive/row-level-security.md @@ -102,7 +102,7 @@ You should now be able to read from your leaderboard, but will still not be able A quick reminder that you can always use your `service_role` API key to bypass these row level security policies. But be extra careful that you don't leak this key by including it in the client. This can be useful if you're building internal admin tools, or if you need to bulk insert or delete data via the API. -In the next guide we will look at using Policies in combination with User Accounts, so that you can restrict access to data on a User by User basis: Watch [Part Three: Policies](/docs/learn/auth-deep-dive/auth-policies) +In the next guide we will look at using Policies in combination with User Accounts, so that you can restrict access to data on a User by User basis: Watch [Part Three: Policies](../../learn/auth-deep-dive/auth-policies) ### Resources @@ -111,9 +111,9 @@ In the next guide we will look at using Policies in combination with User Accoun ### Next steps -- Watch [Part One: JWTs](/docs/learn/auth-deep-dive/auth-deep-dive-jwts) - -- Watch [Part Three: Policies](/docs/learn/auth-deep-dive/auth-policies) -- Watch [Part Four: GoTrue](/docs/learn/auth-deep-dive/auth-gotrue) -- Watch [Part Five: Google Oauth](/docs/learn/auth-deep-dive/auth-google-oauth) +- Watch [Part One: JWTs](../../learn/auth-deep-dive/auth-deep-dive-jwts) + +- Watch [Part Three: Policies](../../learn/auth-deep-dive/auth-policies) +- Watch [Part Four: GoTrue](../../learn/auth-deep-dive/auth-gotrue) +- Watch [Part Five: Google Oauth](../../learn/auth-deep-dive/auth-google-oauth) - Sign up for Supabase: [app.supabase.com](https://app.supabase.com)