The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Prettier
Copple70c899f0c0a1
diff --git a/apps/reference/_supabase_js/intro.md b/apps/reference/_supabase_js/intro.mdindex fe06a7c4081..71fb483119a 100644--- a/apps/reference/_supabase_js/intro.md+++ b/apps/reference/_supabase_js/intro.md@@ -15,7 +15,7 @@ Refer to the `v1` docs for a stable release.:::-This reference documents every object and method available in Supabase's isomorphic JavaScript library, `supabase-js`.+This reference documents every object and method available in Supabase's isomorphic JavaScript library, `supabase-js`.You can use the `supabase-js` library to:@@ -29,4 +29,4 @@ You can use the `supabase-js` library to:- GitHub: [supabase/supabase-js](https://github.com/supabase/supabase-js)- TypeDoc: [supabase.github.io/supabase-js](https://supabase.github.io/supabase-js)-- NPM: [npmjs.com/package/@supabase/supabase-js](https://www.npmjs.com/package/@supabase/supabase-js)\ No newline at end of file+- NPM: [npmjs.com/package/@supabase/supabase-js](https://www.npmjs.com/package/@supabase/supabase-js)diff --git a/apps/reference/_supabase_js/release-notes.md b/apps/reference/_supabase_js/release-notes.mdindex debbcbdf09e..c566dc1f89f 100644--- a/apps/reference/_supabase_js/release-notes.md+++ b/apps/reference/_supabase_js/release-notes.md@@ -8,4 +8,4 @@ Supabase.js v2 release## 2.0.0-TBD\ No newline at end of file+TBDdiff --git a/apps/reference/_supabase_js/working-with-types.md b/apps/reference/_supabase_js/working-with-types.mdindex b2a95a79958..a5c8900b532 100644--- a/apps/reference/_supabase_js/working-with-types.md+++ b/apps/reference/_supabase_js/working-with-types.md@@ -6,7 +6,6 @@ id: typescript-support`supabase-js` supports Typescript.-## Generating typesYou can use our CLI to generate types:@@ -19,33 +18,30 @@ supabase gen types typescript --local > lib/database.types.tsThese types are generated directly from your database. Given a table `public.movies`, the definition will provide the following data:```ts-interface Database {public: {Tables: {movies: {- Row: {} // The data expected to be returned from a "select" statement.- Insert: {} // The data expected passed to an "insert" statement.- Update: {} // The data expected passed to an "update" statement.+ Row: {} // The data expected to be returned from a "select" statement.+ Insert: {} // The data expected passed to an "insert" statement.+ Update: {} // The data expected passed to an "update" statement.}}}}-```-There is a different between `selects`, `inserts`, and `updates`, because often you will set default values in your database for specific columns.+There is a different between `selects`, `inserts`, and `updates`, because often you will set default values in your database for specific columns.With default values you do not need to send any data over the network, even if that column is a "required" field. Our type system is granularenough to handle these situations.-## Injecting type definitionsYou can enrich the supabase client with the types you generated with Supabase.```ts-import { createClient } from "@supabase/supabase-js"-import { Database } from "lib/database.types"+import { createClient } from '@supabase/supabase-js'+import { Database } from 'lib/database.types'const supabase = createClient<Database>(process.env.SUPABASE_URL,@@ -58,36 +54,31 @@ const supabase = createClient<Database>(`supabase-js` always returns a `data` object (for success), and an `error` response (for unsuccessful requests).This provides a simple interface to get the relevant types returned from any function:-```tsexport async function getMovies() {- return await supabase.from("movies")- .select(`id, title`)+ return await supabase.from('movies').select(`id, title`)}type MoviesResponse = Awaited<ReturnType<typeof getMovies>>-export type MoviesResponseSuccess = MoviesResponse["data"]-export type MoviesResponseError = MoviesResponse["error"]+export type MoviesResponseSuccess = MoviesResponse['data']+export type MoviesResponseError = MoviesResponse['error']```## Nested tables-For advanced queries such as nested tables, you may want to construct your own types.+For advanced queries such as nested tables, you may want to construct your own types.```ts-import supabase from "~/lib/supabase"-import type { Database } from "~/lib/database.types"-+import supabase from '~/lib/supabase'+import type { Database } from '~/lib/database.types'async function getMovies() {- return await supabase.from('movies')- .select('id, title, actors(*)')+ return await supabase.from('movies').select('id, title, actors(*)')}--type actors = Database["public"]["Tables"]["actors"]["Row"]+type actors = Database['public']['Tables']['actors']['Row']type MoviesResponse = Awaited<ReturnType<typeof getMovies>>-type MoviesResponseSuccess = MoviesResponse["data"] & {- actors: actors[]+type MoviesResponseSuccess = MoviesResponse['data'] & {+ actors: actors[]}-```\ No newline at end of file+```diff --git a/apps/reference/_supabase_js_versioned_docs/version-v1/intro.md b/apps/reference/_supabase_js_versioned_docs/version-v1/intro.mdindex ae4b49a28d4..c076ac88b67 100644--- a/apps/reference/_supabase_js_versioned_docs/version-v1/intro.md+++ b/apps/reference/_supabase_js_versioned_docs/version-v1/intro.md@@ -5,7 +5,7 @@ slug: /sidebar_label: Supabase JavaScript Library----This reference documents every object and method available in Supabase's isomorphic JavaScript library, `supabase-js`.+This reference documents every object and method available in Supabase's isomorphic JavaScript library, `supabase-js`.You can use the `supabase-js` library to:@@ -13,4 +13,4 @@ You can use the `supabase-js` library to:- listen to database changes- invoke Deno Edge Functions- build login and user management functionality-- manage large files\ No newline at end of file+- manage large filesdiff --git a/apps/reference/docusaurus.config.js b/apps/reference/docusaurus.config.jsindex 7c2e594f2bb..131e32cc53c 100644--- a/apps/reference/docusaurus.config.js+++ b/apps/reference/docusaurus.config.js@@ -17,7 +17,7 @@ const config = {// onBrokenLinks: 'throw',onBrokenMarkdownLinks: 'warn',favicon: '/favicon.ico',- themes: ['docusaurus-theme-search-typesense'],+ // themes: ['docusaurus-theme-search-typesense'],// GitHub pages deployment config.// If you aren't using GitHub pages, you don't need these.@@ -239,26 +239,26 @@ const config = {darkTheme: darkCodeTheme,},- typesense: {- typesenseCollectionName: 'supabase', // Replace with your own doc site's name. Should match the collection name in the scraper settings.+ // typesense: {+ // typesenseCollectionName: 'supabase', // Replace with your own doc site's name. Should match the collection name in the scraper settings.- typesenseServerConfig: {- nodes: [- {- host: 'doc-search.supabase.com',- port: 443,- protocol: 'https',- },- ],- apiKey: 't0HAJQy4KtcMk3aYGnm8ONqab2oAysJz',- },+ // typesenseServerConfig: {+ // nodes: [+ // {+ // host: 'doc-search.supabase.com',+ // port: 443,+ // protocol: 'https',+ // },+ // ],+ // apiKey: 't0HAJQy4KtcMk3aYGnm8ONqab2oAysJz',+ // },- // Optional: Typesense search parameters: https://typesense.org/docs/0.21.0/api/documents.md#search-parameters- typesenseSearchParameters: {},+ // // Optional: Typesense search parameters: https://typesense.org/docs/0.21.0/api/documents.md#search-parameters+ // typesenseSearchParameters: {},- // Optional- contextualSearch: true,- },+ // // Optional+ // contextualSearch: true,+ // },}),}