From e251de17e49bd4fdef6231adfdd9bb8cbd006c44 Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Wed, 21 Sep 2022 16:50:21 +0200 Subject: [PATCH 01/51] chore: added new image for architecture --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 446e3316709..465245a61f9 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ Supabase is a combination of open source tools. We’re building the features of Supabase is a [hosted platform](https://app.supabase.com). You can sign up and start using Supabase without installing anything. You can also [self-host](https://supabase.com/docs/guides/hosting/overview) and [develop locally](https://supabase.com/docs/guides/local-development). +![Architecture diagram](https://user-images.githubusercontent.com/8291514/191536900-c4c2f455-093a-4bc2-a1ea-5d1674dc1afa.png) + ![Architecture](https://user-images.githubusercontent.com/70828596/187547862-ffa9d058-0c3a-4851-a3e7-92ccfca4b596.png) - [PostgreSQL](https://www.postgresql.org/) is an object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance. From 3153497f600e3ce3149ba2d28482500d98d1d6c7 Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Thu, 22 Sep 2022 13:40:22 +0200 Subject: [PATCH 02/51] Update README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 465245a61f9..a3948c8e6fa 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ -

- - -

+![main image](https://user-images.githubusercontent.com/8291514/191737114-3b8e4985-7b91-4fc9-92ce-3106915e0a06.png) --- + + # Supabase [Supabase](https://supabase.com) is an open source Firebase alternative. We're building the features of Firebase using enterprise-grade open source tools. @@ -58,7 +57,7 @@ Supabase is a combination of open source tools. We’re building the features of Supabase is a [hosted platform](https://app.supabase.com). You can sign up and start using Supabase without installing anything. You can also [self-host](https://supabase.com/docs/guides/hosting/overview) and [develop locally](https://supabase.com/docs/guides/local-development). -![Architecture diagram](https://user-images.githubusercontent.com/8291514/191536900-c4c2f455-093a-4bc2-a1ea-5d1674dc1afa.png) +![diagram (1)](https://user-images.githubusercontent.com/8291514/191737181-22e6a111-817d-403b-8c3f-489279a2a7da.png) ![Architecture](https://user-images.githubusercontent.com/70828596/187547862-ffa9d058-0c3a-4851-a3e7-92ccfca4b596.png) From 20f94ceb30b38d95a5561a10b06e2452dd790896 Mon Sep 17 00:00:00 2001 From: Rudy Delouya Date: Tue, 10 Jan 2023 16:58:20 +0100 Subject: [PATCH 03/51] Update with-sveltekit.mdx updated main CSS filename --- .../pages/guides/getting-started/tutorials/with-sveltekit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx index bbac06e6019..fd1cced34fb 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx @@ -56,7 +56,7 @@ import { env } from '$env/dynamic/public' export const supabase = createClient(env.PUBLIC_SUPABASE_URL, env.PUBLIC_SUPABASE_ANON_KEY) ``` -Optionally, update `src/routes/style.css` with the [CSS from the example](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/svelte-user-management/src/app.css). +Optionally, update `src/routes/styles.css` with the [CSS from the example](https://raw.githubusercontent.com/supabase/supabase/master/examples/user-management/svelte-user-management/src/app.css). ### Supabase Auth Helpers From 38194ed378bb3af4c9f04986e4b8cdb357208c53 Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Fri, 20 Jan 2023 15:49:42 +0100 Subject: [PATCH 04/51] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3948c8e6fa..d6e64787c67 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ -![main image](https://user-images.githubusercontent.com/8291514/191737114-3b8e4985-7b91-4fc9-92ce-3106915e0a06.png) +

+ + +

--- From 9f75c8e53379d17f21cfdda24c71aa8735d72c8c Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Fri, 20 Jan 2023 15:50:42 +0100 Subject: [PATCH 05/51] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d6e64787c67..a4d6547d45c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- - + +

--- From 3cb9173c048d0b93bb697ca6921060580da5d04c Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Fri, 20 Jan 2023 15:51:07 +0100 Subject: [PATCH 06/51] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a4d6547d45c..25b27da9039 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- - + +

--- From c86e736575f445c8310a4e69fe37f850031b6d1b Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Fri, 20 Jan 2023 15:51:51 +0100 Subject: [PATCH 07/51] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 25b27da9039..1e8e34a634f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- - + +

--- From 665fbfe5499ca5009afc938a648c3f83dd82d0d2 Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Wed, 25 Jan 2023 08:28:11 -0600 Subject: [PATCH 08/51] add blog post for type constraints (domains) --- .gitignore | 3 +- ...postgres-extension-for-json-validation.mdx | 1 + ...15-postgres-foreign-data-wrappers-rust.mdx | 1 + ...25-type-constraints-in-50-lines-of-sql.mdx | 271 ++++++++++++++++++ 4 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 apps/www/_blog/2023-01-25-type-constraints-in-50-lines-of-sql.mdx diff --git a/.gitignore b/.gitignore index f536bae18d7..c67a911193a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ node_modules out .docz tmp +.swp coverage allure-results @@ -119,4 +120,4 @@ typings/ **/supabase/.branches **/supabase/.temp -apps/new-docs/* \ No newline at end of file +apps/new-docs/* diff --git a/apps/www/_blog/2022-08-19-pg-jsonschema-a-postgres-extension-for-json-validation.mdx b/apps/www/_blog/2022-08-19-pg-jsonschema-a-postgres-extension-for-json-validation.mdx index 52f14bd8c01..296165cc10d 100644 --- a/apps/www/_blog/2022-08-19-pg-jsonschema-a-postgres-extension-for-json-validation.mdx +++ b/apps/www/_blog/2022-08-19-pg-jsonschema-a-postgres-extension-for-json-validation.mdx @@ -6,6 +6,7 @@ image: lw5-pg_jsonschema/jsonschema-thumb.jpg thumb: lw5-pg_jsonschema/jsonschema-thumb.jpg tags: - launch-week + - planetpg date: '2022-08-19' toc_depth: 3 --- diff --git a/apps/www/_blog/2022-12-15-postgres-foreign-data-wrappers-rust.mdx b/apps/www/_blog/2022-12-15-postgres-foreign-data-wrappers-rust.mdx index 62147a24dd0..1c1e26f0354 100644 --- a/apps/www/_blog/2022-12-15-postgres-foreign-data-wrappers-rust.mdx +++ b/apps/www/_blog/2022-12-15-postgres-foreign-data-wrappers-rust.mdx @@ -6,6 +6,7 @@ image: launch-week-6/wrappers/wrappers-og.png thumb: launch-week-6/wrappers/wrappers-og.png tags: - launch-week + - planetpg date: '2022-12-15' toc_depth: 3 --- diff --git a/apps/www/_blog/2023-01-25-type-constraints-in-50-lines-of-sql.mdx b/apps/www/_blog/2023-01-25-type-constraints-in-50-lines-of-sql.mdx new file mode 100644 index 00000000000..86a50c7423e --- /dev/null +++ b/apps/www/_blog/2023-01-25-type-constraints-in-50-lines-of-sql.mdx @@ -0,0 +1,271 @@ +--- +title: Type Constraints in 50 lines of SQL +description: Creating validated data types in Postgres +author: oli_rice +image: +thumb: +tags: + - postgres + - planetpg +date: '2023-01-25' +toc_depth: 3 +--- + +PostgreSQL has a rich and extensible type system. Beyond defining custom enums and composite types, we can: + +- apply data validation rules +- override comparison operators like `=` / `+` / `-` +- create custom aggregations +- define casting rules between types + +until our types are indistinguishable from built-ins. In this article we’ll focus on validation and ergonomics, and touch on a few other concepts. + +To illustrate, we’ll create an `semver` data type to represent [Semantic Versioning](https://semver.org) values. We’ll then add validation rules to make invalid states unrepresentable. + +## SemVer + +A (very) loose primer on SemVer: + +SemVer is a specification for representing software versions that communicate information about backwards compatibility. The type is typically represented as a string with 5 components. + + + +The intent of each component is outside the scope of this article but, as an example, incrementing the major version number notifies users that the release includes at least one backwards incompatible change. + +For a concise representation of the full spec, [check out the grammar](https://semver.org/#backusnaur-form-grammar-for-valid-semver-versions). + +## SQL + +For our purposes, we’ll assume that our SemVer type is a major component of the application we’re building that we need to query flexibly and efficiently. + +### Storing Components + +To that end, we’ll store each component of the version as a separate field on a [composite type](https://www.postgresql.org/docs/current/rowtypes.html). + +```sql +create type semver_components as ( + major int, + minor int, + patch int, + pre_release text[], + build_metadata text[] +); +``` + +We can create an instance of this type in SQL by casting a tuple as the `semver_components` type. + +```sql +select + (1, 2, 3, array['beta', '1'], array['meta'])::semver_components +-- returns: (1,2,3,{'beta','1'},{'meta'}) +``` + +Unfortunately, our definition is far too permissive. + +```sql +select + (null, -500, null, array['?'], array[''])::semver_components +-- returns: (,-500,,{'?'},{'' +``` + +Our data type has no problem accepting invalid components. To list a few of the SemVer rules we violated: + +- Major version must not be null +- Minor version must be ≥ 0 +- Patch version must not be null +- Pre-release elements must only include characters [A-z0-9] +- Build metadata elements may not be empty strings + +We need to add some validation to meet our “make invalid states unrepresentable” goal. + +### Validation + +[Domains](https://www.postgresql.org/docs/current/sql-createdomain.html) are the Postgres’s solution for optionally layering constraints over a data type. Domains are to types what check constraints are to tables. If you’re not familiar with check constraints, you can think of them as equivalent to zod/pydantic in javascript/python. + +Let's codify some SemVer rules, layer them on the `semver_components` type, and give the new domain a friendly name. + +```sql +create domain semver + as semver_components + check ( + (value).major is not null and (value).major >= 0 -- major: non-null positive integer + and (value).minor is not null and (value).minor >= 0 -- minor: non-null positive integer + and (value).patch is not null and (value).patch >= 0 -- patch: non-null positive integer + and semver_elements_match_regex((value).pre_release, '^[A-z0-9]{1,255}$') + and semver_elements_match_regex((value).build_metadata, '^[A-z0-9\.]{1,255}$') + ); +``` + +which references a helper function: + +```sql +create or replace function semver_elements_match_regex( + parts text[], + regex text +) +returns bool +language sql +as $$ + -- validates that *parts* nullable array of non-empty strings + -- where each element of *parts* matches *regex* + select + $1 is null + or ( + ( + select + ( + bool_and(pr_arr.elem is not null) + and bool_and(pr_arr.elem ~ $2) + ) + from + unnest($1) pr_arr(elem) + ) + and array_length($1, 1) > 0 + ) +$$; +``` + +Now, if we repeat our positive an negative test cases using the `semver` type (vs `semver_components`) we still accept valid states: + +```sql +-- Success Case +select + (1, 2, 3, array['beta', '1'], array['meta'])::semver, +-- returns: (1,2,3,{'beta','1'},{'meta'}) +``` + +while invalid states are rejected with an error: + +```sql +-- Failure Case +select + (null, -500, null, array['?'], array[''])::semver +-- ERROR: value for domain semver violates check constraint "semver_check" +-- SQL state: 23514 +``` + +### Testing + +Our validation doesn’t have to be called manually. The `semver` domain can be used anywhere you’d use the `semver_components` type and the validations are automatically applied. + +```sql +-- A table with a semver column +create table package_version( + id bigserial primary key, + package_name text not null, + package_semver semver not null -- semver column +); + +-- Insert some valid records +insert into package_version( package_name, package_semver ) +values + ('supabase-js', (2, 2, 3, null, null)), + ('supabase-js', (2, 0, 0, array['rc', '1'], null) +); + +-- Attempt to insert an invalid record (major is null) +insert into package_version( package_name, package_semver ) +values + ('invalid-js', (null, 1, 0, array['asdf'], null)); +-- ERROR: value for domain semver violates check constraint "semver_check" +``` + +Good stuff! + +We’re 37 lines of SQL in and have solved for making invalid states unrepresentable. Now lets think about ergonomics. + +### Displaying + +Now that our data type is well constrained, you might notice that selecting values from a `semver` typed column returns a tuple, rather than the SemVer string we’re used to seeing. + +```sql +select + * +from + package_version +/* +id | package_name | package_semver +------------------------------------- + 1 | supabase-js, | (2,2,3,,) + 1 | supabase-js, | (2,0,0,"{rc,1}",) +*/ +``` + +For example: `(2,0,0,"{rc,1}",)` vs `2.0.0-rc.1` + +We could work around that problem with some [custom casts](https://www.postgresql.org/docs/current/sql-createcast.html), but I’d recommend keeping everything explicit with a function call. + +```sql +create or replace function semver_to_text(semver) + returns text + immutable + language sql +as $$ + select + format('%s.%s.%s', $1.major, $1.minor, $1.patch) + || case + when $1.pre_release is null then '' + else format('-%s', array_to_string($1.pre_release, '.')) + end + || case + when $1.build_metadata is null then '' + else format('+%s', array_to_string($1.build_metadata, '.')) + end +$$; +``` + +Which allows us to query the `package_version` table and retrieve a string representation of the data. + +```sql +select + id, + package_name, + semver_to_text(package_semver) as ver -- cast to as text +from + package_version +/* +id | package_name | ver +------------------------------ + 1 | supabase-js, | 2.2.3 + 1 | supabase-js, | 2.0.0-rc.1 +*/ +``` + +Or, better yet, use a [generated column](https://www.postgresql.org/docs/current/ddl-generated-columns.html) + +```sql +create table package_version( + id bigserial primary key, + package_name text not null, + package_semver semver not null, + semver_text text generated always as (semver_to_text(package_semver)) stored +); +``` + +so the text representation persisted along with the `semver` type and incurs no query/filter penalty. + +### Other Tricks + +Postgres provides all the tools you could want to make your data types/domains work with SQL as seamlessly as builtins. + +For example, you could: + +- add convenience functions to parse a [semver type from text](https://github.com/supabase/dbdev/blob/ca338584203d9b2eb7a4a378f5724674c15b9c25/supabase/migrations/20220117141507_semver.sql#L78) +- [override the equality operator](https://github.com/supabase/dbdev/blob/ca338584203d9b2eb7a4a378f5724674c15b9c25/supabase/migrations/20220117141507_semver.sql#L37-L63) (`=`) to correctly reflect that versions differing only in build metadata are considered equal +- [add a `max` function](https://github.com/supabase/dbdev/blob/ca338584203d9b2eb7a4a378f5724674c15b9c25/supabase/migrations/20220117141507_semver.sql#L122-L140) to efficiently query for the newest version of each package from within the database + +to name a few. + +Aligning the right parts of your business’ logic with the database can dramatically improve throughput, decrease IO, and simplify application code. + +### Conclusion + +I’ll be the first to admit that building out performant and ergonomic custom data types in Postgres involves a lot of ceremony. + +That said, in cases where: + +- the type’s data integrity is critical +- the type is well specified +- the type’s spec does not change (or changes infrequently) + +Teaching Postgres to have first class support for your custom type can be transformative for data integrity and performance. From f2f256a33a30123b188a6d5472f3357c6331c094 Mon Sep 17 00:00:00 2001 From: Laurensius Adi Date: Fri, 27 Jan 2023 22:23:43 +0700 Subject: [PATCH 09/51] fix signOut using useSupabaseAuthClient Based on https://github.com/nuxt-modules/supabase/pull/115 --- .../nuxt3-user-management/components/Account.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/user-management/nuxt3-user-management/components/Account.vue b/examples/user-management/nuxt3-user-management/components/Account.vue index 914d5e20f61..ccdd09c046f 100644 --- a/examples/user-management/nuxt3-user-management/components/Account.vue +++ b/examples/user-management/nuxt3-user-management/components/Account.vue @@ -74,10 +74,11 @@ async function updateProfile() { } } +const supabaseAuth = useSupabaseAuthClient() async function signOut() { try { loading.value = true - let { error } = await supabase.auth.signOut() + let { error } = await supabaseAuth.auth.signOut() if (error) throw error } catch (error) { alert(error.message) From 1a744bdf2080031178f1ffab1ef8c8b2188eda0e Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Thu, 2 Feb 2023 22:41:33 -0330 Subject: [PATCH 10/51] Add filtering to extensions docs --- apps/docs/components/Extensions.js | 35 --- apps/docs/components/Extensions.tsx | 126 +++++++++++ apps/docs/data/extensions.json | 211 ++++++++++++------ .../docs/pages/guides/database/extensions.mdx | 4 - apps/docs/tsconfig.json | 2 +- 5 files changed, 268 insertions(+), 110 deletions(-) delete mode 100644 apps/docs/components/Extensions.js create mode 100644 apps/docs/components/Extensions.tsx diff --git a/apps/docs/components/Extensions.js b/apps/docs/components/Extensions.js deleted file mode 100644 index 47753d6bfde..00000000000 --- a/apps/docs/components/Extensions.js +++ /dev/null @@ -1,35 +0,0 @@ -import React, { useState } from 'react' -import extensions from '../data/extensions.json' - -export default function Extensions() { - const [filter, setFilter] = useState('') - return ( - <> -
- - setFilter(e.target.value)} - /> -
-
- {extensions - .filter((x) => x.name.indexOf(filter) >= 0) - .map((extension) => ( -
-
-

- {extension.name} -

-

- {extension.comment.charAt(0).toUpperCase() + extension.comment.slice(1)} -

-
-
- ))} -
- - ) -} diff --git a/apps/docs/components/Extensions.tsx b/apps/docs/components/Extensions.tsx new file mode 100644 index 00000000000..0175afe77a5 --- /dev/null +++ b/apps/docs/components/Extensions.tsx @@ -0,0 +1,126 @@ +import Link from 'next/link' +import React, { useState } from 'react' +import { IconExternalLink, IconX, Input } from 'ui' +import extensions from '../data/extensions.json' + +type extension = { + name: string + schema: string | null + default_version: string + installed_version: string | null + comment: string + tags: string[] + link?: string +} + +function getUniqueTags(json: extension[]) { + const tags = [] + for (const item of json) { + tags.push(...item.tags) + } + return [...new Set(tags)] +} + +export default function Extensions() { + const [searchTerm, setSearchTerm] = useState('') + const [filters, setFilters] = useState([]) + + const tags = getUniqueTags(extensions) + + function handleChecked(tag) { + if (filters.includes(tag)) { + setFilters(filters.filter((x) => x !== tag)) + } else { + setFilters([...filters, tag]) + } + } + + return ( + <> +
+ + setSearchTerm(e.target.value)} + /> +
+
+
+
+

Filter

+
    + {tags.map((tag) => ( +
  • + +
  • + ))} +
+

+ +

+
+
+ +
+
+ {extensions + .filter((x) => x.name.indexOf(searchTerm) >= 0) + .filter((x) => + filters.length === 0 ? x : x.tags.some((item) => filters.includes(item)) + ) + .map((extension) => ( +
+
+

+ {extension.name} +

+

+ {extension.comment.charAt(0).toUpperCase() + extension.comment.slice(1)} +

+ {extension.link && ( + + + + + + + + )} +
+
+ ))} +
+
+
+ + ) +} diff --git a/apps/docs/data/extensions.json b/apps/docs/data/extensions.json index 164600eb93e..c04f21f0543 100644 --- a/apps/docs/data/extensions.json +++ b/apps/docs/data/extensions.json @@ -4,489 +4,560 @@ "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "Used to parse an address into constituent elements. Generally used to support geocoding address normalization step." + "comment": "Used to parse an address into constituent elements. Generally used to support geocoding address normalization step.", + "tags": [], + "link": "http://supabase.com/docs/guides/extensions/etc/etc/etc" }, { "name": "address_standardizer-3", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "Used to parse an address into constituent elements. Generally used to support geocoding address normalization step." + "comment": "Used to parse an address into constituent elements. Generally used to support geocoding address normalization step.", + "tags": [] }, { "name": "address_standardizer_data_us", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "Address Standardizer US dataset example" + "comment": "Address Standardizer US dataset example", + "tags": [] }, { "name": "address_standardizer_data_us-3", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "Address Standardizer US dataset example" + "comment": "Address Standardizer US dataset example", + "tags": ["addresses"] }, { "name": "adminpack", "schema": null, "default_version": "2.0", "installed_version": null, - "comment": "administrative functions for PostgreSQL" + "comment": "administrative functions for PostgreSQL", + "tags": [] }, { "name": "amcheck", "schema": null, "default_version": "1.2", "installed_version": null, - "comment": "functions for verifying relation integrity" + "comment": "functions for verifying relation integrity", + "tags": [] }, { "name": "autoinc", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "functions for autoincrementing fields" + "comment": "functions for autoincrementing fields", + "tags": [] }, { "name": "bloom", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "bloom access method - signature file based index" + "comment": "bloom access method - signature file based index", + "tags": [] }, { "name": "btree_gin", "schema": null, "default_version": "1.3", "installed_version": null, - "comment": "support for indexing common datatypes in GIN" + "comment": "support for indexing common datatypes in GIN", + "tags": [] }, { "name": "btree_gist", "schema": null, "default_version": "1.5", "installed_version": null, - "comment": "support for indexing common datatypes in GiST" + "comment": "support for indexing common datatypes in GiST", + "tags": [] }, { "name": "citext", "schema": null, "default_version": "1.6", "installed_version": null, - "comment": "data type for case-insensitive character strings" + "comment": "data type for case-insensitive character strings", + "tags": [] }, { "name": "cube", "schema": null, "default_version": "1.4", "installed_version": null, - "comment": "data type for multidimensional cubes" + "comment": "data type for multidimensional cubes", + "tags": [] }, { "name": "dblink", "schema": null, "default_version": "1.2", "installed_version": null, - "comment": "connect to other PostgreSQL databases from within a database" + "comment": "connect to other PostgreSQL databases from within a database", + "tags": [] }, { "name": "dict_int", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "text search dictionary template for integers" + "comment": "text search dictionary template for integers", + "tags": [] }, { "name": "dict_xsyn", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "text search dictionary template for extended synonym processing" + "comment": "text search dictionary template for extended synonym processing", + "tags": [] }, { "name": "earthdistance", "schema": null, "default_version": "1.1", "installed_version": null, - "comment": "calculate great-circle distances on the surface of the Earth" + "comment": "calculate great-circle distances on the surface of the Earth", + "tags": [] }, { "name": "file_fdw", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "foreign-data wrapper for flat file access" + "comment": "foreign-data wrapper for flat file access", + "tags": [] }, { "name": "fuzzystrmatch", "schema": null, "default_version": "1.1", "installed_version": null, - "comment": "determine similarities and distance between strings" + "comment": "determine similarities and distance between strings", + "tags": [] }, { "name": "hstore", "schema": null, "default_version": "1.6", "installed_version": null, - "comment": "data type for storing sets of (key, value) pairs" + "comment": "data type for storing sets of (key, value) pairs", + "tags": [] }, { "name": "http", "schema": "extensions", "default_version": "1.3", "installed_version": "1.3", - "comment": "HTTP client for PostgreSQL, allows web page retrieval inside the database." + "comment": "HTTP client for PostgreSQL, allows web page retrieval inside the database.", + "tags": [] }, { "name": "insert_username", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "functions for tracking who changed a table" + "comment": "functions for tracking who changed a table", + "tags": [] }, { "name": "intagg", "schema": null, "default_version": "1.1", "installed_version": null, - "comment": "integer aggregator and enumerator (obsolete)" + "comment": "integer aggregator and enumerator (obsolete)", + "tags": [] }, { "name": "intarray", "schema": null, "default_version": "1.2", "installed_version": null, - "comment": "functions, operators, and index support for 1-D arrays of integers" + "comment": "functions, operators, and index support for 1-D arrays of integers", + "tags": [] }, { "name": "isn", "schema": null, "default_version": "1.2", "installed_version": null, - "comment": "data types for international product numbering standards" + "comment": "data types for international product numbering standards", + "tags": [] }, { "name": "lo", "schema": null, "default_version": "1.1", "installed_version": null, - "comment": "Large Object maintenance" + "comment": "Large Object maintenance", + "tags": [] }, { "name": "ltree", "schema": null, "default_version": "1.1", "installed_version": null, - "comment": "data type for hierarchical tree-like structures" + "comment": "data type for hierarchical tree-like structures", + "tags": [] }, { "name": "moddatetime", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "functions for tracking last modification time" + "comment": "functions for tracking last modification time", + "tags": [] }, { "name": "pageinspect", "schema": null, "default_version": "1.7", "installed_version": null, - "comment": "inspect the contents of database pages at a low level" + "comment": "inspect the contents of database pages at a low level", + "tags": [] }, { "name": "pg_buffercache", "schema": null, "default_version": "1.3", "installed_version": null, - "comment": "examine the shared buffer cache" + "comment": "examine the shared buffer cache", + "tags": [] }, { "name": "pg_cron", "schema": "extensions", "default_version": "1.3", "installed_version": "1.3", - "comment": "Job scheduler for PostgreSQL" + "comment": "Job scheduler for PostgreSQL", + "tags": [] }, { "name": "pg_freespacemap", "schema": null, "default_version": "1.2", "installed_version": null, - "comment": "examine the free space map (FSM)" + "comment": "examine the free space map (FSM)", + "tags": [] }, { "name": "pg_prewarm", "schema": null, "default_version": "1.2", "installed_version": null, - "comment": "prewarm relation data" + "comment": "prewarm relation data", + "tags": [] }, { "name": "pg_stat_statements", "schema": null, "default_version": "1.7", "installed_version": null, - "comment": "track execution statistics of all SQL statements executed" + "comment": "track execution statistics of all SQL statements executed", + "tags": [] }, { "name": "pg_trgm", "schema": null, "default_version": "1.4", "installed_version": null, - "comment": "text similarity measurement and index searching based on trigrams" + "comment": "text similarity measurement and index searching based on trigrams", + "tags": [] }, { "name": "pg_visibility", "schema": null, "default_version": "1.2", "installed_version": null, - "comment": "examine the visibility map (VM) and page-level visibility info" + "comment": "examine the visibility map (VM) and page-level visibility info", + "tags": [] }, { "name": "pgaudit", "schema": null, "default_version": "1.4", "installed_version": null, - "comment": "provides auditing functionality" + "comment": "provides auditing functionality", + "tags": [] }, { "name": "pgcrypto", "schema": "extensions", "default_version": "1.3", "installed_version": "1.3", - "comment": "cryptographic functions" + "comment": "cryptographic functions", + "tags": [] }, { "name": "pgjwt", "schema": "extensions", "default_version": "0.1.0", "installed_version": "0.1.0", - "comment": "JSON Web Token API for Postgresql" + "comment": "JSON Web Token API for Postgresql", + "tags": [] }, { "name": "pgrowlocks", "schema": null, "default_version": "1.2", "installed_version": null, - "comment": "show row-level locking information" + "comment": "show row-level locking information", + "tags": [] }, { "name": "pgstattuple", "schema": null, "default_version": "1.5", "installed_version": null, - "comment": "show tuple-level statistics" + "comment": "show tuple-level statistics", + "tags": [] }, { "name": "pgtap", "schema": null, "default_version": "1.1.0", "installed_version": null, - "comment": "Unit testing for PostgreSQL" + "comment": "Unit testing for PostgreSQL", + "tags": [] }, { "name": "plcoffee", "schema": null, "default_version": "3.0alpha", "installed_version": null, - "comment": "PL/CoffeeScript (v8) trusted procedural language" + "comment": "PL/CoffeeScript (v8) trusted procedural language", + "tags": [] }, { "name": "pljava", "schema": null, "default_version": "1.6.0", "installed_version": null, - "comment": "PL/Java procedural language (https://tada.github.io/pljava/)" + "comment": "PL/Java procedural language (https://tada.github.io/pljava/)", + "tags": [] }, { "name": "plls", "schema": null, "default_version": "3.0alpha", "installed_version": null, - "comment": "PL/LiveScript (v8) trusted procedural language" + "comment": "PL/LiveScript (v8) trusted procedural language", + "tags": [] }, { "name": "plpgsql", "schema": "pg_catalog", "default_version": "1.0", "installed_version": "1.0", - "comment": "PL/pgSQL procedural language" + "comment": "PL/pgSQL procedural language", + "tags": [] }, { "name": "plpgsql_check", "schema": null, "default_version": "1.11", "installed_version": null, - "comment": "extended check for plpgsql functions" + "comment": "extended check for plpgsql functions", + "tags": [] }, { "name": "plv8", "schema": null, "default_version": "3.0alpha", "installed_version": null, - "comment": "PL/JavaScript (v8) trusted procedural language" + "comment": "PL/JavaScript (v8) trusted procedural language", + "tags": [] }, { "name": "postgis", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "PostGIS geometry and geography spatial types and functions" + "comment": "PostGIS geometry and geography spatial types and functions", + "tags": ["GIS"] }, { "name": "postgis-3", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "PostGIS geometry and geography spatial types and functions" + "comment": "PostGIS geometry and geography spatial types and functions", + "tags": ["GIS"] }, { "name": "postgis_raster", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "PostGIS raster types and functions" + "comment": "PostGIS raster types and functions", + "tags": ["GIS"] }, { "name": "postgis_raster-3", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "PostGIS raster types and functions" + "comment": "PostGIS raster types and functions", + "tags": ["GIS"] }, { "name": "postgis_sfcgal", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "PostGIS SFCGAL functions" + "comment": "PostGIS SFCGAL functions", + "tags": ["GIS"] }, { "name": "postgis_sfcgal-3", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "PostGIS SFCGAL functions" + "comment": "PostGIS SFCGAL functions", + "tags": ["GIS"] }, { "name": "postgis_tiger_geocoder", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "PostGIS tiger geocoder and reverse geocoder" + "comment": "PostGIS tiger geocoder and reverse geocoder", + "tags": ["GIS"] }, { "name": "postgis_tiger_geocoder-3", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "PostGIS tiger geocoder and reverse geocoder" + "comment": "PostGIS tiger geocoder and reverse geocoder", + "tags": ["GIS"] }, { "name": "postgis_topology", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "PostGIS topology spatial types and functions" + "comment": "PostGIS topology spatial types and functions", + "tags": ["GIS"] }, { "name": "postgis_topology-3", "schema": null, "default_version": "3.1.1", "installed_version": null, - "comment": "PostGIS topology spatial types and functions" + "comment": "PostGIS topology spatial types and functions", + "tags": ["GIS"] }, { "name": "postgres_fdw", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "foreign-data wrapper for remote PostgreSQL servers" + "comment": "foreign-data wrapper for remote PostgreSQL servers", + "tags": [] }, { "name": "refint", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "functions for implementing referential integrity (obsolete)" + "comment": "functions for implementing referential integrity (obsolete)", + "tags": [] }, { "name": "seg", "schema": null, "default_version": "1.3", "installed_version": null, - "comment": "data type for representing line segments or floating-point intervals" + "comment": "data type for representing line segments or floating-point intervals", + "tags": [] }, { "name": "sslinfo", "schema": null, "default_version": "1.2", "installed_version": null, - "comment": "information about SSL certificates" + "comment": "information about SSL certificates", + "tags": [] }, { "name": "tablefunc", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "functions that manipulate whole tables, including crosstab" + "comment": "functions that manipulate whole tables, including crosstab", + "tags": [] }, { "name": "tcn", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "Triggered change notifications" + "comment": "Triggered change notifications", + "tags": ["notifications"] }, { "name": "tsm_system_rows", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "TABLESAMPLE method which accepts number of rows as a limit" + "comment": "TABLESAMPLE method which accepts number of rows as a limit", + "tags": [] }, { "name": "tsm_system_time", "schema": null, "default_version": "1.0", "installed_version": null, - "comment": "TABLESAMPLE method which accepts time in milliseconds as a limit" + "comment": "TABLESAMPLE method which accepts time in milliseconds as a limit", + "tags": [] }, { "name": "unaccent", "schema": null, "default_version": "1.1", "installed_version": null, - "comment": "text search dictionary that removes accents" + "comment": "text search dictionary that removes accents", + "tags": [] }, { "name": "uuid-ossp", "schema": "extensions", "default_version": "1.1", "installed_version": "1.1", - "comment": "generate universally unique identifiers (UUIDs)" + "comment": "generate universally unique identifiers (UUIDs)", + "tags": [] }, { "name": "vector", "schema": "extensions", "default_version": "0.4.0", "installed_version": null, - "comment": "vector data type with similarity search" + "comment": "vector data type with similarity search", + "tags": [] }, { "name": "xml2", "schema": null, "default_version": "1.1", "installed_version": null, - "comment": "XPath querying and XSLT" + "comment": "XPath querying and XSLT", + "tags": [] }, { "name": "pg_repack", "schema": "extensions", "default_version": "1.4.8", "installed_version": "1.4.8", - "comment": "optimize physical storage and remove bloat from tables and indexes" + "comment": "optimize physical storage and remove bloat from tables and indexes", + "tags": [] } ] diff --git a/apps/docs/pages/guides/database/extensions.mdx b/apps/docs/pages/guides/database/extensions.mdx index 6ae1fd74546..0002a0e9ab3 100644 --- a/apps/docs/pages/guides/database/extensions.mdx +++ b/apps/docs/pages/guides/database/extensions.mdx @@ -23,10 +23,6 @@ Supabase has pre-installed some of the most useful open source extensions. 2. Click **Extensions** in the sidebar. 3. Enable or disable an extension. - - diff --git a/apps/docs/tsconfig.json b/apps/docs/tsconfig.json index ce8de4c02e1..c87a0e51e07 100644 --- a/apps/docs/tsconfig.json +++ b/apps/docs/tsconfig.json @@ -6,7 +6,7 @@ "paths": { "~/*": ["./*"] }, - "target": "es5", + "target": "es2015", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, From 91e4317e15ed53cb9e8b1addd0a0c7e240acd840 Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Wed, 8 Feb 2023 14:29:27 +0800 Subject: [PATCH 11/51] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 1e8e34a634f..ddf6ccb85b8 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,6 @@ Supabase is a combination of open source tools. We’re building the features of Supabase is a [hosted platform](https://app.supabase.com). You can sign up and start using Supabase without installing anything. You can also [self-host](https://supabase.com/docs/guides/hosting/overview) and [develop locally](https://supabase.com/docs/guides/local-development). -![diagram (1)](https://user-images.githubusercontent.com/8291514/191737181-22e6a111-817d-403b-8c3f-489279a2a7da.png) - ![Architecture](https://user-images.githubusercontent.com/70828596/187547862-ffa9d058-0c3a-4851-a3e7-92ccfca4b596.png) - [PostgreSQL](https://www.postgresql.org/) is an object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance. From ac95a9902d2f97946807efdb78010fc025d016e9 Mon Sep 17 00:00:00 2001 From: Jonathan Summers-Muir Date: Wed, 8 Feb 2023 14:30:00 +0800 Subject: [PATCH 12/51] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index ddf6ccb85b8..5a072442ae4 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ --- - - # Supabase [Supabase](https://supabase.com) is an open source Firebase alternative. We're building the features of Firebase using enterprise-grade open source tools. From ec13ef30836d613ba17ea26e5cf0ee9f13b33e80 Mon Sep 17 00:00:00 2001 From: "Jarlem Red J. de Peralta" Date: Wed, 8 Feb 2023 21:30:20 +0800 Subject: [PATCH 13/51] Rename all occurences of `invalid` to `fail` - `invalid` seems to be an invalid exported member of `@sveltejs/kit` - The most similar and appropriate method to use is [fail] - It may seem that `invalid` was the former name of `fail` method - but was renamed after `SvelteKit`'s recent official major release. - However I am not sure of that. [fail]: https://kit.svelte.dev/docs/modules#sveltejs-kit-fail --- apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx b/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx index bcdcef28fc2..7598037b2d8 100644 --- a/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx +++ b/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx @@ -257,7 +257,7 @@ Wrap an Action to check that the user has a valid session. If they're not logged ```ts title=src/routes/posts/+page.server.ts import type { Actions } from './$types' import { getSupabase } from '@supabase/auth-helpers-sveltekit' -import { error, invalid } from '@sveltejs/kit' +import { error, fail } from '@sveltejs/kit' export const actions: Actions = { createPost: async (event) => { @@ -276,7 +276,7 @@ export const actions: Actions = { .insert({ content }) if (createPostError) { - return invalid(500, { + return fail(500, { supabaseErrorMessage: createPostError.message, }) } @@ -293,7 +293,7 @@ If you try to submit a form with the action `?/createPost` without a valid sessi ```ts import type { Actions } from './$types' -import { invalid, redirect } from '@sveltejs/kit' +import { fail, redirect } from '@sveltejs/kit' import { getSupabase } from '@supabase/auth-helpers-sveltekit' import { AuthApiError } from '@supabase/supabase-js' @@ -313,14 +313,14 @@ export const actions: Actions = { if (error) { if (error instanceof AuthApiError && error.status === 400) { - return invalid(400, { + return fail(400, { error: 'Invalid credentials.', values: { email, }, }) } - return invalid(500, { + return fail(500, { error: 'Server error. Try again later.', values: { email, From dfdc0b9eda93b960485030dff3f311af195c3916 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Wed, 8 Feb 2023 22:36:44 -0330 Subject: [PATCH 14/51] Add is_platform check for running clippy locally --- apps/docs/.env.example | 1 - apps/docs/components/Clippy/Clippy.tsx | 3 ++- .../NavigationMenu/TopNavBarRef.tsx | 21 +++++++++++-------- apps/docs/lib/constants.ts | 1 + apps/docs/pages/_app.tsx | 20 +++++++++++++++--- 5 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 apps/docs/lib/constants.ts diff --git a/apps/docs/.env.example b/apps/docs/.env.example index 074fa5ced44..bbf747a73ef 100644 --- a/apps/docs/.env.example +++ b/apps/docs/.env.example @@ -1,5 +1,4 @@ # PUBLIC -NEXT_PUBLIC_NEW_DOCS=true NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321 NEXT_PUBLIC_SUPABASE_ANON_KEY= diff --git a/apps/docs/components/Clippy/Clippy.tsx b/apps/docs/components/Clippy/Clippy.tsx index 8a49e2a9306..10858f23fc7 100644 --- a/apps/docs/components/Clippy/Clippy.tsx +++ b/apps/docs/components/Clippy/Clippy.tsx @@ -2,6 +2,7 @@ import { useTheme } from 'common/Providers' import Image from 'next/image' import { FC } from 'react' import { createPortal } from 'react-dom' +import { IS_PLATFORM } from '~/lib/constants' import clippyImageDark from '../../public/img/clippy-dark.png' import clippyImage from '../../public/img/clippy.png' import ClippyBubble from './ClippyBubble' @@ -24,7 +25,7 @@ const Clippy: FC = () => { */} )} - {isOpen && createPortal(, document.body)} + {isOpen && IS_PLATFORM && createPortal(, document.body)} ) } diff --git a/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx b/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx index 2fd9b545aa8..8d412d0fae1 100644 --- a/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx @@ -11,6 +11,7 @@ import clippyImage from '../../../public/img/clippy.png' import { getPageType } from '~/lib/helpers' import { useClippy } from '~/components/Clippy/ClippyProvider' +import { IS_PLATFORM } from '~/lib/constants' const TopNavBarRef: FC = () => { const { isDarkMode, toggleTheme } = useTheme() @@ -118,15 +119,17 @@ const TopNavBarRef: FC = () => { -
- Clippy -
+ {IS_PLATFORM && ( +
+ Clippy +
+ )}
- - ))} + {questions.map((question) => { + const key = question.replace(/\s+/g, '_') + return ( +
  • + +
  • + ) + })}
    diff --git a/apps/docs/internals/getSecrets.js b/apps/docs/internals/getSecrets.js new file mode 100644 index 00000000000..4782a3f1ed5 --- /dev/null +++ b/apps/docs/internals/getSecrets.js @@ -0,0 +1,35 @@ +// for internal supabase use only +const fs = require('fs/promises') +const AWS = require('aws-sdk') + +const secretName = 'local/docs' +const region = 'ap-southeast-2' + +const getSecrets = async (name, region) => { + try { + AWS.config.update({ region }) + const secretsmanager = new AWS.SecretsManager() + + const data = await secretsmanager + .getSecretValue({ + SecretId: name, + }) + .promise() + + if (!data.SecretString) { + throw new Error('Secrets not found') + } + return JSON.parse(data.SecretString) + } catch (err) { + console.log('Error getting secrets', err) + } +} + +// gets secrets from secrets manager and writes it to .env.local file +getSecrets(secretName, region).then(async (secrets) => { + let secretContent = '' + for (const [secretKey, secretValue] of Object.entries(secrets)) { + secretContent += `${secretKey}="${secretValue}"\n` + } + await fs.writeFile('.env.local', secretContent.trim()) +}) diff --git a/apps/docs/layouts/SiteLayout.tsx b/apps/docs/layouts/SiteLayout.tsx index d1f37b40d1b..54f19ce5350 100644 --- a/apps/docs/layouts/SiteLayout.tsx +++ b/apps/docs/layouts/SiteLayout.tsx @@ -10,6 +10,7 @@ import { memo, useEffect } from 'react' import Clippy from '~/components/Clippy/Clippy' import Footer from '~/components/Navigation/Footer' import { menuState, useMenuLevelId, useMenuMobileOpen } from '~/hooks/useMenuState' +import { IS_PLATFORM } from '~/lib/constants' const levelsData = { home: { @@ -340,7 +341,7 @@ const SiteLayout = ({ children }) => {
    - + {IS_PLATFORM && }
    diff --git a/apps/docs/package.json b/apps/docs/package.json index a8c42541d9e..717e8d05d28 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -4,6 +4,7 @@ "private": true, "scripts": { "dev": "next dev --port 3001", + "dev:secrets:pull": "AWS_PROFILE=supabase-dev node internals/getSecrets.js", "build": "npm run generate:all && next build", "start": "next start", "lint": "next lint", diff --git a/package-lock.json b/package-lock.json index 78869d57003..a6edd4e1b58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "dependencies": { "@code-hike/mdx": "^0.7.4", "@mdx-js/react": "^2.1.1", + "aws-sdk": "^2.1315.0", "mdx-mermaid": "^1.3.2", "mermaid": "^9.2.2", "mini-svg-data-uri": "^1.4.4" @@ -12171,7 +12172,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -12216,10 +12216,9 @@ } }, "node_modules/aws-sdk": { - "version": "2.1275.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1275.0.tgz", - "integrity": "sha512-GP7oS0BTh012pAMnNSVVQQrhfubeLH2moLUQQiuk9cPrqQYeP74BU3nnALM30CoFNzX+DwLanOeFU+KMfUGLHg==", - "dev": true, + "version": "2.1315.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1315.0.tgz", + "integrity": "sha512-fDlK3iqA0bpXW6azVBAB8RTKhJ5YUjfe6sqKQF1lKT2cYT5qU4rtH5qUlMixlWkb8oKeSMA2voW3wZZtSpBFKQ==", "dependencies": { "buffer": "4.9.2", "events": "1.1.1", @@ -12240,7 +12239,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", "integrity": "sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw==", - "dev": true, "engines": { "node": ">=0.4.x" } @@ -12248,20 +12246,17 @@ "node_modules/aws-sdk/node_modules/ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, "node_modules/aws-sdk/node_modules/punycode": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", - "dev": true + "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==" }, "node_modules/aws-sdk/node_modules/url": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", "integrity": "sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ==", - "dev": true, "dependencies": { "punycode": "1.3.2", "querystring": "0.2.0" @@ -12271,7 +12266,6 @@ "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dev": true, "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -12284,7 +12278,6 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz", "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==", - "dev": true, "bin": { "uuid": "dist/bin/uuid" } @@ -18831,7 +18824,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, "dependencies": { "is-callable": "^1.1.3" } @@ -19494,7 +19486,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -20851,7 +20842,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -21079,7 +21069,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -21306,7 +21295,6 @@ "version": "1.1.10", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", - "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -23319,7 +23307,6 @@ "version": "0.16.0", "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz", "integrity": "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==", - "dev": true, "engines": { "node": ">= 0.6.0" } @@ -33770,8 +33757,7 @@ "node_modules/sax": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", - "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", - "dev": true + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==" }, "node_modules/saxes": { "version": "5.0.1", @@ -38229,7 +38215,6 @@ "version": "1.1.9", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", - "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -38377,7 +38362,6 @@ "version": "0.4.19", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", - "dev": true, "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~9.0.1" @@ -38387,7 +38371,6 @@ "version": "9.0.7", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", "integrity": "sha512-7YXTQc3P2l9+0rjaUbLwMKRhtmwg1M1eDf6nag7urC7pIPYLD9W/jmzQ4ptRSUbodw5S0jfoGTflLemQibSpeQ==", - "dev": true, "engines": { "node": ">=4.0" } @@ -46181,7 +46164,7 @@ "@sinclair/typebox": "^0.25.1", "pg": "^8.7.1", "pg-format": "^1.0.4", - "pgsql-parser": "^13.3.0", + "pgsql-parser": "13.4.0", "postgres-array": "^3.0.1", "prettier": "^2.6.0", "prettier-plugin-sql": "^0.12.1" @@ -47977,8 +47960,7 @@ "available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" }, "awesome-debounce-promise": { "version": "2.1.0", @@ -48005,10 +47987,9 @@ } }, "aws-sdk": { - "version": "2.1275.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1275.0.tgz", - "integrity": "sha512-GP7oS0BTh012pAMnNSVVQQrhfubeLH2moLUQQiuk9cPrqQYeP74BU3nnALM30CoFNzX+DwLanOeFU+KMfUGLHg==", - "dev": true, + "version": "2.1315.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1315.0.tgz", + "integrity": "sha512-fDlK3iqA0bpXW6azVBAB8RTKhJ5YUjfe6sqKQF1lKT2cYT5qU4rtH5qUlMixlWkb8oKeSMA2voW3wZZtSpBFKQ==", "requires": { "buffer": "4.9.2", "events": "1.1.1", @@ -48025,26 +48006,22 @@ "events": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw==", - "dev": true + "integrity": "sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw==" }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, "punycode": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", - "dev": true + "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==" }, "url": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", "integrity": "sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ==", - "dev": true, "requires": { "punycode": "1.3.2", "querystring": "0.2.0" @@ -48054,7 +48031,6 @@ "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dev": true, "requires": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -48066,8 +48042,7 @@ "uuid": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz", - "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==", - "dev": true + "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==" } } }, @@ -53704,7 +53679,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, "requires": { "is-callable": "^1.1.3" } @@ -54172,7 +54146,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, "requires": { "get-intrinsic": "^1.1.3" } @@ -55170,7 +55143,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -55327,7 +55299,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -55474,7 +55445,6 @@ "version": "1.1.10", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", - "dev": true, "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -57131,8 +57101,7 @@ "jmespath": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz", - "integrity": "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==", - "dev": true + "integrity": "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==" }, "join-component": { "version": "1.1.0", @@ -64799,8 +64768,7 @@ "sax": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", - "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==", - "dev": true + "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==" }, "saxes": { "version": "5.0.1", @@ -68874,7 +68842,6 @@ "version": "1.1.9", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", - "dev": true, "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -69154,7 +69121,6 @@ "version": "0.4.19", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", - "dev": true, "requires": { "sax": ">=0.6.0", "xmlbuilder": "~9.0.1" @@ -69163,8 +69129,7 @@ "xmlbuilder": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", - "integrity": "sha512-7YXTQc3P2l9+0rjaUbLwMKRhtmwg1M1eDf6nag7urC7pIPYLD9W/jmzQ4ptRSUbodw5S0jfoGTflLemQibSpeQ==", - "dev": true + "integrity": "sha512-7YXTQc3P2l9+0rjaUbLwMKRhtmwg1M1eDf6nag7urC7pIPYLD9W/jmzQ4ptRSUbodw5S0jfoGTflLemQibSpeQ==" }, "xmlchars": { "version": "2.2.0", diff --git a/package.json b/package.json index 27c148a2ab9..9d5a7d60242 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "dependencies": { "@code-hike/mdx": "^0.7.4", "@mdx-js/react": "^2.1.1", + "aws-sdk": "^2.1315.0", "mdx-mermaid": "^1.3.2", "mermaid": "^9.2.2", "mini-svg-data-uri": "^1.4.4" From fd7e4bf8eb33fb01d37e82f8b99089e3f12b179c Mon Sep 17 00:00:00 2001 From: Brandon Scott Date: Wed, 15 Feb 2023 10:32:29 -0500 Subject: [PATCH 19/51] docs: fix typos in developer contributing doc --- DEVELOPERS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DEVELOPERS.md b/DEVELOPERS.md index 0281b1b0bd7..1845aa29ca5 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -57,7 +57,7 @@ To contribute code to [Supabase](https://supabase.com), you must fork the [Supab [Supabase](https://supabase.com) uses [Turborepo](https://turborepo.org/docs) to manage and run this monorepo. -1. Install the dependences in the root of the repo. +1. Install the dependencies in the root of the repo. ```sh npm install # install dependencies @@ -113,7 +113,7 @@ Following the changes to the [Supabase docs](https://supabase.com/blog/new-supab - Inside of `apps/docs` create a `.env.local` file with the following: `NEXT_PUBLIC_NEW_DOCS=true` -Now when you run a local devlopment docs server you will see the new docs site. +Now when you run a local development docs server you will see the new docs site. --- From 6432786c76981a231d838a4e62b50312f632ea1d Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Wed, 15 Feb 2023 14:38:33 -0330 Subject: [PATCH 20/51] Add links to extensions --- apps/docs/components/Extensions.tsx | 6 ++++-- apps/docs/data/extensions.json | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/apps/docs/components/Extensions.tsx b/apps/docs/components/Extensions.tsx index 0175afe77a5..7391e2d5456 100644 --- a/apps/docs/components/Extensions.tsx +++ b/apps/docs/components/Extensions.tsx @@ -16,7 +16,9 @@ type extension = { function getUniqueTags(json: extension[]) { const tags = [] for (const item of json) { - tags.push(...item.tags) + if (item.tags) { + tags.push(...item.tags) + } } return [...new Set(tags)] } @@ -51,7 +53,7 @@ export default function Extensions() {

    Filter