From cb7c67864b2b5deee7fb0498622fc146712fc46b Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Mon, 4 Mar 2024 23:32:46 -0500 Subject: [PATCH] chore: linting rule tweaks and error fixes (#21678) --- .vale.ini | 6 +- apps/docs/content/guides/ai.mdx | 12 ++++ .../content/guides/database/extensions.mdx | 4 +- .../guides/database/extensions/hypopg.mdx | 8 +-- .../database/extensions/pg_jsonschema.mdx | 4 +- .../database/extensions/pg_plan_filter.mdx | 6 +- .../guides/database/extensions/pgaudit.mdx | 22 +++--- .../guides/database/extensions/pgjwt.mdx | 8 +-- .../guides/database/extensions/pgroonga.mdx | 8 +-- .../guides/database/extensions/pgrouting.mdx | 10 +-- .../guides/database/extensions/pgsodium.mdx | 10 +-- .../guides/database/extensions/pgtap.mdx | 6 +- .../guides/database/extensions/plv8.mdx | 4 +- .../guides/database/full-text-search.mdx | 34 ++++++++- .../guides/database/managing-timezones.mdx | 2 +- .../database/postgres/cascade-deletes.mdx | 22 +++--- .../database/postgres/configuration.mdx | 2 +- .../guides/database/postgres/roles.mdx | 8 +-- .../database/postgres/row-level-security.mdx | 6 +- .../guides/database/postgres/triggers.mdx | 2 +- .../guides/database/query-optimization.mdx | 4 +- apps/docs/content/guides/database/vault.mdx | 8 +-- .../content/guides/functions/dart-edge.mdx | 9 ++- .../guides/getting-started/architecture.mdx | 16 ++--- .../guides/getting-started/features.mdx | 4 +- .../tutorials/with-angular.mdx | 2 +- .../tutorials/with-expo-react-native.mdx | 4 ++ .../tutorials/with-ionic-angular.mdx | 2 +- .../getting-started/tutorials/with-kotlin.mdx | 4 +- .../tutorials/with-redwoodjs.mdx | 8 +-- .../getting-started/tutorials/with-refine.mdx | 4 +- .../tutorials/with-sveltekit.mdx | 2 +- apps/docs/content/guides/realtime.mdx | 16 ++--- apps/docs/content/guides/resources.mdx | 2 + .../content/guides/self-hosting/docker.mdx | 6 +- vale/styles/Custom/Acronyms.yml | 5 +- vale/styles/Custom/Capitalize.yml | 11 +++ vale/styles/Custom/Exclamation.yml | 12 ---- vale/styles/Custom/Filler.yml | 12 ++++ vale/styles/Custom/Parens.yml | 3 +- vale/styles/Custom/Will.yml | 7 -- vale/styles/Custom/WordList.yml | 41 ++++++----- .../config/vocabularies/Supabase/accept.txt | 72 +++++++++++++++++-- 43 files changed, 281 insertions(+), 157 deletions(-) create mode 100644 vale/styles/Custom/Capitalize.yml delete mode 100644 vale/styles/Custom/Exclamation.yml create mode 100644 vale/styles/Custom/Filler.yml delete mode 100644 vale/styles/Custom/Will.yml diff --git a/.vale.ini b/.vale.ini index 6b721717743..1ff9438668a 100644 --- a/.vale.ini +++ b/.vale.ini @@ -8,5 +8,7 @@ mdx = md [*] BasedOnStyles = Vale, Custom -BlockIgnores = (?s) *(.*?) -TokenIgnores = (href=".*?") +BlockIgnores = (?s) *(.*?), \ +(?s) *(export\s+const\s+\S+\s*=\s*\[.*?\]), \ +(?s) *() +TokenIgnores = (href\s*([=:])\s*['"].*?\1), \ diff --git a/apps/docs/content/guides/ai.mdx b/apps/docs/content/guides/ai.mdx index 66c7ffbedae..f089f7a57c0 100644 --- a/apps/docs/content/guides/ai.mdx +++ b/apps/docs/content/guides/ai.mdx @@ -20,6 +20,8 @@ The toolkit includes: Check out all of the AI [templates and examples](https://github.com/supabase/supabase/tree/master/examples/ai) in our GitHub repository. +{/* */} +
{examples.map((x) => (
@@ -66,8 +68,12 @@ export const examples = [ }, ] +{/* */} + ## Integrations +{/* */} +
{integrations.map((x) => (
@@ -104,8 +110,12 @@ export const integrations = [ }, ] +{/* */} + ## Case studies +{/* */} +
{[ { @@ -134,3 +144,5 @@ export const integrations = [
))}
+ +{/* */} diff --git a/apps/docs/content/guides/database/extensions.mdx b/apps/docs/content/guides/database/extensions.mdx index 5566a391f6a..d5fb2834e26 100644 --- a/apps/docs/content/guides/database/extensions.mdx +++ b/apps/docs/content/guides/database/extensions.mdx @@ -36,7 +36,7 @@ drop extension pgtap; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension call `drop extension`. @@ -48,7 +48,7 @@ Most extensions are installed under the `extensions` schema, which is accessible If you need to restrict user access to tables managed by extensions, we recommend creating a separate schema for installing that specific extension. -Some extensions can only be created under a specific schema, for eg. `postgis_tiger_geocoder` extension creates a schema named `tiger`. Before enabling such extensions, make sure you have not created a conflicting schema with the same name. +Some extensions can only be created under a specific schema, for example, `postgis_tiger_geocoder` extension creates a schema named `tiger`. Before enabling such extensions, make sure you have not created a conflicting schema with the same name. In addition to the pre-configured extensions, you can also install your own SQL extensions directly in the database using Supabase's SQL editor. The SQL code for the extensions, including plpgsql extensions, can be added through the SQL editor. diff --git a/apps/docs/content/guides/database/extensions/hypopg.mdx b/apps/docs/content/guides/database/extensions/hypopg.mdx index 90c8184bbfe..643c0322352 100644 --- a/apps/docs/content/guides/database/extensions/hypopg.mdx +++ b/apps/docs/content/guides/database/extensions/hypopg.mdx @@ -21,7 +21,7 @@ The motivation for HypoPG is to allow users to quickly search for an index to im 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "hypopg" and enable the extension. +3. Search for `hypopg` and enable the extension. @@ -35,7 +35,7 @@ create extension hypopg with schema extensions; drop extension if exists hypopg; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean. @@ -104,10 +104,10 @@ create index on account(id); - [`hypo_create_index(text)`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#create-a-hypothetical-index): A function to create a hypothetical index. - [`hypopg_list_indexes`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A View that lists all hypothetical indexes that have been created. -- [`hypopg()`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function that lists all hypothetical indexes that have been created with the same format as pg_index. +- [`hypopg()`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function that lists all hypothetical indexes that have been created with the same format as `pg_index`. - [`hypopg_get_index_def(oid)`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function to display the `create index` statement that would create the index. - [`hypopg_get_relation_size(oid)`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function to estimate how large a hypothetical index would be. -- [`hypopg_drop_index(oid)`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function to remove a given hypothetical index by oid. +- [`hypopg_drop_index(oid)`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function to remove a given hypothetical index by `oid`. - [`hypopg_reset()`](https://hypopg.readthedocs.io/en/rel1_stable/usage.html#manipulate-hypothetical-indexes): A function to remove all hypothetical indexes. ## Resources diff --git a/apps/docs/content/guides/database/extensions/pg_jsonschema.mdx b/apps/docs/content/guides/database/extensions/pg_jsonschema.mdx index 9261c0a65f8..2770de88178 100644 --- a/apps/docs/content/guides/database/extensions/pg_jsonschema.mdx +++ b/apps/docs/content/guides/database/extensions/pg_jsonschema.mdx @@ -19,7 +19,7 @@ description: 'Validate json/jsonb with JSON Schema in PostgreSQL.' 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pg_jsonschema" and enable the extension. +3. Search for `pg_jsonschema` and enable the extension. @@ -33,7 +33,7 @@ create extension pg_jsonschema with schema extensions; drop extension if exists pg_jsonschema; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean. diff --git a/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx b/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx index 9bc6095b4d2..4c9cba45291 100644 --- a/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx +++ b/apps/docs/content/guides/database/extensions/pg_plan_filter.mdx @@ -4,7 +4,7 @@ title: 'pg_plan_filter: Restrict Total Cost' description: 'Block queries over a total cost limit' --- -[pg_plan_filter](https://github.com/pgexperts/pg_plan_filter) is PostgreSQL extension to block execution of statements where query planner's estimate of the total cost exceeds a threshold. This is intended to give database administrators a way to restrict the contribution an individual query has on database load. +[`pg_plan_filter`](https://github.com/pgexperts/pg_plan_filter) is PostgreSQL extension to block execution of statements where query planner's estimate of the total cost exceeds a threshold. This is intended to give database administrators a way to restrict the contribution an individual query has on database load. ## Enable the extension @@ -27,7 +27,7 @@ alter database some_db set session_preload_libraries = 'plan_filter'; `plan_filter.statement_cost_limit`: restricts the maximum total cost for executed statements `plan_filter.limit_select_only`: restricts to `select` statements -Note that `limit_select_only = true` is not the same as read-only because `select` statements may modify data e.g. through a function call. +Note that `limit_select_only = true` is not the same as read-only because `select` statements may modify data, for example, through a function call. ## Example @@ -88,4 +88,4 @@ HINT: The plan for your query shows that it would probably have an excessive ru ## Resources -- Official [pg_plan_filter documentation](https://github.com/pgexperts/pg_plan_filter) +- Official [`pg_plan_filter` documentation](https://github.com/pgexperts/pg_plan_filter) diff --git a/apps/docs/content/guides/database/extensions/pgaudit.mdx b/apps/docs/content/guides/database/extensions/pgaudit.mdx index 5229ffb0ee9..65d8717c67e 100644 --- a/apps/docs/content/guides/database/extensions/pgaudit.mdx +++ b/apps/docs/content/guides/database/extensions/pgaudit.mdx @@ -21,7 +21,7 @@ PGAudit grants fine grain control over which statements and objects are emitted 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgaudit" and enable the extension. +3. Search for `pgaudit` and enable the extension. @@ -35,7 +35,7 @@ create extension pgaudit; drop extension if exists pgaudit; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. @@ -45,13 +45,13 @@ To disable an extension you can call `drop extension`. The `pgaudit.log` setting controls which statements to log. Available values include: -- **read**: `SELECT` and `COPY` when the source is a relation or a query. -- **write**: `INSERT`, `UPDATE`, `DELETE`, `TRUNCATE`, and `COPY` when the destination is a relation. -- **function**: Function calls and `DO` blocks. -- **role**: Statements related to roles and privileges: `GRANT`, `REVOKE`, `CREATE/ALTER/DROP ROLE`. -- **ddl**: All `DDL` that is not included in the `ROLE` class. -- **misc**: Miscellaneous commands, e.g. `DISCARD`, `FETCH`, `CHECKPOINT`, `VACUUM`, `SET`. -- **misc_set**: Miscellaneous `SET` commands, e.g. `SET ROLE`. +- `read`: `SELECT` and `COPY` when the source is a relation or a query. +- `write`: `INSERT`, `UPDATE`, `DELETE`, `TRUNCATE`, and `COPY` when the destination is a relation. +- `function`: Function calls and `DO` blocks. +- `role`: Statements related to roles and privileges: `GRANT`, `REVOKE`, `CREATE/ALTER/DROP ROLE`. +- `ddl`: All `DDL` that is not included in the `ROLE` class. +- `misc`: Miscellaneous commands, for example, `DISCARD`, `FETCH`, `CHECKPOINT`, `VACUUM`, `SET`. +- `misc_set`: Miscellaneous `SET` commands, for example, `SET ROLE`. - **all**: Include all of the above. @@ -59,7 +59,7 @@ For a full list of available settings see [settings docs](https://github.com/pga -We don't currently support configuring `pgaudit.log_parameter` because it may log secrets in encrypted columns if you are using [pgsodium](/docs/guides/database/extensions/pgsodium) or [Vault](/docs/guides/database/vault). +We don't currently support configuring `pgaudit.log_parameter` because it may log secrets in encrypted columns if you are using [`pgsodium`](/docs/guides/database/extensions/pgsodium) or [Vault](/docs/guides/database/vault). You can upvote this [feature request](https://github.com/orgs/supabase/discussions/20183) if you'd like this restriction lifted. @@ -67,7 +67,7 @@ You can upvote this [feature request](https://github.com/orgs/supabase/discussio ## Example -Given a pgaudit setting +Given a `pgaudit` setting {/* prettier-ignore */} ```sql diff --git a/apps/docs/content/guides/database/extensions/pgjwt.mdx b/apps/docs/content/guides/database/extensions/pgjwt.mdx index 3b4fcc23aca..7d8c71069d1 100644 --- a/apps/docs/content/guides/database/extensions/pgjwt.mdx +++ b/apps/docs/content/guides/database/extensions/pgjwt.mdx @@ -4,7 +4,7 @@ title: 'pgjwt: JSON Web Tokens' description: 'Encode and decode JWTs in PostgreSQL' --- -The [pgjwt](https://github.com/michelp/pgjwt) (PostgreSQL JSON Web Token) extension allows you to create and parse [JSON Web Tokens (JWTs)](https://en.wikipedia.org/wiki/JSON_Web_Token) within a PostgreSQL database. JWTs are commonly used for authentication and authorization in web applications and services. +The [`pgjwt`](https://github.com/michelp/pgjwt) (PostgreSQL JSON Web Token) extension allows you to create and parse [JSON Web Tokens (JWTs)](https://en.wikipedia.org/wiki/JSON_Web_Token) within a PostgreSQL database. JWTs are commonly used for authentication and authorization in web applications and services. ## Enable the extension @@ -19,7 +19,7 @@ The [pgjwt](https://github.com/michelp/pgjwt) (PostgreSQL JSON Web Token) extens 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgjwt" and enable the extension. +3. Search for `pgjwt` and enable the extension. @@ -33,7 +33,7 @@ create extension pgjwt schema extensions; drop extension if exists pgjwt; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean. @@ -67,7 +67,7 @@ select ); ``` -The pgjwt_encode function returns a string that represents the JWT, which can then be safely transmitted between parties. +The `pgjwt_encode` function returns a string that represents the JWT, which can then be safely transmitted between parties. {/* prettier-ignore */} ``` diff --git a/apps/docs/content/guides/database/extensions/pgroonga.mdx b/apps/docs/content/guides/database/extensions/pgroonga.mdx index dbdbbe423b5..e3728d85ed2 100644 --- a/apps/docs/content/guides/database/extensions/pgroonga.mdx +++ b/apps/docs/content/guides/database/extensions/pgroonga.mdx @@ -20,7 +20,7 @@ tocVideo: 'Mmmv9g_MiBA' 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgroonga" and enable the extension. +3. Search for `pgroonga` and enable the extension. @@ -34,7 +34,7 @@ create extension pgroonga with schema extensions; drop extension if exists pgroonga; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. @@ -92,7 +92,7 @@ Index Scan using ix_memos_content on memos (cost=0.00..1.11 rows=1 width=36) (2 rows) ``` -The pgroonga index is used to retrieve the result set: +The `pgroonga` index is used to retrieve the result set: ```markdown | id | content | @@ -102,7 +102,7 @@ The pgroonga index is used to retrieve the result set: ## Full text search -The `&@~` operator performs full text search. It returns any matching results. Unlike `LIKE` operator, pgroonga can search any text that contains the keyword case insensitive. +The `&@~` operator performs full text search. It returns any matching results. Unlike `LIKE` operator, `pgroonga` can search any text that contains the keyword case insensitive. Take the following example: diff --git a/apps/docs/content/guides/database/extensions/pgrouting.mdx b/apps/docs/content/guides/database/extensions/pgrouting.mdx index c257613decc..083b19df884 100644 --- a/apps/docs/content/guides/database/extensions/pgrouting.mdx +++ b/apps/docs/content/guides/database/extensions/pgrouting.mdx @@ -4,7 +4,7 @@ title: 'pgrouting: Geospatial Routing' description: 'Extends PostGIS with Geospatial Routing' --- -[pgRouting](http://pgrouting.org) is PostgreSQL and [PostGIS](http://postgis.net) extension adding geospatial routing functionality. +[`pgRouting`](http://pgrouting.org) is PostgreSQL and [PostGIS](http://postgis.net) extension adding geospatial routing functionality. The core functionality of `pgRouting` is a set of path finding algorithms including: @@ -33,7 +33,7 @@ The core functionality of `pgRouting` is a set of path finding algorithms includ 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgrouting" and enable the extension. +3. Search for `pgrouting` and enable the extension. @@ -47,7 +47,7 @@ create extension pgrouting cascade; drop extension if exists pgRouting; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. @@ -55,9 +55,9 @@ To disable an extension you can call `drop extension`. ## Example -As an example, we'll solve the [traveling salesman problem](https://en.wikipedia.org/wiki/Travelling_salesman_problem) using the pgRouting's `pgr_TSPeuclidean` function from some PostGIS coordinates. +As an example, we'll solve the [traveling salesperson problem](https://en.wikipedia.org/wiki/Travelling_salesman_problem) using the `pgRouting`'s `pgr_TSPeuclidean` function from some PostGIS coordinates. -A summary of the traveling salesman problem is, given a set of city coordinates, solve for a path that goes through each city and minimizes the total distance traveled. +A summary of the traveling salesperson problem is, given a set of city coordinates, solve for a path that goes through each city and minimizes the total distance traveled. First we populate a table with some X, Y coordinates diff --git a/apps/docs/content/guides/database/extensions/pgsodium.mdx b/apps/docs/content/guides/database/extensions/pgsodium.mdx index 4c68884799d..8c139f9ef80 100644 --- a/apps/docs/content/guides/database/extensions/pgsodium.mdx +++ b/apps/docs/content/guides/database/extensions/pgsodium.mdx @@ -4,13 +4,13 @@ title: 'pgsodium: Encryption Features' description: 'Encryption library for PostgreSQL' --- -[pgsodium](https://github.com/michelp/pgsodium) is a PostgreSQL extension which provides SQL access to [libsodium's](https://doc.libsodium.org/) high-level cryptographic algorithms. +[`pgsodium`](https://github.com/michelp/pgsodium) is a PostgreSQL extension which provides SQL access to [`libsodium`'s](https://doc.libsodium.org/) high-level cryptographic algorithms. -libsodium is a modern, easy-to-use software library for encryption, decryption, signatures, password hashing, and more. It is a portable, cross-compilable, installable, and packageable fork of the [NaCl](http://nacl.cr.yp.to/) library, with a compatible but extended API to improve usability even further. +`libsodium` is a modern, easy-to-use software library for encryption, decryption, signatures, password hashing, and more. It is a portable, cross-compilable, installable, and packageable fork of the [NaCl](http://nacl.cr.yp.to/) library, with a compatible but extended API to improve usability even further. The design choices emphasize security and ease of use. But despite the emphasis on high security, primitives are faster across-the-board than most implementations. -pgsodium exposes the following libsodium APIs to SQL: +`pgsodium` exposes the following `libsodium` APIs to SQL: - [Generating Random Data](https://github.com/michelp/pgsodium/#generating-random-data) - [Secret key cryptography](https://github.com/michelp/pgsodium/#secret-key-cryptography) @@ -53,7 +53,7 @@ Note that Supabase projects are already encrypted at rest by default. ## Get the root encryption key for your Supabase project -Encryption requires keys. Keeping the keys in the same database as the encrypted data would be unsafe. For more information about managing the pgsodium root encryption key on your Supabase project see **[encryption key location](/docs/guides/database/vault#encryption-key-location)**. This key is required to decrypt values stored in [Supabase Vault](/docs/guides/database/vault) and data encrypted with Transparent Column Encryption. +Encryption requires keys. Keeping the keys in the same database as the encrypted data would be unsafe. For more information about managing the `pgsodium` root encryption key on your Supabase project see **[encryption key location](/docs/guides/database/vault#encryption-key-location)**. This key is required to decrypt values stored in [Supabase Vault](/docs/guides/database/vault) and data encrypted with Transparent Column Encryption. ## Enable the extension @@ -68,7 +68,7 @@ Encryption requires keys. Keeping the keys in the same database as the encrypted 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgsodium" and enable the extension. +3. Search for `pgsodium` and enable the extension. diff --git a/apps/docs/content/guides/database/extensions/pgtap.mdx b/apps/docs/content/guides/database/extensions/pgtap.mdx index 8b00e4c1bbb..bbcd7c3b125 100644 --- a/apps/docs/content/guides/database/extensions/pgtap.mdx +++ b/apps/docs/content/guides/database/extensions/pgtap.mdx @@ -26,7 +26,7 @@ Let's cover some basic concepts: 1. Go to the [Database](https://supabase.com/dashboard/project/_/database/tables) page in the Dashboard. 2. Click on **Extensions** in the sidebar. -3. Search for "pgtap" and enable the extension. +3. Search for `pgtap` and enable the extension. @@ -39,7 +39,7 @@ create extension pgtap with schema extensions; drop extension if exists pgtap; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension you can call `drop extension`. It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean. @@ -149,7 +149,7 @@ rollback; API: - [`function_returns()`](https://pgtap.org/documentation.html#function_returns): Tests that a particular function returns a particular data type -- [`is_definer()`](https://pgtap.org/documentation.html#is_definer): Tests that a function is a security definer (i.e., a “setuid” function). +- [`is_definer()`](https://pgtap.org/documentation.html#is_definer): Tests that a function is a security definer (that is, a `setuid` function). ## Resources diff --git a/apps/docs/content/guides/database/extensions/plv8.mdx b/apps/docs/content/guides/database/extensions/plv8.mdx index 30ac72e01da..a27592d1270 100644 --- a/apps/docs/content/guides/database/extensions/plv8.mdx +++ b/apps/docs/content/guides/database/extensions/plv8.mdx @@ -8,7 +8,7 @@ The `plv8` extension allows you use JavaScript within Postgres. ## Overview -While Postgres natively runs SQL, it can also run other "procedural languages". +While Postgres natively runs SQL, it can also run other procedural languages. `plv8` allows you to run JavaScript code - specifically any code that runs on the [V8 JavaScript engine](https://v8.dev). It can be used for database functions, triggers, queries and more. @@ -39,7 +39,7 @@ create extension plv8; drop extension if exists plv8; ``` -Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension". +Even though the SQL code is `create extension`, this is the equivalent of enabling the extension. To disable an extension, call `drop extension`. Procedural languages are automatically installed within `pg_catalog`, so you don't need to specify a schema. diff --git a/apps/docs/content/guides/database/full-text-search.mdx b/apps/docs/content/guides/database/full-text-search.mdx index c8511c962ab..fde0c4b5b60 100644 --- a/apps/docs/content/guides/database/full-text-search.mdx +++ b/apps/docs/content/guides/database/full-text-search.mdx @@ -30,6 +30,8 @@ For this guide we'll use the following example data: > +{/* */} + | id | title | author | description | | --- | ----------------------------------- | ---------------------- | ------------------------------------------------------------------ | | 1 | The Poky Little Puppy | Janette Sebring Lowrey | Puppy is slower than other, bigger animals. | @@ -38,6 +40,8 @@ For this guide we'll use the following example data: | 4 | Green Eggs and Ham | Dr. Seuss | Sam has changing food preferences and eats unusually colored food. | | 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | Fourth year of school starts, big drama ensues. | +{/* */} + @@ -80,7 +84,7 @@ The functions we'll cover in this guide are: ### `to_tsvector()` [#to-tsvector] -Converts your data into searchable "tokens". `to_tsvector()` stands for "to text search vector". For example: +Converts your data into searchable tokens. `to_tsvector()` stands for "to text search vector." For example: ```sql select to_tsvector('green eggs and ham'); @@ -91,10 +95,10 @@ Collectively these tokens are called a "document" which Postgres can use for com ### `to_tsquery()` [#to-tsquery] -Converts a query string into "tokens" to match. `to_tsquery()` stands for "to text search query". +Converts a query string into tokens to match. `to_tsquery()` stands for "to text search query." This conversion step is important because we will want to "fuzzy match" on keywords. -For example if a user searches for "eggs", and a column has the value "egg", we probably still want to return a match. +For example if a user searches for `eggs`, and a column has the value `egg`, we probably still want to return a match. ### Match: `@@` [#match] @@ -253,11 +257,15 @@ val data = supabase.from("books").select { +{/* */} + | id | title | author | description | | --- | ----------------------------------- | ----------------- | ----------------------------------------------- | | 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | | 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | Fourth year of school starts, big drama ensues. | +{/* */} + @@ -338,11 +346,15 @@ val data = supabase.from("books").select { +{/* */} + | id | title | author | description | | --- | --------------------- | ---------------------- | ------------------------------------------- | | 1 | The Poky Little Puppy | Janette Sebring Lowrey | Puppy is slower than other, bigger animals. | | 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | +{/* */} + @@ -403,10 +415,14 @@ val data = supabase.from("books").select { +{/* */} + | id | title | author | description | | --- | ------ | ----------------- | -------------------------------- | | 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | +{/* */} + @@ -467,11 +483,15 @@ val data = supabase.from("books").select { +{/* */} + | id | title | author | description | | --- | --------------------- | ---------------------- | ------------------------------------------- | | 1 | The Poky Little Puppy | Janette Sebring Lowrey | Puppy is slower than other, bigger animals. | | 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | +{/* */} + @@ -514,6 +534,8 @@ from books; +{/* */} + | id | fts | | --- | --------------------------------------------------------------------------------------------------------------- | | 1 | 'anim':7 'bigger':6 'littl':10 'poki':9 'puppi':1,11 'slower':3 | @@ -522,6 +544,8 @@ from books; | 4 | 'chang':3 'color':9 'eat':7 'egg':12 'food':4,10 'green':11 'ham':14 'prefer':5 'sam':1 'unus':8 | | 5 | 'big':6 'drama':7 'ensu':8 'fire':15 'fourth':1 'goblet':13 'harri':9 'potter':10 'school':4 'start':5 'year':2 | +{/* */} + @@ -578,10 +602,14 @@ val data = supabase.from("books").select { +{/* */} + | id | title | author | description | fts | | --- | ------ | ----------------- | -------------------------------- | ------------------------------------------------------- | | 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | 'big':5 'dream':6 'littl':1 'tootl':7 'toy':2 'train':3 | +{/* */} + diff --git a/apps/docs/content/guides/database/managing-timezones.mdx b/apps/docs/content/guides/database/managing-timezones.mdx index 2b3ab247ae6..d74a40bf348 100644 --- a/apps/docs/content/guides/database/managing-timezones.mdx +++ b/apps/docs/content/guides/database/managing-timezones.mdx @@ -6,7 +6,7 @@ description: 'How to change your database timezone.' --- Every Supabase database is set to UTC timezone by default. We strongly recommend keeping it this way, even if your users are in a different location. -This is because it makes it much easier to calculate differences between timezones if you adopt the mental model that "everything in my database is in UTC time". +This is because it makes it much easier to calculate differences between timezones if you adopt the mental model that "everything in my database is in UTC time." ### Change timezone diff --git a/apps/docs/content/guides/database/postgres/cascade-deletes.mdx b/apps/docs/content/guides/database/postgres/cascade-deletes.mdx index 8f3b223a120..cad764f94dd 100644 --- a/apps/docs/content/guides/database/postgres/cascade-deletes.mdx +++ b/apps/docs/content/guides/database/postgres/cascade-deletes.mdx @@ -6,10 +6,10 @@ footerHelpType: 'postgres' There are 5 options for foreign key constraint deletes: -1. **CASCADE:** When a row is deleted from the parent table, all related rows in the child table(s) are deleted as well. -2. **RESTRICT:** When a row is deleted from the parent table, the delete operation is aborted if there are any related rows in the child table(s). -3. **SET NULL:** When a row is deleted from the parent table, the values of the foreign key columns in the child table(s) are set to NULL. -4. **SET DEFAULT:** When a row is deleted from the parent table, the values of the foreign key columns in the child table(s) are set to their default values. +1. **CASCADE:** When a row is deleted from the parent table, all related rows in the child tables are deleted as well. +2. **RESTRICT:** When a row is deleted from the parent table, the delete operation is aborted if there are any related rows in the child tables. +3. **SET NULL:** When a row is deleted from the parent table, the values of the foreign key columns in the child tables are set to NULL. +4. **SET DEFAULT:** When a row is deleted from the parent table, the values of the foreign key columns in the child tables are set to their default values. 5. **NO ACTION:** This option is similar to RESTRICT, but it also has the option to be “deferred” to the end of a transaction. This means that other cascading deletes can run first, and then this delete constraint will only throw an error if there is referenced data remaining _at the end of the transaction_. These options can be specified when defining a foreign key constraint using the "ON DELETE" clause. For example, the following SQL statement creates a foreign key constraint with the `CASCADE` option: @@ -20,7 +20,7 @@ add constraint fk_parent foreign key (parent_id) references parent_table (id) on delete cascade; ``` -This means that when a row is deleted from the "parent_table", all related rows in the "child_table" will be deleted as well. +This means that when a row is deleted from the `parent_table`, all related rows in the `child_table` will be deleted as well. ## `RESTRICT` vs `NO ACTION` @@ -28,11 +28,11 @@ The difference between `NO ACTION` and `RESTRICT` is subtle and can be a bit con Both `NO ACTION` and `RESTRICT` are used to prevent deletion of a row in a parent table if there are related rows in a child table. However, there is a subtle difference in how they behave. -When a foreign key constraint is defined with the option `RESTRICT`, it means that if a row in the parent table is deleted, the database will immediately raise an error and prevent the deletion of the row in the parent table. The database will not delete, update or set to NULL any rows in the referenced table(s). +When a foreign key constraint is defined with the option `RESTRICT`, it means that if a row in the parent table is deleted, the database will immediately raise an error and prevent the deletion of the row in the parent table. The database will not delete, update or set to NULL any rows in the referenced tables. When a foreign key constraint is defined with the option `NO ACTION`, it means that if a row in the parent table is deleted, the database will also raise an error and prevent the deletion of the row in the parent table. However unlike `RESTRICT`, `NO ACTION` has the option defer the check using `INITIALLY DEFERRED`. This will only raise the above error _if_ the referenced rows still exist at the end of the transaction. -The difference from `RESTRICT` is that a constraint marked as `NO ACTION INITIALLY DEFERRED` is deferred until the end of the transaction, rather than running immediately. If, for example there is another foreign key constraint between the same tables marked as `CASCADE`, the cascade will occur first and delete the referenced rows, and no error will be thrown by the deferred constraint. Otherwise if there are still rows referencing the parent row by the end of the transaction, an error will be raised just like before. Just like `RESTRICT`, the database will not delete, update or set to NULL any rows in the referenced table(s). +The difference from `RESTRICT` is that a constraint marked as `NO ACTION INITIALLY DEFERRED` is deferred until the end of the transaction, rather than running immediately. If, for example there is another foreign key constraint between the same tables marked as `CASCADE`, the cascade will occur first and delete the referenced rows, and no error will be thrown by the deferred constraint. Otherwise if there are still rows referencing the parent row by the end of the transaction, an error will be raised just like before. Just like `RESTRICT`, the database will not delete, update or set to NULL any rows in the referenced tables. In practice, you can use either `NO ACTION` or `RESTRICT` depending on your needs. `NO ACTION` is the default behavior if you do not specify anything. If you prefer to defer the check until the end of the transaction, use `NO ACTION INITIALLY DEFERRED`. @@ -48,10 +48,10 @@ Let's further illustrate the difference with an example. We'll use the following `parent` -| id | name | parent_id | -| --- | ------- | --------- | -| 1 | Charles | 1 | -| 2 | Diana | 1 | +| id | name | `parent_id` | +| --- | ------- | ----------- | +| 1 | Charles | 1 | +| 2 | Diana | 1 | `child` diff --git a/apps/docs/content/guides/database/postgres/configuration.mdx b/apps/docs/content/guides/database/postgres/configuration.mdx index f9177a0a251..087176ba1d2 100644 --- a/apps/docs/content/guides/database/postgres/configuration.mdx +++ b/apps/docs/content/guides/database/postgres/configuration.mdx @@ -36,7 +36,7 @@ This data can further be used in conjunction with the [`explain`](https://www.po ## Managing timezones Every Supabase database is set to UTC timezone by default. We strongly recommend keeping it this way, even if your users are in a different location. -This is because it makes it much easier to calculate differences between timezones if you adopt the mental model that "everything in my database is in UTC time". +This is because it makes it much easier to calculate differences between timezones if you adopt the mental model that "everything in my database is in UTC time." ### Change timezone diff --git a/apps/docs/content/guides/database/postgres/roles.mdx b/apps/docs/content/guides/database/postgres/roles.mdx index 257d777cd2d..bacad005667 100644 --- a/apps/docs/content/guides/database/postgres/roles.mdx +++ b/apps/docs/content/guides/database/postgres/roles.mdx @@ -38,11 +38,11 @@ Your Postgres database is the core of your Supabase project, so it's important t ### Special symbols in passwords -If you use special symbols in your postgres password, you must remember to [percent-encode](https://en.wikipedia.org/wiki/Percent-encoding) your password later if using the postgres connection string e.g. `postgresql://postgres.projectref:p%3Dword@aws-0-us-east-1.pooler.supabase.com:6543/postgres` +If you use special symbols in your postgres password, you must remember to [percent-encode](https://en.wikipedia.org/wiki/Percent-encoding) your password later if using the postgres connection string, for example, `postgresql://postgres.projectref:p%3Dword@aws-0-us-east-1.pooler.supabase.com:6543/postgres` ### Changing your project password -When you created your project you were also asked to enter a password. This is actually the password for the `postgres` role in your database. You can update this from the Dashboard under the [database settings](https://supabase.com/dashboard/project/_/settings/database) page. You should _never_ give this to 3rd-party service unless you absolutely trust them. Instead, we recommend that you create a new user for every service that you want to give access too. This will also help you with debugging - you can see every query that each role is executing in your database within `pg_stat_statements`. +When you created your project you were also asked to enter a password. This is actually the password for the `postgres` role in your database. You can update this from the Dashboard under the [database settings](https://supabase.com/dashboard/project/_/settings/database) page. You should _never_ give this to third-party service unless you absolutely trust them. Instead, we recommend that you create a new user for every service that you want to give access too. This will also help you with debugging - you can see every query that each role is executing in your database within `pg_stat_statements`. ## Granting permissions @@ -86,7 +86,7 @@ The default Postgres role. This has admin privileges. ### `anon` -For "anonymous access". This is the role which the API (PostgREST) will use when a user _is not_ logged in. +For "anonymous access." This is the role which the API (PostgREST) will use when a user _is not_ logged in. ### `authenticator` @@ -95,7 +95,7 @@ A special role for the API (PostgREST). It has very limited access, and is used ### `authenticated` -For "authenticated access". This is the role which the API (PostgREST) will use when a user _is_ logged in. +For "authenticated access." This is the role which the API (PostgREST) will use when a user _is_ logged in. ### `service_role` diff --git a/apps/docs/content/guides/database/postgres/row-level-security.mdx b/apps/docs/content/guides/database/postgres/row-level-security.mdx index 286391079de..6d7450c3407 100644 --- a/apps/docs/content/guides/database/postgres/row-level-security.mdx +++ b/apps/docs/content/guides/database/postgres/row-level-security.mdx @@ -11,7 +11,7 @@ When you need granular authorization rules, nothing beats Postgres's [Row Level RLS is incredibly powerful and flexible, allowing you to write complex SQL rules that fit your unique business needs. RLS can be [combined with Supabase Auth](/docs/guides/auth/row-level-security) for end-to-end user security from the browser to the database. -RLS is a Postgres primitive and can provide "[defense in depth]()" to protect your data from malicious actors even when accessed through 3rd party tooling. +RLS is a Postgres primitive and can provide "[defense in depth]()" to protect your data from malicious actors even when accessed through third-party tooling. ## Policies @@ -219,7 +219,7 @@ to authenticated using ( (select auth.uid()) = user_id ); ``` -This method works well for JWT functions like `auth.uid()` and `auth.jwt()` as well as `security definer` Functions. Wrapping the function causes an initPlan to be run by the Postgres optimizer, which allows it to "cache" the results per-statement, rather than calling the function on each row. +This method works well for JWT functions like `auth.uid()` and `auth.jwt()` as well as `security definer` Functions. Wrapping the function causes an `initPlan` to be run by the Postgres optimizer, which allows it to "cache" the results per-statement, rather than calling the function on each row. @@ -239,7 +239,7 @@ You can only use this technique if the results of the query or function do not c ### Add filters to every query -Policies are "implicit where clauses", so it's common to run `select` statements without any filters. This is a bad pattern for performance. Instead of doing this (JS client example): +Policies are "implicit where clauses," so it's common to run `select` statements without any filters. This is a bad pattern for performance. Instead of doing this (JS client example): {/* prettier-ignore */} ```js diff --git a/apps/docs/content/guides/database/postgres/triggers.mdx b/apps/docs/content/guides/database/postgres/triggers.mdx index 21db2217f59..e405dfff549 100644 --- a/apps/docs/content/guides/database/postgres/triggers.mdx +++ b/apps/docs/content/guides/database/postgres/triggers.mdx @@ -99,7 +99,7 @@ execute function after_delete_function(); There are two options available for executing triggers: - `for each row`: specifies that the trigger function should be executed once for each affected row. -- `for each statement`: the trigger is executed once for the entire operation (eg, once on insert). This can be more efficient than `for each row` when dealing with multiple rows affected by a single SQL statement, as they allow you to perform calculations or updates on groups of rows at once. +- `for each statement`: the trigger is executed once for the entire operation (for example, once on insert). This can be more efficient than `for each row` when dealing with multiple rows affected by a single SQL statement, as they allow you to perform calculations or updates on groups of rows at once. ## Dropping a trigger diff --git a/apps/docs/content/guides/database/query-optimization.mdx b/apps/docs/content/guides/database/query-optimization.mdx index 7602ae4603e..bf3c2f169b3 100644 --- a/apps/docs/content/guides/database/query-optimization.mdx +++ b/apps/docs/content/guides/database/query-optimization.mdx @@ -14,7 +14,7 @@ This guide is intended to: This is not a comprehensive resource, but rather a helpful starting point for your optimization journey. -If you're new to query optimization, you may be interested in [index_advisor](/docs/guides/database/extensions/index_advisor), our tool for automatically detecting indexes that improve performance on a given query. +If you're new to query optimization, you may be interested in [`index_advisor`](/docs/guides/database/extensions/index_advisor), our tool for automatically detecting indexes that improve performance on a given query. ## Example query @@ -66,7 +66,7 @@ create index idx_orders_customer_id on orders (customer_id); Sorting can also be optimized by indexing: -- An index on `b.date_of_purchase` wcan improve the sorting process, and is particularly beneficial when a subset of rows is being returned with a `limit` clause. +- An index on `b.date_of_purchase` can improve the sorting process, and is particularly beneficial when a subset of rows is being returned with a `limit` clause. ```sql create index idx_orders_date_of_purchase on orders (date_of_purchase); diff --git a/apps/docs/content/guides/database/vault.mdx b/apps/docs/content/guides/database/vault.mdx index a16f814633d..12aa4cc193b 100644 --- a/apps/docs/content/guides/database/vault.mdx +++ b/apps/docs/content/guides/database/vault.mdx @@ -79,7 +79,7 @@ updated_at | 2022-12-14 02:34:23.85159+00 -Alternatively, you can create a secret by `insert`ing data into the `vault.secret` table: +Alternatively, you can create a secret by inserting data into the `vault.secret` table: {/* prettier-ignore */} ```sql @@ -206,11 +206,11 @@ updated_at | 2022-12-14 02:51:13.938396+00 >
-As we mentioned, the Vault uses pgsodium's Transparent Column Encryption (TCE) to store secrets in an authenticated encrypted form. There are some details around that you may be curious about, what does authenticated mean, and where are encryption keys store? This section explains those details. +As we mentioned, the Vault uses `pgsodium`'s Transparent Column Encryption (TCE) to store secrets in an authenticated encrypted form. There are some details around that you may be curious about, what does authenticated mean, and where are encryption keys store? This section explains those details. ### Authenticated encryption with associated data -The first important feature of TCE is that it uses an [Authenticated Encryption with Associated Data]() encryption algorithm (based on libsodium). +The first important feature of TCE is that it uses an [Authenticated Encryption with Associated Data]() encryption algorithm (based on `libsodium`). ### Encryption key location @@ -218,7 +218,7 @@ The first important feature of TCE is that it uses an [Authenticated Encryption **Associated Data** means that you can include any other columns from the same row as part of the signature computation. This doesn't encrypt those other columns - rather it ensures that your encrypted value is only associated with columns from that row. If an attacker were to copy an encrypted value from another row to the current one, the signature would be rejected (assuming you used a unique column in the associated data). -Another important feature of pgsodium is that the encryption keys are never stored in the database alongside the encrypted data. Instead, only a **Key ID** is stored, which is a reference to the key that is only accessible outside of SQL. Even if an attacker can capture a dump of your entire database, they will see only encrypted data and key IDs, _never the raw key itself_. +Another important feature of `pgsodium` is that the encryption keys are never stored in the database alongside the encrypted data. Instead, only a **Key ID** is stored, which is a reference to the key that is only accessible outside of SQL. Even if an attacker can capture a dump of your entire database, they will see only encrypted data and key IDs, _never the raw key itself_. This is an important safety precaution - there is little value in storing the encryption key in the database itself as this would be like locking your front door but leaving the key in the lock! Storing the key outside the database fixes this issue. diff --git a/apps/docs/content/guides/functions/dart-edge.mdx b/apps/docs/content/guides/functions/dart-edge.mdx index 98b45295dfe..7c50737ddd5 100644 --- a/apps/docs/content/guides/functions/dart-edge.mdx +++ b/apps/docs/content/guides/functions/dart-edge.mdx @@ -13,7 +13,7 @@ Dart Edge is an experimental project - it's probably not ready for production us -## Pre requirements +## Prerequisites Make sure you have [the edge CLI](https://docs.dartedge.dev/#getting-started) installed in addition to [the Supabase CLI](https://supabase.com/docs/guides/cli#installation). @@ -74,7 +74,7 @@ Now let’s try to interact with our Supabase database. We will start by install ### Add dependencies -Add [supabase](https://pub.dev/packages/supabase) to interact with Supabase service. +Add [`supabase`](https://pub.dev/packages/supabase) to interact with Supabase service. ```bash dart pub add supabase @@ -125,14 +125,13 @@ supabase: project_path: './supabase' ``` -Also, currently Dart Edge doesn't work with the latest versions of Flutter. If you do have the latest version of Flutter on your machine, you can use [FVM](https://fvm.app/) to use an older version of Flutter for your Dart Edge project. +Also, currently Dart Edge doesn't work with the latest versions of Flutter. If you do have the latest version of Flutter on your machine, you can use [Flutter Version Management (FVM)](https://fvm.app/) to use an older version of Flutter for your Dart Edge project. ```bash fvm use 3.7.12 -f ``` -You can read more about how to configure FVM (Flutter -Version Management) for your project in the [FVM documentation](https://fvm.app/documentation/getting-started). +You can read more about how to configure FVM for your project in the [FVM documentation](https://fvm.app/documentation/getting-started). Run the following command to compile your Dart code. This command will start a watcher that will recompile anytime you make changes to your code. diff --git a/apps/docs/content/guides/getting-started/architecture.mdx b/apps/docs/content/guides/getting-started/architecture.mdx index 9e3bd8f92f0..943f13b702d 100644 --- a/apps/docs/content/guides/getting-started/architecture.mdx +++ b/apps/docs/content/guides/getting-started/architecture.mdx @@ -29,7 +29,7 @@ Each Supabase project consists of several tools: ### PostgreSQL (database) -PostgreSQL is the core of Supabase. We do not abstract the PostgreSQL database — you can access it and use it with full privileges. We simply provide tools which makes PostgreSQL as easy to use as Firebase. +PostgreSQL is the core of Supabase. We do not abstract the PostgreSQL database—you can access it and use it with full privileges. We simply provide tools which makes PostgreSQL as easy to use as Firebase. - Official Docs: [postgresql.org/docs](https://www.postgresql.org/docs/current/index.html) - Source code: [github.com/postgres/postgres](https://github.com/postgres/postgres) (mirror) @@ -57,7 +57,7 @@ A JWT-based API for managing users and issuing access tokens. This integrates wi ### PostgREST (API) A standalone web server that turns your PostgreSQL database directly into a RESTful API. -We use this with our [pg_graphql](https://github.com/supabase/pg_graphql) extension to provide a GraphQL API. +We use this with our [`pg_graphql`](https://github.com/supabase/pg_graphql) extension to provide a GraphQL API. - Official Docs: [postgrest.org](https://postgrest.org/) - Source code: [github.com/PostgREST/postgrest](https://github.com/PostgREST/postgrest) @@ -86,8 +86,8 @@ An S3-compatible object storage service that stores metadata in Postgres. A modern runtime for JavaScript and TypeScript. -- Official Docs: [deno.land](https://deno.land/) -- Source code: [github.com/denoland/deno](https://github.com/denoland/deno) +- Official Docs: [Deno documentation](https://deno.land/) +- Source code: [Deno source code](https://github.com/denoland/deno) - License: [MIT](https://github.com/denoland/deno/blob/main/LICENSE.md) - Language: TypeScript / Rust @@ -104,14 +104,14 @@ A RESTful API for managing your Postgres. Fetch tables, add roles, and run queri A cloud-native, multi-tenant Postgres connection pooler. -- Official Docs: [Supavisor Github Pages](https://supabase.github.io/supavisor/) -- Source code: [supabase/supavisor](https://github.com/supabase/supavisor) +- Official Docs: [Supavisor GitHub Pages](https://supabase.github.io/supavisor/) +- Source code: [`supabase/supavisor`](https://github.com/supabase/supavisor) - License: [Apache 2.0](https://github.com/supabase/supavisor/blob/main/LICENSE) - Language: Elixir ### Kong (API gateway) -A cloud-native API gateway, built on top of Nginx. +A cloud-native API gateway, built on top of NGINX. - Official Docs: [docs.konghq.com](https://docs.konghq.com/) - Source code: [github.com/kong/kong](https://github.com/kong/kong) @@ -144,7 +144,7 @@ Less, but better. ### Everything is portable To avoid lock-in, we make it easy to migrate in and out. Our cloud offering is compatible with our self-hosted product. -We use existing standards to increase portability (like pg_dump and CSV files). If a new standard emerges which competes with a "Supabase" approach, we will deprecate the approach in favor of the standard. +We use existing standards to increase portability (like `pg_dump` and CSV files). If a new standard emerges which competes with a "Supabase" approach, we will deprecate the approach in favor of the standard. This forces us compete on experience. We aim to be the best Postgres hosting service. ### Play the long game diff --git a/apps/docs/content/guides/getting-started/features.mdx b/apps/docs/content/guides/getting-started/features.mdx index d9956b15c21..e7127c000ea 100644 --- a/apps/docs/content/guides/getting-started/features.mdx +++ b/apps/docs/content/guides/getting-started/features.mdx @@ -68,7 +68,7 @@ Provide phone logins using a third-party SMS provider. [Docs](/docs/guides/auth/ Control the data each user can access with Postgres Policies. [Docs](/docs/guides/auth/row-level-security). -### Serverside Auth helpers +### Server-side Auth helpers Helpers for implementing user authentication in popular frameworks like [Next.js](/docs/guides/auth/auth-helpers/nextjs) and [SvelteKit](/docs/guides/auth/auth-helpers/sveltekit) @@ -82,7 +82,7 @@ Build login and registration pages with custom themes. [Docs](/docs/guides/auth/ ### Auto-generated REST API -RESTful APIs are autogenerated from your database, without a single line of code. [Docs](/docs/guides/api#rest-api-overview). +RESTful APIs are auto-generated from your database, without a single line of code. [Docs](/docs/guides/api#rest-api-overview). ### Auto-generated GraphQL API diff --git a/apps/docs/content/guides/getting-started/tutorials/with-angular.mdx b/apps/docs/content/guides/getting-started/tutorials/with-angular.mdx index 62d9f2c0644..4a308fe33fc 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-angular.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-angular.mdx @@ -492,7 +492,7 @@ export class AvatarComponent { ### Add the new widget -And then we can add the widget on top of the **AccountComponent** html template: +And then we can add the widget on top of the **AccountComponent** HTML template: ```html src/app/account.component.html
diff --git a/apps/docs/content/guides/getting-started/tutorials/with-expo-react-native.mdx b/apps/docs/content/guides/getting-started/tutorials/with-expo-react-native.mdx index 0bacd902411..43873bc3d77 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-expo-react-native.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-expo-react-native.mdx @@ -460,6 +460,8 @@ expo install expo-image-picker Let's create an avatar for the user so that they can upload a profile photo. We can start by creating a new component: +{/* */} + ```tsx components/Avatar.tsx import { useState, useEffect } from 'react' import { supabase } from '../lib/supabase' @@ -593,6 +595,8 @@ const styles = StyleSheet.create({ }) ``` +{/* */} + ### Add the new widget And then we can add the widget to the Account page: diff --git a/apps/docs/content/guides/getting-started/tutorials/with-ionic-angular.mdx b/apps/docs/content/guides/getting-started/tutorials/with-ionic-angular.mdx index e2a685dbbcd..db01f52844a 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-ionic-angular.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-ionic-angular.mdx @@ -138,7 +138,7 @@ export class SupabaseService { Let's set up a route to manage logins and signups. We'll use Magic Links so users can sign in with their email without using passwords. Create a **LoginPage** with the `ionic g page login` Ionic CLI command. -> This guide will show the template inline, but the example app will have templateUrls +> This guide will show the template inline, but the example app will have `templateUrl`s ```ts src/app/login/login.page.ts import { Component, OnInit } from '@angular/core' diff --git a/apps/docs/content/guides/getting-started/tutorials/with-kotlin.mdx b/apps/docs/content/guides/getting-started/tutorials/with-kotlin.mdx index 167a5b595b5..65bd550fc5e 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-kotlin.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-kotlin.mdx @@ -33,7 +33,7 @@ Open Android Studio > New Project > Base Activity (Jetpack Compose). Create or edit the `local.properties` file at the root (same level as `build.gradle`) of your project. -> **Note**: Do not commit this file to your source control, e.g. by adding it to your `.gitignore` file! +> **Note**: Do not commit this file to your source control, for example, by adding it to your `.gitignore` file! ```kotlin SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY @@ -75,7 +75,7 @@ val apiKey = BuildConfig.SUPABASE_ANON_KEY ![Gradle dependencies](/docs/img/guides/kotlin/gradle-dependencies.png) -In the `build.gradle` (app) file, add these dependencies then press "Sync now". Replace the dependency version placeholders `$supabase_version` and `$ktor_version` with their respective latest versions. +In the `build.gradle` (app) file, add these dependencies then press "Sync now." Replace the dependency version placeholders `$supabase_version` and `$ktor_version` with their respective latest versions. ```kotlin implementation "io.github.jan-tennert.supabase:postgrest-kt:$supabase_version" diff --git a/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx b/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx index f98fe348e90..58300bd88f3 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-redwoodjs.mdx @@ -17,12 +17,12 @@ If you get stuck while working through this guide, refer to the [full example on A Redwood application is split into two parts: a frontend and a backend. This is represented as two node projects within a single monorepo. -The frontend project is called **`web`** and the backend project is called **`api`**. For clarity, we will refer to these in prose as **"sides"**, i.e. the "web side" and the "api side". +The frontend project is called **`web`** and the backend project is called **`api`**. For clarity, we will refer to these in prose as **"sides,"** that is, the `web side` and the `api side`. They are separate projects because code on the `web side` will end up running in the user's browser while code on the `api side` will run on a server somewhere. -Important: When this guide refers to "API", that means the Supabase API and when it refers to "api side", that means the RedwoodJS `api side`. +Important: When this guide refers to "API," that means the Supabase API and when it refers to `api side`, that means the RedwoodJS `api side`. @@ -51,7 +51,7 @@ RedwoodJS requires Node.js `>= 14.x <= 16.x` and Yarn `>= 1.15`. -Make sure you have installed yarn since RedwoodJS relies on it to [manage its packages in workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/) for its `web` and `api` "sides". +Make sure you have installed yarn since RedwoodJS relies on it to [manage its packages in workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/) for its `web` and `api` "sides." ### Initialize a RedwoodJS app @@ -428,7 +428,7 @@ export default Account ``` You'll see the use of `useAuth()` several times. Redwood's `useAuth` hook provides convenient ways to access -logIn, logOut, currentUser, and access the `supabase` authenticate client. We'll use it to get an instance +`logIn`, `logOut`, `currentUser`, and access the `supabase` authenticate client. We'll use it to get an instance of the supabase client to interact with your API. ### Update home page diff --git a/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx b/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx index e3f09494ada..502e4d6cd3a 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-refine.mdx @@ -90,7 +90,7 @@ VITE_SUPABASE_URL=YOUR_SUPABASE_URL VITE_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY ``` -The `supabaseClient` will be used in fetch calls to Supabase endpoints from our app. As we'll see below, the client is instrumental in implementing authentication using refine's auth provider methods and CRUD actions with appropriate data provider methods. +The `supabaseClient` will be used in fetch calls to Supabase endpoints from our app. As we'll see below, the client is instrumental in implementing authentication using Refine's auth provider methods and CRUD actions with appropriate data provider methods. One optional step is to update the CSS file `src/App.css` to make the app look nice. You can find the full contents of this file [here](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/refine-user-management/src/App.css). @@ -404,7 +404,7 @@ Notice above that, we are using three refine hooks, namely the [`useGetIdentity( `useForm()`, in contrast, is a data hook that exposes a series of useful objects that serve the edit form. For example, we are grabbing the `onFinish` function to submit the form with the `handleSubmit` event handler. We are also using `formLoading` property to present state changes of the submitted form. -The `useForm()` hook is a higher-level hook built on top of refine's `useForm()` core hook. It fully supports form state management, field validation and submission using React Hook Form. Behind the scenes, it invokes the `dataProvider.getOne` method to get the user profile data from our Supabase `/profiles` endpoint and also invokes `dataProvider.update` method when `onFinish()` is called. +The `useForm()` hook is a higher-level hook built on top of Refine's `useForm()` core hook. It fully supports form state management, field validation and submission using React Hook Form. Behind the scenes, it invokes the `dataProvider.getOne` method to get the user profile data from our Supabase `/profiles` endpoint and also invokes `dataProvider.update` method when `onFinish()` is called. ### Launch! diff --git a/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx b/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx index 10a8982af85..7610c78ef0e 100644 --- a/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx +++ b/apps/docs/content/guides/getting-started/tutorials/with-sveltekit.mdx @@ -228,7 +228,7 @@ Add the `Auth` component to your home page
``` -Create a `src/routes/+page.server.ts` file that will return our website url to be used in our `redirectTo` above. +Create a `src/routes/+page.server.ts` file that will return our website URL to be used in our `redirectTo` above. ```ts // src/routes/+page.server.ts diff --git a/apps/docs/content/guides/realtime.mdx b/apps/docs/content/guides/realtime.mdx index fa76be5970d..dee6cf6766f 100644 --- a/apps/docs/content/guides/realtime.mdx +++ b/apps/docs/content/guides/realtime.mdx @@ -120,7 +120,13 @@ called `supabase_realtime`, and by managing this publication you can control whi ## Examples
- {examples.map((x) => ( + {[ + { + name: 'Multiplayer.dev', + description: 'Mouse movements and chat messages.', + href: 'https://multiplayer.dev', + }, + ].map((x) => (
{x.description} @@ -129,14 +135,6 @@ called `supabase_realtime`, and by managing this publication you can control whi ))}
-export const examples = [ - { - name: 'Multiplayer.dev', - description: 'Mouse movements and chat messages.', - href: 'https://multiplayer.dev', - }, -] - ## Resources Find the source code and documentation in the Supabase GitHub repository. diff --git a/apps/docs/content/guides/resources.mdx b/apps/docs/content/guides/resources.mdx index d455bae4919..d69a46f7a1e 100644 --- a/apps/docs/content/guides/resources.mdx +++ b/apps/docs/content/guides/resources.mdx @@ -4,6 +4,8 @@ description: 'Resources for getting started building with Supabase.' hideToc: true --- +{/* */} +
diff --git a/apps/docs/content/guides/self-hosting/docker.mdx b/apps/docs/content/guides/self-hosting/docker.mdx index 24d5793860d..4fee2c0d8ba 100644 --- a/apps/docs/content/guides/self-hosting/docker.mdx +++ b/apps/docs/content/guides/self-hosting/docker.mdx @@ -57,7 +57,7 @@ You should change these credentials as soon as possible using the [instructions] ### Accessing the APIs -Each of the APIs are available through the the same API gateway: +Each of the APIs are available through the same API gateway: - REST: `http://:8000/rest/v1/` - Auth: `http://:8000/auth/v1/` @@ -243,7 +243,7 @@ Each system can be [configured](../self-hosting#configuration) independently. So #### Configuring an email server -You will need to use a production-ready SMTP server for sending emails. You can configure the SMTP server by updating the the following environment variables: +You will need to use a production-ready SMTP server for sending emails. You can configure the SMTP server by updating the following environment variables: ```sh .env SMTP_ADMIN_EMAIL= @@ -318,8 +318,6 @@ docker rm supabase-analytics --- -{/* Finish with a video. This also appears in the Sidebar via the "tocVideo" metadata */} - ## Demo A minimal setup working on Ubuntu, hosted on Digital Ocean. diff --git a/vale/styles/Custom/Acronyms.yml b/vale/styles/Custom/Acronyms.yml index 2fdabe6af4c..025136da501 100644 --- a/vale/styles/Custom/Acronyms.yml +++ b/vale/styles/Custom/Acronyms.yml @@ -1,5 +1,5 @@ extends: conditional -message: "Spell out '%s', if it's unfamiliar to the audience." +message: "The first instance of '%s' should be spelled out, followed by the acronym in brackets. For example: 'Data Definition Language (DDL)'" link: 'https://developers.google.com/style/abbreviations' level: suggestion ignorecase: false @@ -9,6 +9,7 @@ second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)' # ... with the exception of these: exceptions: - API + - ARM - ASP - CLI - CPU @@ -20,6 +21,7 @@ exceptions: - FAQ - GCC - GDB + - GDPR - GET - GPT - GPU @@ -61,6 +63,7 @@ exceptions: - URI - URL - USB + - USD - UTF - XML - XSS diff --git a/vale/styles/Custom/Capitalize.yml b/vale/styles/Custom/Capitalize.yml new file mode 100644 index 00000000000..5413e132ab8 --- /dev/null +++ b/vale/styles/Custom/Capitalize.yml @@ -0,0 +1,11 @@ +extends: substitution +message: "Captalize this to make it a proper noun: '%s' -> '%s'" +link: 'https://developers.google.com/style/word-list' +level: warning +ignorecase: false +action: + name: replace +swap: + auth hooks?: Auth Hooks? + edge functions?: Edge Functions? + 'role[- ]?based access control: Role-Based Access Control diff --git a/vale/styles/Custom/Exclamation.yml b/vale/styles/Custom/Exclamation.yml deleted file mode 100644 index b4e4a1f7e9a..00000000000 --- a/vale/styles/Custom/Exclamation.yml +++ /dev/null @@ -1,12 +0,0 @@ -extends: existence -message: "Don't use exclamation points in text." -link: "https://developers.google.com/style/exclamation-points" -nonword: true -level: error -action: - name: edit - params: - - trim_right - - "!" -tokens: - - '\w+!(?:\s|$)' diff --git a/vale/styles/Custom/Filler.yml b/vale/styles/Custom/Filler.yml new file mode 100644 index 00000000000..6535e560b7a --- /dev/null +++ b/vale/styles/Custom/Filler.yml @@ -0,0 +1,12 @@ +extends: existence +message: "Don't use '%s'. The sentence is more concise and/or the tone is more neutral without it." +ignorecase: true +level: error +tokens: + - easily + - easy + - just + - please + - simple + - simply + - that's it diff --git a/vale/styles/Custom/Parens.yml b/vale/styles/Custom/Parens.yml index 3b8711d0c88..74a7d65bded 100644 --- a/vale/styles/Custom/Parens.yml +++ b/vale/styles/Custom/Parens.yml @@ -4,4 +4,5 @@ link: 'https://developers.google.com/style/parentheses' nonword: true level: suggestion tokens: - - '\(.+\)' + # Ignore acronym definitions + - '\([^A-Z]+\)' diff --git a/vale/styles/Custom/Will.yml b/vale/styles/Custom/Will.yml deleted file mode 100644 index 128a918362b..00000000000 --- a/vale/styles/Custom/Will.yml +++ /dev/null @@ -1,7 +0,0 @@ -extends: existence -message: "Avoid using '%s'." -link: 'https://developers.google.com/style/tense' -ignorecase: true -level: warning -tokens: - - will diff --git a/vale/styles/Custom/WordList.yml b/vale/styles/Custom/WordList.yml index bb53e8f7471..34d5459eb40 100644 --- a/vale/styles/Custom/WordList.yml +++ b/vale/styles/Custom/WordList.yml @@ -1,40 +1,42 @@ extends: substitution message: "Use '%s' instead of '%s'." -link: "https://developers.google.com/style/word-list" +link: 'https://developers.google.com/style/word-list' level: warning ignorecase: false action: name: replace swap: - "(?:API Console|dev|developer) key": API key - "(?:cell ?phone|smart ?phone)": phone|mobile phone - "(?:dev|developer|APIs) console": API console - "(?:e-mail|Email|E-mail)": email - "(?:file ?path|path ?name)": path - "(?:kill|terminate|abort)": stop|exit|cancel|end - "(?:OAuth ?2|Oauth)": OAuth 2.0 - "(?:ok|Okay)": OK|okay - "(?:WiFi|wifi)": Wi-Fi - "(?i)postgresql": Postgres - "(?i)repository": repo + '(?:API Console|dev|developer) key': API key + '(?:cell ?phone|smart ?phone)': phone|mobile phone + '(?:dev|developer|APIs) console': API console + '(?:e-mail|Email|E-mail)': email + '(?:file ?path|path ?name)': path + '(?:kill|terminate|abort)': stop|exit|cancel|end + '(?:Nginx|nginx)': NGINX + '(?:OAuth ?2|Oauth)': OAuth 2.0 + '(?:ok|Okay)': OK|okay + '(?:WiFi|wifi)': Wi-Fi + '(?i)postgresql': Postgres + '(?i)repository': repo '[\.]+apk': APK '3\-D': 3D 'Google (?:I\-O|IO)': Google I/O - "tap (?:&|and) hold": touch & hold - "un(?:check|select)": clear + 'Next(?:js)?': Next.js (if referring to the framework) + 'tap (?:&|and) hold': touch & hold + 'un(?:check|select)': clear + 'utili[sz](?:e[ds]|ing)': use, used, uses, etc. above: preceding account name: username action bar: app bar - admin: administrator Ajax: AJAX a\.k\.a|aka: or|also known as Android device: Android-powered device android: Android API explorer: APIs Explorer - application: app approx\.: approximately authN: authentication authZ: authorization + autogenerated: auto-generated autoupdate: automatically update cellular data: mobile data cellular network: mobile network @@ -54,10 +56,12 @@ swap: file name: filename firewalls: firewall rules functionality: capability|feature + Github: GitHub Google account: Google Account Google accounts: Google Accounts Googling: search with Google grayed-out: unavailable + head over to: go to|see HTTPs: HTTPS in order to: to ingest: import|load @@ -68,9 +72,14 @@ swap: open-source: open source overview screen: recents screen regex: regular expression + refer to: see + serverside: server-side SHA1: SHA-1|HAS-SHA1 sign into: sign in to + sign-ins?: signin(s) (noun) or sign in (verb) sign-?on: single sign-on + sign-outs?: signout(s) (noun) or sign out (verb) + sign-ups?: signup(s) (noun) or sign up (verb) static IP address: static external IP address stylesheet: style sheet synch: sync diff --git a/vale/styles/config/vocabularies/Supabase/accept.txt b/vale/styles/config/vocabularies/Supabase/accept.txt index f02c243b654..331d4806080 100644 --- a/vale/styles/config/vocabularies/Supabase/accept.txt +++ b/vale/styles/config/vocabularies/Supabase/accept.txt @@ -1,18 +1,82 @@ +APIs +[Aa]uth +Berri +[Cc]hatbots? ChatGPT Clippy Colab +[Cc]omposable CPUs? +[Dd]eclarative(ly)? [Dd]eduplicat(e|ion) +[Dd]eeplinks? +[Dd]egit +[Dd]eserializ(e|ed|es|ing) +Deno +[Dd]ev +[Dd]otenv +[Ee]nv +[Ee]nums? +Firestore +Hashicorp +[Gg]eospatial GPUs? +Gradle +GraphQL +Groonga +href +Infisical IVFFlat +JetBrains +Jetpack +JWTs +Lua +Markprompt +[Mm]iddleware +[Nn]amespace(d|s)? +Next.js +Nuxt +OAuth OpenAI +[Pp]ackageable +[Pp]asscodes? +[Pp]asswordless [Pp]erformant +PGAudit +PGroonga pgvector -Postgres +Pinecone +plpgsql +[Pp]olyfill(s|ed)? +[Pp]ooler +[Pp]ostgres +[Pp]rebuild +Prisma +[Rr]ealtime +Refine's +[Rr]eindex(ed|es|ing)? repo +RESTful +[Rr]evalidated? Roboflow [Ss]crollable +[Ss]erializ(e|ed|es|ing) +[Ss]igncryption +[Ss]ignins? +[Ss]ignouts? +[Ss]ignups? SQLAlchemy -Supabase -[Uu]psert - +[Ss]upabase +Supavisor +[Ss]upersets? +Terraform +[Tt]odos? +[Uu]npaus(e|es|ed|ing) +[Uu]psert(s|ed|ing)? +[Uu]pvot(es|ed|ing) +Vercel +Vite +VSCode +Vue +[Ww]eb[Ss]ockets? +Xcode