From 6db6f66f98e783f62ba62fb998806107ca5b7b04 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Oct 2022 15:07:26 +0700 Subject: [PATCH 01/10] Added version header, updated generate scripts --- apps/temp-docs/.gitignore | 2 +- .../components/Navigation/NavBar.tsx | 45 ++- ...v.constants.ts => Navigation.constants.ts} | 34 ++- .../components/Navigation/Navigation.types.ts | 22 ++ .../components/Navigation/SideBar.tsx | 13 +- .../{authProviders.js => authProviders.ts} | 0 apps/temp-docs/data/nav/README.md | 27 ++ apps/temp-docs/data/nav/auth-server.ts | 1 + .../data/nonGeneratedReferencePages.ts | 26 ++ .../docs/dart/auth-onauthstatechange.mdx | 72 ----- apps/temp-docs/docs/dart/auth-session.mdx | 66 ----- apps/temp-docs/docs/dart/auth-signin.mdx | 103 ------- .../docs/dart/auth-signinwithprovider.mdx | 129 --------- apps/temp-docs/docs/dart/auth-signout.mdx | 70 ----- apps/temp-docs/docs/dart/auth-signup.mdx | 62 ---- apps/temp-docs/docs/dart/auth-update.mdx | 76 ----- apps/temp-docs/docs/dart/auth-user.mdx | 66 ----- apps/temp-docs/docs/dart/containedby.mdx | 145 ---------- apps/temp-docs/docs/dart/contains.mdx | 145 ---------- apps/temp-docs/docs/dart/delete.mdx | 76 ----- apps/temp-docs/docs/dart/eq.mdx | 146 ---------- apps/temp-docs/docs/dart/filter.mdx | 170 ----------- apps/temp-docs/docs/dart/getsubscriptions.mdx | 66 ----- apps/temp-docs/docs/dart/gt.mdx | 146 ---------- apps/temp-docs/docs/dart/gte.mdx | 146 ---------- apps/temp-docs/docs/dart/ilike.mdx | 146 ---------- apps/temp-docs/docs/dart/in_.mdx | 148 ---------- apps/temp-docs/docs/dart/index.mdx | 12 - apps/temp-docs/docs/dart/initializing.mdx | 84 ------ apps/temp-docs/docs/dart/insert.mdx | 102 ------- apps/temp-docs/docs/dart/installing.mdx | 32 --- apps/temp-docs/docs/dart/is_.mdx | 148 ---------- apps/temp-docs/docs/dart/like.mdx | 191 ------------ apps/temp-docs/docs/dart/limit.mdx | 99 ------- apps/temp-docs/docs/dart/lt.mdx | 146 ---------- apps/temp-docs/docs/dart/lte.mdx | 191 ------------ apps/temp-docs/docs/dart/match.mdx | 146 ---------- apps/temp-docs/docs/dart/neq.mdx | 146 ---------- apps/temp-docs/docs/dart/not.mdx | 146 ---------- apps/temp-docs/docs/dart/or.mdx | 98 ------- apps/temp-docs/docs/dart/order.mdx | 99 ------- apps/temp-docs/docs/dart/overlaps.mdx | 145 ---------- apps/temp-docs/docs/dart/range.mdx | 74 ----- apps/temp-docs/docs/dart/rangeadjacent.mdx | 145 ---------- apps/temp-docs/docs/dart/rangegt.mdx | 145 ---------- apps/temp-docs/docs/dart/rangegte.mdx | 145 ---------- apps/temp-docs/docs/dart/rangelt.mdx | 145 ---------- apps/temp-docs/docs/dart/rangelte.mdx | 145 ---------- .../docs/dart/removesubscription.mdx | 67 ----- .../docs/dart/reset-password-email.mdx | 114 -------- apps/temp-docs/docs/dart/rpc.mdx | 119 -------- apps/temp-docs/docs/dart/select.mdx | 272 ------------------ apps/temp-docs/docs/dart/single.mdx | 74 ----- .../docs/dart/storage-createbucket.mdx | 73 ----- .../docs/dart/storage-deletebucket.mdx | 73 ----- .../docs/dart/storage-emptybucket.mdx | 73 ----- .../dart/storage-from-createsignedurl.mdx | 79 ----- .../docs/dart/storage-from-download.mdx | 75 ----- .../docs/dart/storage-from-getpublicurl.mdx | 62 ---- .../temp-docs/docs/dart/storage-from-list.mdx | 75 ----- .../temp-docs/docs/dart/storage-from-move.mdx | 75 ----- .../docs/dart/storage-from-remove.mdx | 75 ----- .../docs/dart/storage-from-update.mdx | 83 ------ .../docs/dart/storage-from-upload.mdx | 152 ---------- .../temp-docs/docs/dart/storage-getbucket.mdx | 97 ------- .../docs/dart/storage-listbuckets.mdx | 73 ----- .../docs/dart/storage-updatebucket.mdx | 73 ----- apps/temp-docs/docs/dart/stream.mdx | 147 ---------- apps/temp-docs/docs/dart/subscribe.mdx | 237 --------------- apps/temp-docs/docs/dart/textsearch.mdx | 147 ---------- apps/temp-docs/docs/dart/update.mdx | 109 ------- apps/temp-docs/docs/dart/upsert.mdx | 128 --------- apps/temp-docs/docs/dart/using-filters.mdx | 44 --- apps/temp-docs/docs/dart/using-modifiers.mdx | 13 - .../docs/postgres/changing-timezones.mdx | 119 -------- apps/temp-docs/docs/postgres/columns.mdx | 95 ------ .../docs/postgres/connection-strings.mdx | 135 --------- .../docs/postgres/database-passwords.mdx | 53 ---- .../docs/postgres/database-users.mdx | 53 ---- apps/temp-docs/docs/postgres/index.mdx | 15 - apps/temp-docs/docs/postgres/publications.mdx | 210 -------------- apps/temp-docs/docs/postgres/schemas.mdx | 114 -------- apps/temp-docs/docs/postgres/tables.mdx | 161 ----------- apps/temp-docs/docs/reference/api.mdx | 37 +++ .../docs/reference/api/release-notes.mdx | 12 + apps/temp-docs/docs/reference/auth.mdx | 22 ++ .../auth/release-notes.mdx} | 0 apps/temp-docs/docs/reference/cli.mdx | 29 ++ apps/temp-docs/docs/reference/cli/.gitkeep | 0 apps/temp-docs/docs/reference/cli/about.mdx | 25 -- .../docs/reference/cli/config-reference.mdx | 35 --- apps/temp-docs/docs/reference/cli/index.mdx | 27 -- .../docs/reference/cli/release-notes.mdx | 7 + .../cli/supabase-db-branch-create.mdx | 16 -- .../cli/supabase-db-branch-delete.mdx | 16 -- .../reference/cli/supabase-db-branch-list.mdx | 16 -- .../reference/cli/supabase-db-changes.mdx | 16 -- .../docs/reference/cli/supabase-db-commit.mdx | 16 -- .../docs/reference/cli/supabase-db-push.mdx | 16 -- .../cli/supabase-db-remote-commit.mdx | 16 -- .../reference/cli/supabase-db-remote-set.mdx | 16 -- .../docs/reference/cli/supabase-db-reset.mdx | 16 -- .../docs/reference/cli/supabase-db-switch.mdx | 16 -- .../docs/reference/cli/supabase-eject.mdx | 17 -- .../docs/reference/cli/supabase-help.mdx | 17 -- .../docs/reference/cli/supabase-init.mdx | 16 -- .../reference/cli/supabase-migration-new.mdx | 16 -- .../docs/reference/cli/supabase-start.mdx | 16 -- .../docs/reference/cli/supabase-stop.mdx | 15 - apps/temp-docs/docs/reference/dart/.gitkeep | 0 .../reference/dart/auth-onauthstatechange.mdx | 72 ----- .../docs/reference/dart/auth-session.mdx | 66 ----- .../docs/reference/dart/auth-signin.mdx | 103 ------- .../dart/auth-signinwithprovider.mdx | 129 --------- .../docs/reference/dart/auth-signout.mdx | 70 ----- .../docs/reference/dart/auth-signup.mdx | 62 ---- .../docs/reference/dart/auth-update.mdx | 76 ----- .../docs/reference/dart/auth-user.mdx | 66 ----- .../docs/reference/dart/containedby.mdx | 145 ---------- .../docs/reference/dart/contains.mdx | 145 ---------- apps/temp-docs/docs/reference/dart/delete.mdx | 76 ----- apps/temp-docs/docs/reference/dart/eq.mdx | 146 ---------- apps/temp-docs/docs/reference/dart/filter.mdx | 170 ----------- .../docs/reference/dart/getsubscriptions.mdx | 66 ----- apps/temp-docs/docs/reference/dart/gt.mdx | 146 ---------- apps/temp-docs/docs/reference/dart/gte.mdx | 146 ---------- apps/temp-docs/docs/reference/dart/ilike.mdx | 146 ---------- apps/temp-docs/docs/reference/dart/in_.mdx | 148 ---------- apps/temp-docs/docs/reference/dart/index.mdx | 12 - .../docs/reference/dart/initializing.mdx | 84 ------ apps/temp-docs/docs/reference/dart/insert.mdx | 102 ------- .../docs/reference/dart/installing.mdx | 32 --- apps/temp-docs/docs/reference/dart/is_.mdx | 148 ---------- apps/temp-docs/docs/reference/dart/like.mdx | 191 ------------ apps/temp-docs/docs/reference/dart/limit.mdx | 99 ------- apps/temp-docs/docs/reference/dart/lt.mdx | 146 ---------- apps/temp-docs/docs/reference/dart/lte.mdx | 191 ------------ apps/temp-docs/docs/reference/dart/match.mdx | 146 ---------- apps/temp-docs/docs/reference/dart/neq.mdx | 146 ---------- apps/temp-docs/docs/reference/dart/not.mdx | 146 ---------- apps/temp-docs/docs/reference/dart/or.mdx | 98 ------- apps/temp-docs/docs/reference/dart/order.mdx | 99 ------- .../docs/reference/dart/overlaps.mdx | 145 ---------- apps/temp-docs/docs/reference/dart/range.mdx | 74 ----- .../docs/reference/dart/rangeadjacent.mdx | 145 ---------- .../temp-docs/docs/reference/dart/rangegt.mdx | 145 ---------- .../docs/reference/dart/rangegte.mdx | 145 ---------- .../temp-docs/docs/reference/dart/rangelt.mdx | 145 ---------- .../docs/reference/dart/rangelte.mdx | 145 ---------- .../reference/dart/removesubscription.mdx | 67 ----- .../reference/dart/reset-password-email.mdx | 114 -------- apps/temp-docs/docs/reference/dart/rpc.mdx | 119 -------- apps/temp-docs/docs/reference/dart/select.mdx | 272 ------------------ apps/temp-docs/docs/reference/dart/single.mdx | 74 ----- .../reference/dart/storage-createbucket.mdx | 73 ----- .../reference/dart/storage-deletebucket.mdx | 73 ----- .../reference/dart/storage-emptybucket.mdx | 73 ----- .../dart/storage-from-createsignedurl.mdx | 79 ----- .../reference/dart/storage-from-download.mdx | 75 ----- .../dart/storage-from-getpublicurl.mdx | 62 ---- .../docs/reference/dart/storage-from-list.mdx | 75 ----- .../docs/reference/dart/storage-from-move.mdx | 75 ----- .../reference/dart/storage-from-remove.mdx | 75 ----- .../reference/dart/storage-from-update.mdx | 83 ------ .../reference/dart/storage-from-upload.mdx | 152 ---------- .../docs/reference/dart/storage-getbucket.mdx | 97 ------- .../reference/dart/storage-listbuckets.mdx | 73 ----- .../reference/dart/storage-updatebucket.mdx | 73 ----- apps/temp-docs/docs/reference/dart/stream.mdx | 147 ---------- .../docs/reference/dart/subscribe.mdx | 237 --------------- .../docs/reference/dart/textsearch.mdx | 147 ---------- apps/temp-docs/docs/reference/dart/update.mdx | 109 ------- apps/temp-docs/docs/reference/dart/upsert.mdx | 128 --------- .../docs/reference/dart/using-filters.mdx | 44 --- .../docs/reference/dart/using-modifiers.mdx | 13 - apps/temp-docs/docs/reference/dart/v0.mdx | 26 ++ .../docs/reference/javascript/v1.mdx | 20 ++ .../javascript/v1/generating-types.mdx | 42 +++ .../reference/javascript/v1/initializing.mdx | 151 ++++++++++ .../reference/javascript/v1/installing.mdx | 37 +++ apps/temp-docs/docs/reference/storage.mdx | 28 ++ .../docs/reference/storage/release-notes.mdx | 7 + apps/temp-docs/layouts/Default.tsx | 21 +- apps/temp-docs/layouts/Guide.tsx | 3 +- apps/temp-docs/lib/docs.ts | 35 ++- apps/temp-docs/lib/helpers.ts | 8 +- apps/temp-docs/package.json | 27 +- apps/temp-docs/pages/[...slug].tsx | 29 +- apps/temp-docs/pages/index.tsx | 4 +- 189 files changed, 643 insertions(+), 15713 deletions(-) rename apps/temp-docs/components/Navigation/{Nav.constants.ts => Navigation.constants.ts} (96%) create mode 100644 apps/temp-docs/components/Navigation/Navigation.types.ts rename apps/temp-docs/data/{authProviders.js => authProviders.ts} (100%) create mode 100644 apps/temp-docs/data/nav/README.md create mode 100644 apps/temp-docs/data/nonGeneratedReferencePages.ts delete mode 100644 apps/temp-docs/docs/dart/auth-onauthstatechange.mdx delete mode 100644 apps/temp-docs/docs/dart/auth-session.mdx delete mode 100644 apps/temp-docs/docs/dart/auth-signin.mdx delete mode 100644 apps/temp-docs/docs/dart/auth-signinwithprovider.mdx delete mode 100644 apps/temp-docs/docs/dart/auth-signout.mdx delete mode 100644 apps/temp-docs/docs/dart/auth-signup.mdx delete mode 100644 apps/temp-docs/docs/dart/auth-update.mdx delete mode 100644 apps/temp-docs/docs/dart/auth-user.mdx delete mode 100644 apps/temp-docs/docs/dart/containedby.mdx delete mode 100644 apps/temp-docs/docs/dart/contains.mdx delete mode 100644 apps/temp-docs/docs/dart/delete.mdx delete mode 100644 apps/temp-docs/docs/dart/eq.mdx delete mode 100644 apps/temp-docs/docs/dart/filter.mdx delete mode 100644 apps/temp-docs/docs/dart/getsubscriptions.mdx delete mode 100644 apps/temp-docs/docs/dart/gt.mdx delete mode 100644 apps/temp-docs/docs/dart/gte.mdx delete mode 100644 apps/temp-docs/docs/dart/ilike.mdx delete mode 100644 apps/temp-docs/docs/dart/in_.mdx delete mode 100644 apps/temp-docs/docs/dart/index.mdx delete mode 100644 apps/temp-docs/docs/dart/initializing.mdx delete mode 100644 apps/temp-docs/docs/dart/insert.mdx delete mode 100644 apps/temp-docs/docs/dart/installing.mdx delete mode 100644 apps/temp-docs/docs/dart/is_.mdx delete mode 100644 apps/temp-docs/docs/dart/like.mdx delete mode 100644 apps/temp-docs/docs/dart/limit.mdx delete mode 100644 apps/temp-docs/docs/dart/lt.mdx delete mode 100644 apps/temp-docs/docs/dart/lte.mdx delete mode 100644 apps/temp-docs/docs/dart/match.mdx delete mode 100644 apps/temp-docs/docs/dart/neq.mdx delete mode 100644 apps/temp-docs/docs/dart/not.mdx delete mode 100644 apps/temp-docs/docs/dart/or.mdx delete mode 100644 apps/temp-docs/docs/dart/order.mdx delete mode 100644 apps/temp-docs/docs/dart/overlaps.mdx delete mode 100644 apps/temp-docs/docs/dart/range.mdx delete mode 100644 apps/temp-docs/docs/dart/rangeadjacent.mdx delete mode 100644 apps/temp-docs/docs/dart/rangegt.mdx delete mode 100644 apps/temp-docs/docs/dart/rangegte.mdx delete mode 100644 apps/temp-docs/docs/dart/rangelt.mdx delete mode 100644 apps/temp-docs/docs/dart/rangelte.mdx delete mode 100644 apps/temp-docs/docs/dart/removesubscription.mdx delete mode 100644 apps/temp-docs/docs/dart/reset-password-email.mdx delete mode 100644 apps/temp-docs/docs/dart/rpc.mdx delete mode 100644 apps/temp-docs/docs/dart/select.mdx delete mode 100644 apps/temp-docs/docs/dart/single.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-createbucket.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-deletebucket.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-emptybucket.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-from-createsignedurl.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-from-download.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-from-getpublicurl.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-from-list.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-from-move.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-from-remove.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-from-update.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-from-upload.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-getbucket.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-listbuckets.mdx delete mode 100644 apps/temp-docs/docs/dart/storage-updatebucket.mdx delete mode 100644 apps/temp-docs/docs/dart/stream.mdx delete mode 100644 apps/temp-docs/docs/dart/subscribe.mdx delete mode 100644 apps/temp-docs/docs/dart/textsearch.mdx delete mode 100644 apps/temp-docs/docs/dart/update.mdx delete mode 100644 apps/temp-docs/docs/dart/upsert.mdx delete mode 100644 apps/temp-docs/docs/dart/using-filters.mdx delete mode 100644 apps/temp-docs/docs/dart/using-modifiers.mdx delete mode 100644 apps/temp-docs/docs/postgres/changing-timezones.mdx delete mode 100644 apps/temp-docs/docs/postgres/columns.mdx delete mode 100644 apps/temp-docs/docs/postgres/connection-strings.mdx delete mode 100644 apps/temp-docs/docs/postgres/database-passwords.mdx delete mode 100644 apps/temp-docs/docs/postgres/database-users.mdx delete mode 100644 apps/temp-docs/docs/postgres/index.mdx delete mode 100644 apps/temp-docs/docs/postgres/publications.mdx delete mode 100644 apps/temp-docs/docs/postgres/schemas.mdx delete mode 100644 apps/temp-docs/docs/postgres/tables.mdx create mode 100644 apps/temp-docs/docs/reference/api.mdx create mode 100644 apps/temp-docs/docs/reference/api/release-notes.mdx create mode 100644 apps/temp-docs/docs/reference/auth.mdx rename apps/temp-docs/docs/{dart/.gitkeep => reference/auth/release-notes.mdx} (100%) create mode 100644 apps/temp-docs/docs/reference/cli.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/.gitkeep delete mode 100644 apps/temp-docs/docs/reference/cli/about.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/config-reference.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/index.mdx create mode 100644 apps/temp-docs/docs/reference/cli/release-notes.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-db-branch-create.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-db-branch-delete.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-db-branch-list.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-db-changes.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-db-commit.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-db-push.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-db-remote-commit.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-db-remote-set.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-db-reset.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-db-switch.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-eject.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-help.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-init.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-migration-new.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-start.mdx delete mode 100644 apps/temp-docs/docs/reference/cli/supabase-stop.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/.gitkeep delete mode 100644 apps/temp-docs/docs/reference/dart/auth-onauthstatechange.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/auth-session.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/auth-signin.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/auth-signinwithprovider.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/auth-signout.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/auth-signup.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/auth-update.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/auth-user.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/containedby.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/contains.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/delete.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/eq.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/filter.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/getsubscriptions.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/gt.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/gte.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/ilike.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/in_.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/index.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/initializing.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/insert.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/installing.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/is_.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/like.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/limit.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/lt.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/lte.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/match.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/neq.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/not.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/or.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/order.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/overlaps.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/range.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/rangeadjacent.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/rangegt.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/rangegte.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/rangelt.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/rangelte.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/removesubscription.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/reset-password-email.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/rpc.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/select.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/single.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-createbucket.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-deletebucket.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-emptybucket.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-from-createsignedurl.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-from-download.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-from-getpublicurl.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-from-list.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-from-move.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-from-remove.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-from-update.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-from-upload.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-getbucket.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-listbuckets.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/storage-updatebucket.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/stream.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/subscribe.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/textsearch.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/update.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/upsert.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/using-filters.mdx delete mode 100644 apps/temp-docs/docs/reference/dart/using-modifiers.mdx create mode 100644 apps/temp-docs/docs/reference/dart/v0.mdx create mode 100644 apps/temp-docs/docs/reference/javascript/v1.mdx create mode 100644 apps/temp-docs/docs/reference/javascript/v1/generating-types.mdx create mode 100644 apps/temp-docs/docs/reference/javascript/v1/initializing.mdx create mode 100644 apps/temp-docs/docs/reference/javascript/v1/installing.mdx create mode 100644 apps/temp-docs/docs/reference/storage.mdx create mode 100644 apps/temp-docs/docs/reference/storage/release-notes.mdx diff --git a/apps/temp-docs/.gitignore b/apps/temp-docs/.gitignore index 820d2d9ff0a..f6ec88eea34 100644 --- a/apps/temp-docs/.gitignore +++ b/apps/temp-docs/.gitignore @@ -18,4 +18,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -**/*/generated \ No newline at end of file +**/*/generated/**/* \ No newline at end of file diff --git a/apps/temp-docs/components/Navigation/NavBar.tsx b/apps/temp-docs/components/Navigation/NavBar.tsx index e8a3f40e9be..4d35ee4d5e4 100644 --- a/apps/temp-docs/components/Navigation/NavBar.tsx +++ b/apps/temp-docs/components/Navigation/NavBar.tsx @@ -1,13 +1,26 @@ import Image from 'next/image' import Link from 'next/link' -import { useState, useEffect } from 'react' -import { IconMenu, IconSearch, Input, IconCommand, Button, IconMoon, IconSun } from 'ui' +import { useRouter } from 'next/router' +import { useState, useEffect, FC } from 'react' +import { IconMenu, IconSearch, Input, IconCommand, Button, IconMoon, IconSun, Listbox } from 'ui' import { useTheme } from '../Providers' -const NavBar = ({ currentPage }: { currentPage: string }) => { +interface Props { + currentPage: string + versions: string[] +} + +const NavBar: FC = ({ currentPage, versions }) => { const { isDarkMode, toggleTheme } = useTheme() const [mounted, setMounted] = useState(false) + const { asPath, push } = useRouter() + const pathSegments = asPath.split('/') + const library = pathSegments.length >= 3 ? pathSegments[2] : undefined + const version = versions.includes(pathSegments[pathSegments.indexOf(library) + 1]) + ? pathSegments[pathSegments.indexOf(library) + 1] + : versions[0] + useEffect(() => { setMounted(true) }, [isDarkMode]) @@ -25,6 +38,16 @@ const NavBar = ({ currentPage }: { currentPage: string }) => { document.documentElement.className = key === 'true' ? 'dark' : '' } + const onSelectVersion = (version: string) => { + // [Joshen] Ideally we use but this works for now + if (!library) return + if (version === versions[0]) { + push(`/reference/${library}`) + } else { + push(`/reference/${library}/${version}`) + } + } + return ( + {versions.length > 0 && ( +
+ + {versions.map((version) => ( + + {version} + + ))} + +
+ )}
diff --git a/apps/temp-docs/components/Navigation/Nav.constants.ts b/apps/temp-docs/components/Navigation/Navigation.constants.ts similarity index 96% rename from apps/temp-docs/components/Navigation/Nav.constants.ts rename to apps/temp-docs/components/Navigation/Navigation.constants.ts index 7a65550e57a..f573d630134 100644 --- a/apps/temp-docs/components/Navigation/Nav.constants.ts +++ b/apps/temp-docs/components/Navigation/Navigation.constants.ts @@ -7,19 +7,29 @@ import SupabaseAPINav from 'data/nav/supabase-api' import AuthServerNav from 'data/nav/auth-server' import StorageServerNav from 'data/nav/storage-server' -export interface NavMenu { - [key: string]: NavMenuGroup[] -} +import { NavMenu, References } from './Navigation.types' -export interface NavMenuGroup { - label: string - items: NavMenuSection[] -} - -export interface NavMenuSection { - name: string - url?: string - items: NavMenuSection[] +export const REFERENCES: References = { + javascript: { + name: 'supabase-js', + library: 'supabase-js', + icon: '/docs/img/libraries/javascript-icon.svg', + }, + dart: { + name: 'Flutter', + library: 'supabase-dart', + icon: '/docs/img/libraries/dart-icon.svg', + }, + cli: { + name: 'CLI', + library: undefined, + icon: '/docs/img/libraries/cli-icon.svg', + }, + api: { + name: 'API', + library: undefined, + icon: '/docs/img/libraries/api-icon.svg', + }, } export const menuItems: NavMenu = { diff --git a/apps/temp-docs/components/Navigation/Navigation.types.ts b/apps/temp-docs/components/Navigation/Navigation.types.ts new file mode 100644 index 00000000000..91617d172ff --- /dev/null +++ b/apps/temp-docs/components/Navigation/Navigation.types.ts @@ -0,0 +1,22 @@ +export interface NavMenu { + [key: string]: NavMenuGroup[] +} + +export interface NavMenuGroup { + label: string + items: NavMenuSection[] +} + +export interface NavMenuSection { + name: string + url?: string + items: NavMenuSection[] +} + +export interface References { + [key: string]: { + name: string + library?: string + icon: string + } +} diff --git a/apps/temp-docs/components/Navigation/SideBar.tsx b/apps/temp-docs/components/Navigation/SideBar.tsx index 96c0bbc4721..19285ac73cc 100644 --- a/apps/temp-docs/components/Navigation/SideBar.tsx +++ b/apps/temp-docs/components/Navigation/SideBar.tsx @@ -2,7 +2,8 @@ import Link from 'next/link' import Image from 'next/image' import { useRouter } from 'next/router' import { IconChevronRight, IconArrowLeft } from '~/../../packages/ui' -import { NavMenuGroup, NavMenuSection } from './Nav.constants' +import { REFERENCES } from './Navigation.constants' +import { NavMenuGroup, NavMenuSection } from './Navigation.types' import * as Accordion from '@radix-ui/react-accordion' const SideBar = ({ menuItems = [] }: { menuItems: any }) => { @@ -10,13 +11,7 @@ const SideBar = ({ menuItems = [] }: { menuItems: any }) => { const pathSegments = asPath.split('/') const isInReferencePages = pathSegments.includes('reference') && pathSegments.length >= 3 - const references = { - javascript: { name: 'supabase-js', icon: '/docs/img/libraries/javascript-icon.svg' }, - dart: { name: 'Flutter', icon: '/docs/img/libraries/dart-icon.svg' }, - cli: { name: 'CLI', icon: '/docs/img/libraries/cli-icon.svg' }, - api: { name: 'API', icon: '/docs/img/libraries/api-icon.svg' }, - } - const referenceMeta = pathSegments.length >= 3 ? references[pathSegments[2]] : undefined + const referenceMeta = pathSegments.length >= 3 ? REFERENCES[pathSegments[2]] : undefined const currentSection: NavMenuGroup = menuItems.find((group) => { const foundItem = group.items.find((section) => { @@ -45,8 +40,6 @@ const SideBar = ({ menuItems = [] }: { menuItems: any }) => { }) : undefined - console.log({ currentSection, currentSubSection }) - return (
- - - -```dart -final subscription = supabase.auth.onAuthStateChange((event, session) { - print(session?.user?.id); - // handle auth state change -}); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Listen to auth changes - - - - - - - -```dart -final subscription = supabase.auth.onAuthStateChange((event, session) { - print(session?.user?.id); - // handle auth state change -}); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/auth-session.mdx b/apps/temp-docs/docs/dart/auth-session.mdx deleted file mode 100644 index 361bb5d22fb..00000000000 --- a/apps/temp-docs/docs/dart/auth-session.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -id: auth-session -title: "auth.session()" -slug: auth-session -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Returns the session data, if there is an active session. - - - - - - -```dart -final session = supabase.auth.session(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Get the session data - - - - - - - -```dart -final session = supabase.auth.session(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/auth-signin.mdx b/apps/temp-docs/docs/dart/auth-signin.mdx deleted file mode 100644 index 31ab4d1a35a..00000000000 --- a/apps/temp-docs/docs/dart/auth-signin.mdx +++ /dev/null @@ -1,103 +0,0 @@ ---- -id: auth-signin -title: 'auth.signIn()' -slug: auth-signin -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs' -import TabsPanel from '@theme/TabsPanel' - -Log in an existing user, or login via a third-party provider. - - - - - -```dart -final res = await supabase.auth.signIn(email: 'example@email.com', password: 'example-password'); - -final user = res.data?.user; -final error = res.error; -``` - - - - - -## Notes - -- A user can sign up via email, phone number. -- If you provide `email` without a `password`, the user will be sent a magic link. -- The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com) -- Similarly, if you provide `phone` without a `password`, the user will be sent a one time password. -- If you are looking to sign users in with OAuth in Flutter apps, go to [`signInWithProvider()`](/docs/reference/dart/auth-signinwithprovider). - -## Examples - -### Sign in with email. - - - - - -```dart -final res = await supabase.auth.signIn(email: 'example@email.com', password: 'example-password'); - -final user = res.data?.user; -final error = res.error; -``` - - - - - -### Sign in with magic link. - -If email is provided, but no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds. - - - - - -```dart -final res = await supabase.auth.signIn(email: 'example@email.com'); - -final error = res.error; -``` - - - - - -### Get OAuth sign in URL. - -Passing provider parameter to `signIn()` will return a URL to sign your user in via OAuth. -If you are looking to sign in a user via OAuth on Flutter app, go to [`signInWithProvider()`](/docs/reference/dart/auth-signinwithprovider). - - - - - -```dart -final res = await supabase.auth.signIn(provider: Provider.github); - -final url = res.data?.url; -final error = res.error; -``` - - - - diff --git a/apps/temp-docs/docs/dart/auth-signinwithprovider.mdx b/apps/temp-docs/docs/dart/auth-signinwithprovider.mdx deleted file mode 100644 index 62863ba012e..00000000000 --- a/apps/temp-docs/docs/dart/auth-signinwithprovider.mdx +++ /dev/null @@ -1,129 +0,0 @@ ---- -id: auth-signinwithprovider -title: "auth.signInWithProvider()" -slug: auth-signinwithprovider -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Signs the user in using third party OAuth providers. - - - - - - -```dart -final res = await supabase.auth.signInWithProvider(Provider.github); - -final error = res.error; -``` - - - - - - - - - - -## Notes - -- `auth.signInWithProvider()` is only available on `supabase_flutter` -- It will open the browser to the relevant login page. - - - - - - - - - - -## Examples - -### Sign in with provider. - - - - - - - -```dart -final res = await supabase.auth.signInWithProvider(Provider.github); - -final error = res.error; -``` - - - - - - -### With `redirectTo` - -Specify the redirect link to bring back the user via deeplink. -Note that `redirectTo` should be null for Flutter Web. - - - - - - -```dart -final res = await supabase.auth.signInWithProvider( - Provider.github, - options: AuthOptions( - redirectTo: kIsWeb - ? null - : 'io.supabase.flutter://reset-callback/'), -); - -final error = res.error; -``` - - - - - - -### With scopes - -If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request to get back an OAuth provider token. -You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider. - - - - - - -```dart -const { user, session, error } = await supabase.auth.signIn({ - provider: 'github' -}, { - scopes: 'repo gist notifications' -}) -const oAuthToken = session.provider_token // use to access provider API -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/auth-signout.mdx b/apps/temp-docs/docs/dart/auth-signout.mdx deleted file mode 100644 index d1458aec554..00000000000 --- a/apps/temp-docs/docs/dart/auth-signout.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -id: auth-signout -title: "auth.signOut()" -slug: auth-signout -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Signs out the current user, if there is a logged in user. - - - - - - -```dart -final res = await supabase.auth.signOut(); - -final error = res.error; -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Sign out - - - - - - - -```dart -final res = await supabase.auth.signOut(); - -final error = res.error; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/auth-signup.mdx b/apps/temp-docs/docs/dart/auth-signup.mdx deleted file mode 100644 index b891b85bc2f..00000000000 --- a/apps/temp-docs/docs/dart/auth-signup.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -id: auth-signup -title: 'auth.signUp()' -slug: auth-signup -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs' -import TabsPanel from '@theme/TabsPanel' - -Creates a new user. - - - - - -```dart -final res = await supabase.auth.signUp('example@email.com', 'example-password'); - -final user = res.data?.user; -final error = res.error; -``` - - - - - -## Notes - -- By default, the user will need to verify their email address before logging in. If you would like to change this, you can disable "Email Confirmations" by going to Authentication -> Settings on [app.supabase.com](https://app.supabase.com) -- If "Email Confirmations" is turned on, a `user` is returned but `session` will be null -- If "Email Confirmations" is turned off, both a `user` and a `session` will be returned -- When the user confirms their email address, they will be redirected to localhost:3000 by default. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com) - -## Examples - -### Sign up. - - - - - -```dart -final res = await supabase.auth.signUp('example@email.com', 'example-password'); - -final user = res.data?.user; -final error = res.error; -``` - - - - - -### Sign up with third-party providers. - -If you are using Flutter, you can sign up with OAuth providers using the [`signInWithProvider()`](/docs/reference/dart/auth-signinwithprovider) method available on `supabase_flutter`. diff --git a/apps/temp-docs/docs/dart/auth-update.mdx b/apps/temp-docs/docs/dart/auth-update.mdx deleted file mode 100644 index 95451f08b8e..00000000000 --- a/apps/temp-docs/docs/dart/auth-update.mdx +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: auth-update -title: "auth.update()" -slug: auth-update -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Updates user data, if there is a logged in user. - - - - - - -```dart -final res = await supabase.auth.update( - UserAttributes(data: {'hello': 'world'}) -); - -final error = res.error; -``` - - - - - - - - - - -## Notes - -It's generally better to store user data in a table inside your public schema (i.e. `public.users`). -Use the `update()` method if you have data which rarely changes or is specific only to the logged in user. - - - - - - - - - - -## Examples - -### Update a user's metadata. - - - - - - - -```dart -final res = await supabase.auth.update( - UserAttributes(data: {'hello': 'world'}) -); - -final error = res.error; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/auth-user.mdx b/apps/temp-docs/docs/dart/auth-user.mdx deleted file mode 100644 index fb11208dea8..00000000000 --- a/apps/temp-docs/docs/dart/auth-user.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -id: auth-user -title: "auth.user()" -slug: auth-user -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Returns the user data, if there is a logged in user. - - - - - - -```dart -final user = supabase.auth.user(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Get the logged in user - - - - - - - -```dart -final user = supabase.auth.user(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/containedby.mdx b/apps/temp-docs/docs/dart/containedby.mdx deleted file mode 100644 index 0902ece9744..00000000000 --- a/apps/temp-docs/docs/dart/containedby.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: containedby -title: ".containedBy()" -slug: containedby -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .containedBy('main_exports', ['cars', 'food', 'machine']) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .containedBy('main_exports', ['cars', 'food', 'machine']) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .containedBy('main_exports', ['orks', 'surveillance', 'evil']) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .containedBy('main_exports', ['cars', 'food', 'machine']) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .containedBy('main_exports', ['cars', 'food', 'machine']) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/contains.mdx b/apps/temp-docs/docs/dart/contains.mdx deleted file mode 100644 index c350feeecbc..00000000000 --- a/apps/temp-docs/docs/dart/contains.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: contains -title: ".contains()" -slug: contains -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .contains('main_exports', ['oil']) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .contains('main_exports', ['oil']) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .contains('main_exports', ['oil']) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .contains('main_exports', ['oil']) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .contains('main_exports', ['oil']) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/delete.mdx b/apps/temp-docs/docs/dart/delete.mdx deleted file mode 100644 index 37b570eefa3..00000000000 --- a/apps/temp-docs/docs/dart/delete.mdx +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: delete -title: "Delete data: delete()" -slug: delete -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Performs a DELETE on the table. - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .match({ 'id': 666 }) - .execute(); -``` - - - - - - - - - - -## Notes - -TODO update link to dart -- `delete()` should always be combined with [Filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to delete. - - - - - - - - - - -## Examples - -### Delete records - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .match({ 'id': 666 }) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/eq.mdx b/apps/temp-docs/docs/dart/eq.mdx deleted file mode 100644 index b631453c7f3..00000000000 --- a/apps/temp-docs/docs/dart/eq.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: eq -title: ".eq()" -slug: eq -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` exactly matches the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .eq('name', 'The shire') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .eq('name', 'The shire') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .eq('name', 'San Francisco') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .eq('name', 'Mordor') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .eq('name', 'San Francisco') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/filter.mdx b/apps/temp-docs/docs/dart/filter.mdx deleted file mode 100644 index b637f533442..00000000000 --- a/apps/temp-docs/docs/dart/filter.mdx +++ /dev/null @@ -1,170 +0,0 @@ ---- -id: filter -title: ".filter()" -slug: filter -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose `column` satisfies the filter. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .filter('name', 'in', '("Paris","Tokyo")') - .execute(); -``` - - - - - - - - - - -## Notes - -- `.filter()` expects you to use the raw [PostgREST syntax](https://postgrest.org/en/stable/api.html#horizontal-filtering-rows) for the filter values, so it should only be used as an escape hatch in case other filters don't work. - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .filter('name', 'in', '("Paris","Tokyo")') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .filter('name', 'in', '("Paris","Tokyo")') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .filter('name', 'in', '("Paris","Tokyo")') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .filter('name', 'in', '("Paris","Tokyo")') -``` - - - - - - -### Filter embedded resources - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, countries ( name )') - .filter('countries.name', 'in', '("France","Japan")') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/getsubscriptions.mdx b/apps/temp-docs/docs/dart/getsubscriptions.mdx deleted file mode 100644 index 1ddf8924852..00000000000 --- a/apps/temp-docs/docs/dart/getsubscriptions.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -id: getsubscriptions -title: "getSubscriptions()" -slug: getsubscriptions -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Returns an array of all your subscriptions. - - - - - - -```dart -final subscriptions = supabase.getSubscriptions(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Get all subscriptions - - - - - - - -```dart -final subscriptions = supabase.getSubscriptions(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/gt.mdx b/apps/temp-docs/docs/dart/gt.mdx deleted file mode 100644 index 4c211f5b871..00000000000 --- a/apps/temp-docs/docs/dart/gt.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: gt -title: ".gt()" -slug: gt -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` is greater than the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .gt('country_id', 250) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .gt('country_id', 250) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .gt('country_id', 250) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .gt('country_id', 250) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .gt('country_id', 250) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/gte.mdx b/apps/temp-docs/docs/dart/gte.mdx deleted file mode 100644 index 1effd302292..00000000000 --- a/apps/temp-docs/docs/dart/gte.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: gte -title: ".gte()" -slug: gte -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` is greater than or equal to the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .gte('country_id', 250) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .gte('country_id', 250) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .gte('country_id', 250) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .gte('country_id', 250) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .gte('country_id', 250) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/ilike.mdx b/apps/temp-docs/docs/dart/ilike.mdx deleted file mode 100644 index 35fa42c2602..00000000000 --- a/apps/temp-docs/docs/dart/ilike.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: ilike -title: ".ilike()" -slug: ilike -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value in the stated `column` matches the supplied `pattern` (case insensitive). - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .ilike('name', '%la%') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .ilike('name', '%la%') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .ilike('name', '%la%') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .ilike('name', '%la%') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .ilike('name', '%la%') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/in_.mdx b/apps/temp-docs/docs/dart/in_.mdx deleted file mode 100644 index 23d18ca4ed3..00000000000 --- a/apps/temp-docs/docs/dart/in_.mdx +++ /dev/null @@ -1,148 +0,0 @@ ---- -id: in_ -title: ".in_()" -slug: in_ -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` is found on the specified `values`. - -`is_` and `in_` filter methods are suffixed with `_` to avoid collisions with reserved keywords. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .in_('name', ['Rio de Janeiro', 'San Francisco']) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .in_('name', ['Rio de Janeiro', 'San Francisco']) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .in_('name', ['Rio de Janeiro', 'San Francisco']) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .in_('name', ['Rio de Janeiro', 'San Francisco']) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .in_('name', ['Rio de Janeiro', 'San Francisco']) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/index.mdx b/apps/temp-docs/docs/dart/index.mdx deleted file mode 100644 index acffea0ac94..00000000000 --- a/apps/temp-docs/docs/dart/index.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -id: index -title: "Getting started" -slug: getting-started -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - -Supabase Dart. \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/initializing.mdx b/apps/temp-docs/docs/dart/initializing.mdx deleted file mode 100644 index 87b3b493a6c..00000000000 --- a/apps/temp-docs/docs/dart/initializing.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -id: initializing -title: "Initializing" -slug: initializing -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -## Dart -You can initialize a new Supabase client using the `SupabaseClient()` method. - -The Supabase client is your entrypoint to the rest of the Supabase functionality -and is the easiest way to interact with everything we offer within the Supabase ecosystem. - - -## Flutter - -For `supabase_flutter`, you will be using the static `initialize()` method on `Supabase` class. - - - - - - - - - - - - - - - - - - - - -## Examples - -### Dart SupabaseClient() - - - - - - - -```dart -final supabase = SupabaseClient('https://xyzcompany.supabase.co', 'public-anon-key'); -``` - - - - - - -### Flutter initialize() - - - - - - - -```dart title="main.dart" -Future main() async { - await Supabase.initialize(url: 'https://xyzcompany.supabase.co', anonKey: 'public-anon-key'); - runApp(MyApp()); -} -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/insert.mdx b/apps/temp-docs/docs/dart/insert.mdx deleted file mode 100644 index c5422081ee2..00000000000 --- a/apps/temp-docs/docs/dart/insert.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -id: insert -title: "Create data: insert()" -slug: insert -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Performs an INSERT into the table. - - - - - - -```dart -final res = await supabase - .from('cities') - .insert([ - {'name': 'The Shire', 'country_id': 554} - ]).execute(); -``` - - - - - - - - - - -## Notes - -- By default, every time you run `insert()`, the client library will make a `select` to return the full record. -This is convenient, but it can also cause problems if your Policies are not configured to allow the `select` operation. -If you are using Row Level Security and you are encountering problems, try setting the `returning` param to `minimal`. - - - - - - - - - - -## Examples - -### Create a record - - - - - - - -```dart -final res = await supabase - .from('cities') - .insert([ - {'name': 'The Shire', 'country_id': 554} - ]).execute(); -``` - - - - - - -### Bulk create - - - - - - - -```dart -final res = await supabase - .from('cities') - .insert([ - {'name': 'The Shire', 'country_id': 554}, - {'name': 'Rohan', 'country_id': 555}, - ]).execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/installing.mdx b/apps/temp-docs/docs/dart/installing.mdx deleted file mode 100644 index 290000ecd86..00000000000 --- a/apps/temp-docs/docs/dart/installing.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: installing -title: "Installing" -slug: installing -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -## Dart - -Dart libraries are built and supported by the community. - -```bash -dart pub add supabase -``` - -Find the source code on [GitHub](https://github.com/supabase/supabase-dart). - -## Flutter - -For Flutter project, you can use [supabase_flutter](https://github.com/supabase/supabase-flutter). - -```bash -flutter pub add supabase_flutter -``` - -`supabase_flutter` plugin uses `supabase` plugin internally, and it adds some Flutter specific functionality such as handling deeplinks coming back from magic link verifications. -If you are creating a Flutter application, we recommend using `supabase_flutter` instead of `supabase`. - -For the most part `supabase_flutter` shares the same API as `supabase` with few exceptions such as initialization or OAuth sign in. \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/is_.mdx b/apps/temp-docs/docs/dart/is_.mdx deleted file mode 100644 index c1d5af70780..00000000000 --- a/apps/temp-docs/docs/dart/is_.mdx +++ /dev/null @@ -1,148 +0,0 @@ ---- -id: is_ -title: ".is_()" -slug: is_ -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -A check for exact equality (null, true, false), finds all rows whose value on the stated `column` exactly match the specified `value`. - -`is_` and `in_` filter methods are suffixed with `_` to avoid collisions with reserved keywords. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .is_('name', null) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .is_('name', null) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .is_('name', null) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .is_('name', null) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .is_('name', null) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/like.mdx b/apps/temp-docs/docs/dart/like.mdx deleted file mode 100644 index 4fae8c3c8c7..00000000000 --- a/apps/temp-docs/docs/dart/like.mdx +++ /dev/null @@ -1,191 +0,0 @@ ---- -id: like -title: ".like()" -slug: like -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value in the stated `column` matches the supplied `pattern` (case sensitive). - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .like('name', '%la%') - .execute(); -``` - - - - - - -## Parameters - - -
    - -
  • -

    - - column - - - required - - - object - -

    -
    - -The column to filter on. - -
    - -
  • - - -
  • -

    - - pattern - - - required - - - string - -

    -
    - -The pattern to filter with. - -
    - -
  • - -
- - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .like('name', '%la%') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .like('name', '%la%') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .like('name', '%la%') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .like('name', '%la%') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/limit.mdx b/apps/temp-docs/docs/dart/limit.mdx deleted file mode 100644 index 2a22a201405..00000000000 --- a/apps/temp-docs/docs/dart/limit.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -id: limit -title: "limit()" -slug: limit -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Limits the result with the specified count. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .limit(1) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .limit(1) - .execute(); -``` - - - - - - -### With embedded resources - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, cities(name)') - .eq('name', 'United States') - .limit(1, foreignTable: 'cities' ) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/lt.mdx b/apps/temp-docs/docs/dart/lt.mdx deleted file mode 100644 index b98cd7589b7..00000000000 --- a/apps/temp-docs/docs/dart/lt.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: lt -title: ".lt()" -slug: lt -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` is less than the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .lt('country_id', 250) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .lt('country_id', 250) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .lt('country_id', 250) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .lt('country_id', 250) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .lt('country_id', 250) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/lte.mdx b/apps/temp-docs/docs/dart/lte.mdx deleted file mode 100644 index 8337ccc9a89..00000000000 --- a/apps/temp-docs/docs/dart/lte.mdx +++ /dev/null @@ -1,191 +0,0 @@ ---- -id: lte -title: ".lte()" -slug: lte -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` is less than or equal to the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .lte('country_id', 250) - .execute(); -``` - - - - - - -## Parameters - - -
    - -
  • -

    - - column - - - required - - - object - -

    -
    - -The column to filter on. - -
    - -
  • - - -
  • -

    - - value - - - required - - - object - -

    -
    - -The value to filter with. - -
    - -
  • - -
- - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .lte('country_id', 250) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .lte('country_id', 250) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .lte('country_id', 250) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .lte('country_id', 250) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/match.mdx b/apps/temp-docs/docs/dart/match.mdx deleted file mode 100644 index 69f9a18c47d..00000000000 --- a/apps/temp-docs/docs/dart/match.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: match -title: ".match()" -slug: match -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose columns match the specified `query` object. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .match({'name': 'Beijing', 'country_id': 156}) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .match({'name': 'Beijing', 'country_id': 156}) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .match({'name': 'Beijing', 'country_id': 156}) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .match({'name': 'Beijing', 'country_id': 156}) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .match({'name': 'Beijing', 'country_id': 156}) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/neq.mdx b/apps/temp-docs/docs/dart/neq.mdx deleted file mode 100644 index 92654e12b36..00000000000 --- a/apps/temp-docs/docs/dart/neq.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: neq -title: ".neq()" -slug: neq -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` doesn't match the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .neq('name', 'The shire') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .neq('name', 'The shire') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .neq('name', 'San Francisco') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .neq('name', 'Mordor') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .neq('name', 'Lagos') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/not.mdx b/apps/temp-docs/docs/dart/not.mdx deleted file mode 100644 index cc41b7f6038..00000000000 --- a/apps/temp-docs/docs/dart/not.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: not -title: ".not()" -slug: not -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows which doesn't satisfy the filter. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .not('name', 'eq', 'Paris') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .not('name', 'eq', 'Paris') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .not('name', 'eq', 'Paris') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .not('name', 'eq', 'Paris') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities) - .not('name', 'eq', 'Paris') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/or.mdx b/apps/temp-docs/docs/dart/or.mdx deleted file mode 100644 index 4852ebc659b..00000000000 --- a/apps/temp-docs/docs/dart/or.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -id: or -title: ".or()" -slug: or -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows satisfying at least one of the filters. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .or('id.eq.20,id.eq.30') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .or('id.eq.20,id.eq.30') - .execute(); -``` - - - - - - -### Use `or` with `and` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .or('id.gt.20,and(name.eq.New Zealand,name.eq.France)') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/order.mdx b/apps/temp-docs/docs/dart/order.mdx deleted file mode 100644 index 18daaacd619..00000000000 --- a/apps/temp-docs/docs/dart/order.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -id: order -title: "order()" -slug: order -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Orders the result with the specified column. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .order('id', ascending: false ) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .order('id', ascending: false ) - .execute(); -``` - - - - - - -### With embedded resources - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, cities(name)') - .eq('name', 'United States') - .order('name', foreignTable: 'cities') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/overlaps.mdx b/apps/temp-docs/docs/dart/overlaps.mdx deleted file mode 100644 index d7ca0f689b2..00000000000 --- a/apps/temp-docs/docs/dart/overlaps.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: overlaps -title: ".overlaps()" -slug: overlaps -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .overlaps('main_exports', ['computers', 'minerals']) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .overlaps('main_exports', ['computers', 'minerals']) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .overlaps('main_exports', ['computers', 'minerals']) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .overlaps('main_exports', ['computers', 'minerals']) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .overlaps('main_exports', ['computers', 'minerals']) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/range.mdx b/apps/temp-docs/docs/dart/range.mdx deleted file mode 100644 index affd16f8583..00000000000 --- a/apps/temp-docs/docs/dart/range.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -id: range -title: "range()" -slug: range -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Limits the result to rows within the specified range, inclusive. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .range(0,3) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .range(0,3) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/rangeadjacent.mdx b/apps/temp-docs/docs/dart/rangeadjacent.mdx deleted file mode 100644 index f31f4f505e9..00000000000 --- a/apps/temp-docs/docs/dart/rangeadjacent.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: rangeadjacent -title: ".rangeAdjacent()" -slug: rangeadjacent -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeAdjacent('population_range_millions', '[70, 185]') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeAdjacent('population_range_millions', '[70, 185]') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .rangeAdjacent('population_range_millions', '[70, 185]') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .rangeAdjacent('population_range_millions', '[70, 185]') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .rangeAdjacent('population_range_millions', '[70, 185]') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/rangegt.mdx b/apps/temp-docs/docs/dart/rangegt.mdx deleted file mode 100644 index 6ddd4b34ed8..00000000000 --- a/apps/temp-docs/docs/dart/rangegt.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: rangegt -title: ".rangeGt()" -slug: rangegt -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeGt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeGt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .rangeGt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .rangeGt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .rangeGt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/rangegte.mdx b/apps/temp-docs/docs/dart/rangegte.mdx deleted file mode 100644 index 3a674440832..00000000000 --- a/apps/temp-docs/docs/dart/rangegte.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: rangegte -title: ".rangeGte()" -slug: rangegte -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeGte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeGte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .rangeGte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .rangeGte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .rangeGte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/rangelt.mdx b/apps/temp-docs/docs/dart/rangelt.mdx deleted file mode 100644 index 43cb40cbd68..00000000000 --- a/apps/temp-docs/docs/dart/rangelt.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: rangelt -title: ".rangeLt()" -slug: rangelt -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeLt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeLt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .rangeLt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .rangeLt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .rangeLt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/rangelte.mdx b/apps/temp-docs/docs/dart/rangelte.mdx deleted file mode 100644 index c673b888736..00000000000 --- a/apps/temp-docs/docs/dart/rangelte.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: rangelte -title: ".rangeLte()" -slug: rangelte -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeLte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeLte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .rangeLte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .rangeLte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .rangeLte('population_range_millions', [150, 250]) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/removesubscription.mdx b/apps/temp-docs/docs/dart/removesubscription.mdx deleted file mode 100644 index 76504e2880d..00000000000 --- a/apps/temp-docs/docs/dart/removesubscription.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -id: removesubscription -title: "removeSubscription()" -slug: removesubscription -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Removes an active subscription and returns the number of open connections. - - - - - - -```dart -supabase.removeSubscription(mySubscription); -``` - - - - - - - - - - -## Notes - -- Removing subscriptions is a great way to maintain the performance of your project's database. Supabase will automatically handle cleanup 30 seconds after a user is disconnected, but unused subscriptions may cause degradation as more users are simultaneously subscribed. - - - - - - - - - - -## Examples - -### Remove a subscription - - - - - - - -```dart -supabase.removeSubscription(mySubscription); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/reset-password-email.mdx b/apps/temp-docs/docs/dart/reset-password-email.mdx deleted file mode 100644 index 27086ba3c05..00000000000 --- a/apps/temp-docs/docs/dart/reset-password-email.mdx +++ /dev/null @@ -1,114 +0,0 @@ ---- -id: reset-password-email -title: "Reset Password (Email)" -slug: reset-password-email -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Sends a reset request to an email address. - - - - - - -```dart -final res = await supabase.auth.api.resetPasswordForEmail('user@example.com'); - -final error = res.error; -``` - - - - - - - - - - -## Notes - -Sends a reset request to an email address. - -When the user clicks the reset link in the email they will be forwarded to: - -`#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery` - -Your app must detect `type=recovery` in the fragment and display a password reset form to the user. - -You should then use the access_token in the url and new password to update the user as follows: - -```dart -final res = await supabase.auth.api.updateUser( - accessToken, - UserAttributes(password: 'NEW_PASSWORD'), -); -``` - - - - - - - - - - -## Examples - -### Reset password - - - - - - - -```dart -final res = await supabase.auth.api.resetPasswordForEmail('user@example.com'); - -final error = res.error; -``` - - - - - - -### Reset password for Flutter - - - - - - - -You can pass `redirectTo` to open the app via deeplink when user opens the password reset email. -```dart -final res = await supabase.auth.api.resetPasswordForEmail( - 'user@example.com', - options: AuthOptions(redirectTo: kIsWeb - ? null - : 'io.supabase.flutter://reset-callback/'), -); - -final error = res.error; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/rpc.mdx b/apps/temp-docs/docs/dart/rpc.mdx deleted file mode 100644 index f24ef39b765..00000000000 --- a/apps/temp-docs/docs/dart/rpc.mdx +++ /dev/null @@ -1,119 +0,0 @@ ---- -id: rpc -title: "Stored Procedures: rpc()" -slug: rpc -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -You can call stored procedures as a "Remote Procedure Call". - -That's a fancy way of saying that you can put some logic into your database then call it from anywhere. -It's especially useful when the logic rarely changes - like password resets and updates. - - - - - - -```dart -final res = await supabase - .rpc('hello_world') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Call a stored procedure - -This is an example invoking a stored procedure. - - - - - -```dart -final res = await supabase - .rpc('hello_world') - .execute(); -``` - - - - - - -### With Parameters - - - - - - - -```dart -final res = await supabase - .rpc('echo_city', params: { 'name': 'The Shire' }) - .execute(); -``` - - - - - - -### With count option - -You can specify a count option to get the row count along with your data. -Allowed values for count option are `exact`, `planned` and `estimated`. - - - - - - -```dart -final res = await supabase - .rpc('hello_world') - .execute(count: CountOption.exact); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/select.mdx b/apps/temp-docs/docs/dart/select.mdx deleted file mode 100644 index 15037ea81b6..00000000000 --- a/apps/temp-docs/docs/dart/select.mdx +++ /dev/null @@ -1,272 +0,0 @@ ---- -id: select -title: "Fetch data: select()" -slug: select -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Performs vertical filtering with SELECT. - - - - - - -```dart -final res = await supabase - .from('cities') - .select() - .execute(); - -final data = res.data; -final error = res.error; -``` - - - - - - - - - - -## Notes - -- By default, Supabase projects will return a maximum of 1,000 rows. This setting can be changed in Project API Settings. It's recommended that you keep it low to limit the payload size of accidental or malicious requests. You can use `range()` queries to paginate through your data. -- `select()` can be combined with [Modifiers](/docs/reference/dart/using-modifiers) -- `select()` can be combined with [Filters](/docs/reference/dart/using-filters) - - - - - - - - - - -## Examples - -### Getting your data - - - - - - - -```dart -final res = await supabase - .from('cities') - .select() - .execute(); - -final data = res.data; -final error = res.error; -``` - - - - - - -### Selecting specific columns - -You can select specific fields from your tables. - - - - - -```dart -final res = await supabase - .from('cities') - .select('name') - .execute(); -``` - - - - - - -### Query foreign tables - -If your database has relationships, you can query related tables too. - - - - - -```dart -final res = await supabase - .from('countries') - .select(''' - name, - cities ( - name - ) - ''') - .execute(); -``` - - - - - - -### Query the same foreign table multiple times - -Sometimes you will need to query the same foreign table twice. -In this case, you can use the name of the joined column to identify -which join you intend to use. For convenience, you can also give an -alias for each column. For example, if we had a shop of products, -and we wanted to get the supplier and the purchaser at the same time -(both in the users) table: - - - - - - -```dart -final res = await supabase - .from('products') - .select(''' - id, - supplier:supplier_id ( name ), - purchaser:purchaser_id ( name ) - ''') - .execute(); -``` - - - - - - -### Filtering with inner joins - -If you want to filter a table based on a child table's values you can use the `!inner()` function. For example, if you wanted -to select all rows in a `message` table which belong to a user with the `username` "Jane": - - - - - - - -``` -Not yet implemented -``` - - - - - - -### Querying with count option - -You can get the number of rows by using the count option. -Allowed values for count option are [exact](https://postgrest.org/en/stable/api.html#exact-count), [planned](https://postgrest.org/en/stable/api.html#planned-count) and [estimated](https://postgrest.org/en/stable/api.html#estimated-count). - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name') - .execute(count: CountOption.exact); - -final count = res.count; -``` - - - - - - -### Querying JSON data - -If you have data inside of a JSONB column, you can apply select -and query filters to the data values. Postgres offers a -[number of operators](https://www.postgresql.org/docs/current/functions-json.html) -for querying JSON data. Also see -[PostgREST docs](http://postgrest.org/en/v7.0.0/api.html#json-columns) for more details. - - - - - - -```dart -final res = await supabase - .from('users') - .select(''' - id, name, - address->street - ''') - .eq('address->postcode', 90210) - .execute(); -``` - - - - - - -### Return data as CSV - -By default the data is returned in JSON format, however you can also request for it to be returned as Comma Separated Values. - - - - - - -```dart -final res = await supabase - .from('users') - .select() - .csv() - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/single.mdx b/apps/temp-docs/docs/dart/single.mdx deleted file mode 100644 index 8d201ae0dca..00000000000 --- a/apps/temp-docs/docs/dart/single.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -id: single -title: "single()" -slug: single -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Retrieves only one row from the result. Result must be one row (e.g. using limit), otherwise this will result in an error. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .single() - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .single() - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-createbucket.mdx b/apps/temp-docs/docs/dart/storage-createbucket.mdx deleted file mode 100644 index 01ea9fa63b0..00000000000 --- a/apps/temp-docs/docs/dart/storage-createbucket.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -id: storage-createbucket -title: "createBucket()" -slug: storage-createbucket -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Creates a new Storage bucket - - - - - - -```dart -final res = await supabase - .storage - .createBucket('avatars'); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: `insert` - - `objects` permissions: none - - - - - - - - - - -## Examples - -### Create bucket - - - - - - - -```dart -final res = await supabase - .storage - .createBucket('avatars'); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-deletebucket.mdx b/apps/temp-docs/docs/dart/storage-deletebucket.mdx deleted file mode 100644 index 60a020ac22b..00000000000 --- a/apps/temp-docs/docs/dart/storage-deletebucket.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -id: storage-deletebucket -title: "deleteBucket()" -slug: storage-deletebucket -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Deletes an existing bucket. A bucket can't be deleted with existing objects inside it. You must first `empty()` the bucket. - - - - - - -```dart -final res = await supabase - .storage - .deleteBucket('avatars'); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: `select` and `delete` - - `objects` permissions: none - - - - - - - - - - -## Examples - -### Delete bucket - - - - - - - -```dart -final res = await supabase - .storage - .deleteBucket('avatars'); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-emptybucket.mdx b/apps/temp-docs/docs/dart/storage-emptybucket.mdx deleted file mode 100644 index 0476cb9d25c..00000000000 --- a/apps/temp-docs/docs/dart/storage-emptybucket.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -id: storage-emptybucket -title: "emptyBucket()" -slug: storage-emptybucket -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Removes all objects inside a single bucket. - - - - - - -```dart -final res = await supabase - .storage - .emptyBucket('avatars'); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: `select` - - `objects` permissions: `select` and `delete` - - - - - - - - - - -## Examples - -### Empty bucket - - - - - - - -```dart -final res = await supabase - .storage - .emptyBucket('avatars'); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-from-createsignedurl.mdx b/apps/temp-docs/docs/dart/storage-from-createsignedurl.mdx deleted file mode 100644 index 9609d9a96c6..00000000000 --- a/apps/temp-docs/docs/dart/storage-from-createsignedurl.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -id: storage-from-createsignedurl -title: "from.createSignedUrl()" -slug: storage-from-createsignedurl -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Create signed url to download file without requiring permissions. This URL can be valid for a set number of seconds. - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .createSignedUrl('avatar1.png', 60); - -final signedURL = res.data; -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `select` - - - - - - - - - - -## Examples - -### Create Signed URL - - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .createSignedUrl('avatar1.png', 60); - -final signedURL = res.data; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-from-download.mdx b/apps/temp-docs/docs/dart/storage-from-download.mdx deleted file mode 100644 index f5173ee7804..00000000000 --- a/apps/temp-docs/docs/dart/storage-from-download.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: storage-from-download -title: "from.download()" -slug: storage-from-download -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Downloads a file. - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .download('avatar1.png'); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `select` - - - - - - - - - - -## Examples - -### Download file - - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .download('avatar1.png'); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-from-getpublicurl.mdx b/apps/temp-docs/docs/dart/storage-from-getpublicurl.mdx deleted file mode 100644 index 1013ec51f67..00000000000 --- a/apps/temp-docs/docs/dart/storage-from-getpublicurl.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -id: storage-from-getpublicurl -title: 'from.getPublicUrl()' -slug: storage-from-getpublicurl -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs' -import TabsPanel from '@theme/TabsPanel' - -Retrieve URLs for assets in public buckets - - - - - -```dart -final res = supabase - .storage - .from('public-bucket') - .getPublicUrl('avatar1.png'); - -final publicURL = res.data; -``` - - - - - -## Notes - -- The bucket needs to be set to public, either via [updateBucket()](/docs/reference/javascript/storage-updatebucket) or by going to Storage on [app.supabase.com](https://app.supabase.com), clicking the overflow menu on a bucket and choosing "Make public" -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: none - -## Examples - -### Returns the URL for an asset in a public bucket - - - - - -```dart -final res = supabase - .storage - .from('public-bucket') - .getPublicUrl('avatar1.png'); - -final publicURL = res.data; -``` - - - - diff --git a/apps/temp-docs/docs/dart/storage-from-list.mdx b/apps/temp-docs/docs/dart/storage-from-list.mdx deleted file mode 100644 index 36c9dc50985..00000000000 --- a/apps/temp-docs/docs/dart/storage-from-list.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: storage-from-list -title: "from.list()" -slug: storage-from-list -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Lists all the files within a bucket. - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .list(); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `select` - - - - - - - - - - -## Examples - -### List files in a bucket - - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .list(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-from-move.mdx b/apps/temp-docs/docs/dart/storage-from-move.mdx deleted file mode 100644 index 7c14443d94a..00000000000 --- a/apps/temp-docs/docs/dart/storage-from-move.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: storage-from-move -title: "from.move()" -slug: storage-from-move -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Moves an existing file, optionally renaming it at the same time. - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .move('public/avatar1.png', 'private/avatar2.png'); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `update` and `select` - - - - - - - - - - -## Examples - -### Move file - - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .move('public/avatar1.png', 'private/avatar2.png'); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-from-remove.mdx b/apps/temp-docs/docs/dart/storage-from-remove.mdx deleted file mode 100644 index 083be494c4e..00000000000 --- a/apps/temp-docs/docs/dart/storage-from-remove.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: storage-from-remove -title: "from.remove()" -slug: storage-from-remove -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Deletes files within the same bucket - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .remove(['avatar1.png']); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `delete` and `select` - - - - - - - - - - -## Examples - -### Delete file - - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .remove(['avatar1.png']); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-from-update.mdx b/apps/temp-docs/docs/dart/storage-from-update.mdx deleted file mode 100644 index cbe7ccccfd9..00000000000 --- a/apps/temp-docs/docs/dart/storage-from-update.mdx +++ /dev/null @@ -1,83 +0,0 @@ ---- -id: storage-from-update -title: "from.update()" -slug: storage-from-update -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Replaces an existing file at the specified path with a new one. - - - - - - -```dart -final avatarFile = File('path/to/file'); -final res = await supabase - .storage - .from('avatars') - .update('public/avatar1.png', avatarFile, fileOptions: FileOptions( - cacheControl: '3600', - upsert: false - )); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `update` and `select` - - - - - - - - - - -## Examples - -### Update file - - - - - - - -```dart -final avatarFile = File('path/to/file'); -final res = await supabase - .storage - .from('avatars') - .update('public/avatar1.png', avatarFile, fileOptions: FileOptions( - cacheControl: '3600', - upsert: false - )); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-from-upload.mdx b/apps/temp-docs/docs/dart/storage-from-upload.mdx deleted file mode 100644 index 59b18350554..00000000000 --- a/apps/temp-docs/docs/dart/storage-from-upload.mdx +++ /dev/null @@ -1,152 +0,0 @@ ---- -id: storage-from-upload -title: "from.upload()" -slug: storage-from-upload -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Uploads a file to an existing bucket. - - - - - - -```dart -final avatarFile = File('path/to/file'); -final res = await supabase - .storage - .from('avatars') - .upload('public/avatar1.png', avatarFile, fileOptions: FileOptions( - cacheControl: '3600', - upsert: false - )); -``` - - - - - - -## Parameters - - -
    - -
  • -

    - - path - - - required - - - string - -

    -
    - -The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload. - -
    - -
  • - - -
  • -

    - - fileBody - - - required - - - ArrayBuffer | ArrayBufferView | Blob | Buffer | File | FormData | ReadableStream | ReadableStream | URLSearchParams | string - -

    -
    - -The body of the file to be stored in the bucket. - -
    - -
  • - - -
  • -

    - - fileOptions - - - optional - - - FileOptions - -

    -
    - -HTTP headers. -`cacheControl`: string, the `Cache-Control: max-age=` seconds value. -`contentType`: string, the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`. -`upsert`: boolean, whether to perform an upsert. - -
    - -
  • - -
- - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `insert` - - - - - - - - - - -## Examples - -### Upload file - - - - - - - -```dart -final avatarFile = File('path/to/file'); -final res = await supabase - .storage - .from('avatars') - .upload('public/avatar1.png', avatarFile, fileOptions: FileOptions( - cacheControl: '3600', - upsert: false - )); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-getbucket.mdx b/apps/temp-docs/docs/dart/storage-getbucket.mdx deleted file mode 100644 index 77608338562..00000000000 --- a/apps/temp-docs/docs/dart/storage-getbucket.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -id: storage-getbucket -title: "getBucket()" -slug: storage-getbucket -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Retrieves the details of an existing Storage bucket. - - - - - - -```dart -final res = await supabase - .storage - .getBucket('avatars') -``` - - - - - - -## Parameters - - -
    - -
  • -

    - - id - - - required - - - string - -

    -
    - -The unique identifier of the bucket you would like to retrieve. - -
    - -
  • - -
- - -## Notes - -- Policy permissions required: - - `buckets` permissions: `select` - - `objects` permissions: none - - - - - - - - - - -## Examples - -### Get bucket - - - - - - - -```dart -final res = await supabase - .storage - .getBucket('avatars') -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-listbuckets.mdx b/apps/temp-docs/docs/dart/storage-listbuckets.mdx deleted file mode 100644 index c6b8d028480..00000000000 --- a/apps/temp-docs/docs/dart/storage-listbuckets.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -id: storage-listbuckets -title: "listBuckets()" -slug: storage-listbuckets -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Retrieves the details of all Storage buckets within an existing product. - - - - - - -```dart -final res = await supabase - .storage - .listBuckets() -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: `select` - - `objects` permissions: none - - - - - - - - - - -## Examples - -### List buckets - - - - - - - -```dart -final res = await supabase - .storage - .listBuckets() -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/storage-updatebucket.mdx b/apps/temp-docs/docs/dart/storage-updatebucket.mdx deleted file mode 100644 index c89037e2f2d..00000000000 --- a/apps/temp-docs/docs/dart/storage-updatebucket.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -id: storage-updatebucket -title: "updateBucket()" -slug: storage-updatebucket -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Updates a new Storage bucket - - - - - - -```dart -final res = await supabase - .storage - .updateBucket('avatars', { public: false }); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: `update` - - `objects` permissions: none - - - - - - - - - - -## Examples - -### Update bucket - - - - - - - -```dart -final res = await supabase - .storage - .updateBucket('avatars', { public: false }); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/stream.mdx b/apps/temp-docs/docs/dart/stream.mdx deleted file mode 100644 index 167b41e13c4..00000000000 --- a/apps/temp-docs/docs/dart/stream.mdx +++ /dev/null @@ -1,147 +0,0 @@ ---- -id: stream -title: "stream()" -slug: stream -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Notifies of data at the queried table. - - - - - - -```dart -supabase - .from('countries') - .stream() - .execute(); -``` - - - - - - - - - - -## Notes - -- `stream()` will emit the initial data as well as any further change on the database as `Stream` of `List>` by combining Postgrest and Realtime. - - - - - - - - - - -## Examples - -### Listening to a specific table - - - - - - - -```dart -supabase - .from('countries') - .stream() - .execute(); -``` - - - - - - -### Listening to a specific rows within a table - -You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match. -This syntax is the as how you can filter data in Realtime - - - - - - -```dart -supabase - .from('countries:id=eq.120') - .stream() - .execute(); -``` - - - - - - -### With `order()` - - - - - - - -```dart -supabase - .from('countries') - .stream() - .order('name', ascending: false) - .execute(); -``` - - - - - - -### With `limit()` - - - - - - - -```dart -supabase - .from('countries') - .stream() - .order('name', ascending: false) - .limit(10) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/subscribe.mdx b/apps/temp-docs/docs/dart/subscribe.mdx deleted file mode 100644 index 6c109f64659..00000000000 --- a/apps/temp-docs/docs/dart/subscribe.mdx +++ /dev/null @@ -1,237 +0,0 @@ ---- -id: subscribe -title: "on().subscribe()" -slug: subscribe -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Subscribe to realtime changes in your database. - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.all, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - - - - - -## Notes - -- Realtime is disabled by default for new Projects for better database performance and security. You can turn it on by [managing replication](/docs/guides/api#managing-realtime). -- If you want to receive the "previous" data for updates and deletes, you will need to set `REPLICA IDENTITY` to `FULL`, like this: `ALTER TABLE your_table REPLICA IDENTITY FULL;` - - - - - - - - - - -## Examples - -### Listen to all database changes - - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.all, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - -### Listening to a specific table - - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.all, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - -### Listening to inserts - - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.insert, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - -### Listening to updates - -By default, Supabase will send only the updated record. If you want to receive the previous values as well you can -enable full replication for the table you are listening too: - -```sql -alter table "your_table" replica identity full; -``` - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.update, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - -### Listening to deletes - -By default, Supabase does not send deleted records. If you want to receive the deleted record you can -enable full replication for the table you are listening too: - -```sql -alter table "your_table" replica identity full; -``` - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.delete, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - -### Listening to multiple events - -You can chain listeners if you want to listen to multiple events for each table. - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.insert, handleInsert) - .on(SupabaseEventTypes.delete, handleDelete) - .subscribe(); -``` - - - - - - -### Listening to row level changes - -You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match. - - - - - -```dart -final mySubscription = supabase - .from('countries:id=eq.200') - .on(SupabaseEventTypes.update, handleRecordUpdated) - .subscribe(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/textsearch.mdx b/apps/temp-docs/docs/dart/textsearch.mdx deleted file mode 100644 index edda6a8dd14..00000000000 --- a/apps/temp-docs/docs/dart/textsearch.mdx +++ /dev/null @@ -1,147 +0,0 @@ ---- -id: textsearch -title: ".textSearch()" -slug: textsearch -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose tsvector value on the stated `column` matches to_tsquery(query). - - - - - - - - - - - - - - - - - - - - -## Examples - -### Text search - - - - - - - -```dart -final res = await supabase - .from('quotes') - .select('catchphrase') - .textSearch('catchphrase', "'fat' & 'cat'", - config: 'english' - ) - .execute(); -``` - - - - - - -### Basic normalization - -Uses PostgreSQL's `plainto_tsquery` function. - - - - - -```dart -final res = await supabase - .from('quotes') - .select('catchphrase') - .textSearch('catchphrase', "'fat' & 'cat'", - type: TextSearchType.plain, - config: 'english' - ) - .execute(); -``` - - - - - - -### Full normalization - -Uses PostgreSQL's `phraseto_tsquery` function. - - - - - -```dart -final res = await supabase - .from('quotes') - .select('catchphrase') - .textSearch('catchphrase', "'fat' & 'cat'", - type: TextSearchType.phrase, - config: 'english' - ) - .execute(); -``` - - - - - - -### Full normalization - -Uses PostgreSQL's `websearch_to_tsquery` function. -This function will never raise syntax errors, which makes it possible to use raw user-supplied input for search, and can be used -with advanced operators. - -- `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery. -- `"quoted text"`: text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery. -- `OR`: the word “or” will be converted to the | operator. -- `-`: a dash will be converted to the ! operator. - - - - - - -```dart -final res = await supabase - .from('quotes') - .select('catchphrase') - .textSearch('catchphrase', "'fat or cat'", - type: TextSearchType.websearch, - config: 'english' - ) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/update.mdx b/apps/temp-docs/docs/dart/update.mdx deleted file mode 100644 index 18519852ff0..00000000000 --- a/apps/temp-docs/docs/dart/update.mdx +++ /dev/null @@ -1,109 +0,0 @@ ---- -id: update -title: "Modify data: update()" -slug: update -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Performs an UPDATE on the table. - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Middle Earth' }) - .match({ 'name': 'Auckland' }) - .execute(); -``` - - - - - - - - - - -## Notes - -TODO update the link to dart -- `update()` should always be combined with [Filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to update. - - - - - - - - - - -## Examples - -### Updating your data - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Middle Earth' }) - .match({ 'name': 'Auckland' }) - .execute(); -``` - - - - - - -### Updating JSON data - -Postgres offers a -[number of operators](https://www.postgresql.org/docs/current/functions-json.html) -for working with JSON data. Right now it is only possible to update an entire JSON document, -but we are [working on ideas](https://github.com/PostgREST/postgrest/issues/465) for updating individual keys. - - - - - - -```dart -final res = await supabase - .from('users') - .update({ - 'address': { - 'street': 'Melrose Place', - 'postcode': 90210 - } - }) - .eq('address->postcode', 90210) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/upsert.mdx b/apps/temp-docs/docs/dart/upsert.mdx deleted file mode 100644 index 085eab75a02..00000000000 --- a/apps/temp-docs/docs/dart/upsert.mdx +++ /dev/null @@ -1,128 +0,0 @@ ---- -id: upsert -title: "Upsert data: upsert()" -slug: upsert -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Performs an UPSERT into the table. - - - - - - -```dart -final res = await supabase - .from('messages') - .upsert({ 'id': 3, 'message': 'foo', 'username': 'supabot' }) - .execute(); -``` - - - - - - - - - - -## Notes - -- Primary keys should be included in the data payload in order for an update to work correctly. -- Primary keys must be natural, not surrogate. There are however, [workarounds](https://github.com/PostgREST/postgrest/issues/1118) for surrogate primary keys. - - - - - - - - - - -## Examples - -### Upsert your data - - - - - - - -```dart -final res = await supabase - .from('messages') - .upsert({ 'id': 3, 'message': 'foo', 'username': 'supabot' }) - .execute(); -``` - - - - - - -### Upserting into tables with constraints - -Running the following will cause supabase to upsert data into the `users` table. -If the username 'supabot' already exists, the `onConflict` argument tells supabase to overwrite that row -based on the column passed into `onConflict`. - - - - - - -```dart -final res = await supabase - .from('users') - .upsert({ 'username': 'supabot' }, { 'onConflict': 'username' }) - .execute(); -``` - - - - - - -### Return the exact number of rows - -Allowed values for count option are `exact`, `planned` and `estimated`. - - - - - - -```dart -final res = await supabase - .from('users') - .upsert({ - 'id': 3, - 'message': 'foo', - 'username': 'supabot' - }) - .execute(count: CountOption.exact); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/using-filters.mdx b/apps/temp-docs/docs/dart/using-filters.mdx deleted file mode 100644 index 3296a3ee251..00000000000 --- a/apps/temp-docs/docs/dart/using-filters.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: using-filters -title: "Using Filters" -slug: using-filters -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Filters can be used on `select()`, `update()`, and `delete()` queries. - -If a Stored Procedure returns a table response, you can also apply filters. - -### Applying Filters - -You must apply your filters to the end of your query. For example: - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .eq('name', 'The Shire') // Correct - .execute(); - -final res = await supabase - .from('cities') - .eq('name', 'The Shire') // Incorrect - .select('name, country_id') - .execute(); -``` - -### Chaining - -Filters can be chained together to produce advanced queries. For example: - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .gte('population', 1000) - .lt('population', 10000) - .execute(); -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/dart/using-modifiers.mdx b/apps/temp-docs/docs/dart/using-modifiers.mdx deleted file mode 100644 index 8aefaf43501..00000000000 --- a/apps/temp-docs/docs/dart/using-modifiers.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: using-modifiers -title: "Using Modifiers" -slug: using-modifiers -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Modifiers can be used on `select()` queries. - -If a Stored Procedure returns a table response, you can also apply modifiers to the `rpc()` function. \ No newline at end of file diff --git a/apps/temp-docs/docs/postgres/changing-timezones.mdx b/apps/temp-docs/docs/postgres/changing-timezones.mdx deleted file mode 100644 index d05e32afc8b..00000000000 --- a/apps/temp-docs/docs/postgres/changing-timezones.mdx +++ /dev/null @@ -1,119 +0,0 @@ ---- -id: changing-timezones -title: "Changing Timezones" -slug: changing-timezones -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Data types. - - - - - - -```sql -alter database postgres -set timezone to 'America/New_York'; -``` - - - - - - - - - - -## Notes - -- View a full list of timezones on [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - - - - - - - - - - -## Examples - -### Change timezone - - - - - - - -```sql -alter database postgres -set timezone to 'America/New_York'; -``` - - - - - - -### Full list of timezones - -Get a full list of timezones supported by your database. This will return the following columns: - -- `name`: Time zone name -- `abbrev`: Time zone abbreviation -- `utc_offset`: Offset from UTC (positive means east of Greenwich) -- `is_dst`: True if currently observing daylight savings - - - - - - -```sql -select name, abbrev, utc_offset, is_dst -from pg_timezone_names() -order by name; -``` - - - - - - -### Search for a specific timezone - -Use `ilike` (case insensitive search) to find specific timezones. - - - - - -```sql -select * -from pg_timezone_names() -where name ilike '%york%'; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/postgres/columns.mdx b/apps/temp-docs/docs/postgres/columns.mdx deleted file mode 100644 index 0ccaa830381..00000000000 --- a/apps/temp-docs/docs/postgres/columns.mdx +++ /dev/null @@ -1,95 +0,0 @@ ---- -id: columns -title: "Columns" -slug: columns -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Creating columns. - - - - - - -```sql -create table table_name ( - id integer primary key, - data jsonb, - name text -); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### During table creation - - - - - - - -```sql -create table table_name ( - id integer primary key, - data jsonb, - name text -); -``` - - - - - - -### Create column - - - - - - - -```sql -alter table new_table -add new_column text; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/postgres/connection-strings.mdx b/apps/temp-docs/docs/postgres/connection-strings.mdx deleted file mode 100644 index 12e4f919c9c..00000000000 --- a/apps/temp-docs/docs/postgres/connection-strings.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -id: connection-strings -title: "Connection Strings" -slug: connection-strings -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -There are various ways to connect to your database, depending on the configuration of your Postgres instance and the tool which you are connecting with. - - - - - - -```bash -postgres://postgres:postgres@localhost:5432/postgres -# or -postgresql://postgres:postgres@localhost:5432/postgres -``` - - - - - - - - - - -## Notes - -- [Official Documentation](https://www.postgresql.org/docs/current/libpq-connect.html). -- Avoid using special characters usernames and passwords. If you use special characters in a connection URL, you'll need to URL encode any special characters. - - - - - - - - - - -## Examples - -### Basic connection string - -If you're using a default setup, your postgres connection string will likely be in the format: - -`postgres://{user}:{password}@{host}:{port}/{database_name}` - - - - - - -```bash -postgres://postgres:postgres@localhost:5432/postgres -# or -postgresql://postgres:postgres@localhost:5432/postgres -``` - - - - - - -### JDBC - -See full [documentation](http://jdbc.postgresql.org/documentation/head/connect.html). - - - - - -```bash -jdbc:postgresql://{host}:{port}/{database_name} -``` - - - - - - -### ADO.NET - -See full [documentation](http://npgsql.projects.postgresql.org/docs/manual/UserManual.html). - - - - - -```bash -Server=host;Port=5432;User Id=username;Password=secret;Database=database_name; -``` - - - - - - -### PHP - -See full [documentation](http://php.net/manual/en/book.pgsql.php). - - - - - -```bash -host=hostname port=5432 dbname=databasename user=username password=secret -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/postgres/database-passwords.mdx b/apps/temp-docs/docs/postgres/database-passwords.mdx deleted file mode 100644 index 9f58234b1a1..00000000000 --- a/apps/temp-docs/docs/postgres/database-passwords.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -id: database-passwords -title: "Database Passwords" -slug: database-passwords -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Manage the passwords of your database users using any super user. - - - - - - - - - - - - - - - - - - - - -## Examples - -### Password reset - - - - - - - -```sql -alter user postgres -with password 'new_password'; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/postgres/database-users.mdx b/apps/temp-docs/docs/postgres/database-users.mdx deleted file mode 100644 index 8ccca2ce94a..00000000000 --- a/apps/temp-docs/docs/postgres/database-users.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -id: database-users -title: "Database Users" -slug: database-users -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Users and Roles are almost interchangeable. - - - - - - - - - - - - - - - - - - - - -## Examples - -### Create New User - - - - - - - -```sql -create user new_user -with password 'hello'; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/postgres/index.mdx b/apps/temp-docs/docs/postgres/index.mdx deleted file mode 100644 index b6641472785..00000000000 --- a/apps/temp-docs/docs/postgres/index.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -id: index -title: "Getting started" -slug: getting-started -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - -PostgreSQL, also known as Postgres, is a free and open-source relational -database management system emphasizing extensibility and SQL compliance. -It was originally named POSTGRES, referring to its origins as a successor -to the Ingres database developed at the University of California, Berkeley. \ No newline at end of file diff --git a/apps/temp-docs/docs/postgres/publications.mdx b/apps/temp-docs/docs/postgres/publications.mdx deleted file mode 100644 index 87559a38e34..00000000000 --- a/apps/temp-docs/docs/postgres/publications.mdx +++ /dev/null @@ -1,210 +0,0 @@ ---- -id: publications -title: "Publications" -slug: publications -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Publications are a way of grouping changes generated from a table or a group of tables. -These changes can then be sent to other systems (usually another Postgres database). - - - - - - - - - - - - - - - - - - - - -## Examples - -### Create a Publication - -This publication will contain all changes to all tables. - - - - - - -```sql -create publication publication_name -for all tables; -``` - - - - - - -### Create a Publication which listens to individual tables - - - - - - - -```sql -create publication publication_name -for table table_one, table_two; -``` - - - - - - -### Add tables to an existing publication - - - - - - - -```sql -alter publication publication_name -add table table_name; -``` - - - - - - -### Listens to inserts only - - - - - - - -```sql -create publication publication_name -for all tables -with (publish = 'insert'); -``` - - - - - - -### Listens to updates only - - - - - - - -```sql -create publication publication_name -for all tables -with (publish = 'update'); -``` - - - - - - -### Listens to deletions only - - - - - - - -```sql -create publication publication_name -for all tables -with (publish = 'delete'); -``` - - - - - - -### Remove a Publication - - - - - - - -```sql -drop publication if exists publication_name; -``` - - - - - - -### Recreate a Publication - -If you are planning to re-create a publication, it's best to do it in a transaction to ensure the operation succeeds. - - - - - - -```sql -begin; - -- remove the realtime publication - drop publication if exists publication_name; - - -- re-create the publication but don't enable it for any tables - create publication publication_name; -commit; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/postgres/schemas.mdx b/apps/temp-docs/docs/postgres/schemas.mdx deleted file mode 100644 index ad4fbf6d9ef..00000000000 --- a/apps/temp-docs/docs/postgres/schemas.mdx +++ /dev/null @@ -1,114 +0,0 @@ ---- -id: schemas -title: "Schemas" -slug: schemas -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Schemas are like "folders". They help to keep your database organized. - -Schemas are particularly useful for security. You can set different permissions on each schema. -For example, you might want to use a `public` schema for user-facing data, and an `auth` schema for all logins and secured data. - - - - - - -```sql -create schema schema_name; -``` - - - - - - - - - - -## Notes - -- Schemas contain [tables](/docs/reference/postgres/tables), columns, triggers, functions, etc. -- Postgres comes with a `public` schema set up by default. -- It is best practice to use lowercase and underscores when naming schemas. For example: `schema_name`, not `Schema Name`. - - - - - - - - - - -## Examples - -### Creating a schema - - - - - - - -```sql -create schema schema_name; -``` - - - - - - -### Removing a schema - - - - - - - -```sql -drop schema if exists schema_name; -``` - - - - - - -### Using special characters - -Although it's not recommended, you can use uppercase and spaces when naming your schema by wrapping the name with double-quotes. -As a result, you will always need to use double-quotes when referencing your schema. - - - - - - -```sql -create schema "Schema Name"; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/postgres/tables.mdx b/apps/temp-docs/docs/postgres/tables.mdx deleted file mode 100644 index 05df802a961..00000000000 --- a/apps/temp-docs/docs/postgres/tables.mdx +++ /dev/null @@ -1,161 +0,0 @@ ---- -id: tables -title: "Tables" -slug: tables -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgres.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Tables are similar to excel spreadsheets. They contain columns & rows of data. There are a few key differences from a spreadsheet however: - -- Every column is a strict type of data. When you set up a column, you must define what "data type" it is. -- Tables can be joined together through relationships. For example you can have a "users" table, which is joined to a "teams" table. - - - - - - -```sql -create table table_name ( - id integer primary key, - data jsonb, - name text -); - -# with schema -create table schema_name.table_name ( - id integer primary key, - data jsonb, - name text -); -``` - - - - - - - - - - -## Notes - -- Tables contain columns, rows, triggers, comments, -- It is best practice to use lowercase and underscores when naming tables. For example: `table_name`, not `Table Name`. -- Tables belong to [schemas](/docs/reference/postgres/schemas). If you don't explicitly pass the schema, Postgres will assume that you want to create the table in the `public` schema. - - - - - - - - - - -## Examples - -### Create table - - - - - - - -```sql -create table table_name ( - id integer primary key, - data jsonb, - name text -); - -# with schema -create table schema_name.table_name ( - id integer primary key, - data jsonb, - name text -); -``` - - - - - - -### Primary keys using multiple columns - - - - - - - -```sql -create table table_name ( - column_1 data_type, - column_2 data_type - -- Constraints: - primary key (column_1, column_2) -); -``` - - - - - - -### Multiple foreign keys to the same table - - - - - - - -```sql -alter table table_name - add constraint constraint_name_1 foreign key (column_1) references foreign_table(id), - add constraint constraint_name_2 foreign key (column_2) references foreign_table(id); -``` - - - - - - -### Delete a table - - - - - - - -```sql -delete table if exists table_name; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/api.mdx b/apps/temp-docs/docs/reference/api.mdx new file mode 100644 index 00000000000..8f9bd942142 --- /dev/null +++ b/apps/temp-docs/docs/reference/api.mdx @@ -0,0 +1,37 @@ +--- +slug: / +sidebar_position: 1 +sidebar_label: Supabase API +--- + +# Supabase API + +The Supabase API allows you to manage your projects programmatically. + +## Status + +The Supabase API is in `beta`. It is usable in it's current state, but it's likely that there will be breaking changes. + +## Authentication + +All API requests require a Supabase Personal token to be included in the Authorization header: `Authorization Bearer -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-db-branch-delete.mdx b/apps/temp-docs/docs/reference/cli/supabase-db-branch-delete.mdx deleted file mode 100644 index 37ddb844a7c..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-db-branch-delete.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-db-branch-delete -title: "supabase db branch delete" -slug: supabase-db-branch-delete -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Delete a branch. - -Usage: - supabase db branch delete -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-db-branch-list.mdx b/apps/temp-docs/docs/reference/cli/supabase-db-branch-list.mdx deleted file mode 100644 index 9933f256e6e..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-db-branch-list.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-db-branch-list -title: "supabase db branch list" -slug: supabase-db-branch-list -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -List branches. - -Usage: - supabase db branch list -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-db-changes.mdx b/apps/temp-docs/docs/reference/cli/supabase-db-changes.mdx deleted file mode 100644 index 2b4bdbe6cf1..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-db-changes.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-db-changes -title: "supabase db changes" -slug: supabase-db-changes -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Diffs the local database with current migrations, then print the diff to standard output. - -Usage: - supabase db changes -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-db-commit.mdx b/apps/temp-docs/docs/reference/cli/supabase-db-commit.mdx deleted file mode 100644 index 8823a7fa6d3..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-db-commit.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-db-commit -title: "supabase db commit" -slug: supabase-db-commit -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Diffs the local database with current migrations, writing it as a new migration. - -Usage: - supabase db commit -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-db-push.mdx b/apps/temp-docs/docs/reference/cli/supabase-db-push.mdx deleted file mode 100644 index 0b3435b4186..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-db-push.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-db-push -title: "supabase db push" -slug: supabase-db-push -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Push new migrations to the remote database. - -Usage: - supabase db push -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-db-remote-commit.mdx b/apps/temp-docs/docs/reference/cli/supabase-db-remote-commit.mdx deleted file mode 100644 index c09e1ee77e0..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-db-remote-commit.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-db-remote-commit -title: "supabase db remote commit" -slug: supabase-db-remote-commit -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Commit changes on the remote database since the last pushed migration. - -Usage: - supabase db remote commit -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-db-remote-set.mdx b/apps/temp-docs/docs/reference/cli/supabase-db-remote-set.mdx deleted file mode 100644 index 93a240ee0a5..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-db-remote-set.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-db-remote-set -title: "supabase db remote set" -slug: supabase-db-remote-set -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Set the remote database to push migrations to. - -Usage: - supabase db remote set -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-db-reset.mdx b/apps/temp-docs/docs/reference/cli/supabase-db-reset.mdx deleted file mode 100644 index dea74ae7534..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-db-reset.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-db-reset -title: "supabase db reset" -slug: supabase-db-reset -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Resets the local database to reflect current migrations. Any changes on the local database that is not committed will be lost. - -Usage: - supabase db reset -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-db-switch.mdx b/apps/temp-docs/docs/reference/cli/supabase-db-switch.mdx deleted file mode 100644 index faf65f86268..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-db-switch.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-db-switch -title: "supabase db switch" -slug: supabase-db-switch -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Switch branches. - -Usage: - supabase db switch -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-eject.mdx b/apps/temp-docs/docs/reference/cli/supabase-eject.mdx deleted file mode 100644 index e7d12225dab..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-eject.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -id: supabase-eject -title: "supabase eject" -slug: supabase-eject -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -```bash -supabase eject -``` - -Run in any folder to create a `docker` folder with a `docker-compose.yml`. This is useful for self-hosting or adding custom configuration. - -See our [Self Hosting](/docs/guides/hosting/overview) docs for more details. \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-help.mdx b/apps/temp-docs/docs/reference/cli/supabase-help.mdx deleted file mode 100644 index 8494f7305ee..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-help.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -id: supabase-help -title: "supabase help" -slug: supabase-help -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Help provides help for any command in the application. -Simply type supabase help [path to command] for full details. - -Usage: - supabase help [command] -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-init.mdx b/apps/temp-docs/docs/reference/cli/supabase-init.mdx deleted file mode 100644 index 21472d298d8..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-init.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-init -title: "supabase init" -slug: supabase-init -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Initialize a project to use Supabase CLI. - -Usage: - supabase init -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-migration-new.mdx b/apps/temp-docs/docs/reference/cli/supabase-migration-new.mdx deleted file mode 100644 index 90d692a1598..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-migration-new.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-migration-new -title: "supabase migration new" -slug: supabase-migration-new -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Create an empty migration. - -Usage: - supabase migration new -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-start.mdx b/apps/temp-docs/docs/reference/cli/supabase-start.mdx deleted file mode 100644 index d7eb6395774..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-start.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: supabase-start -title: "supabase start" -slug: supabase-start -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -``` -Start the Supabase local development setup. - -Usage: - supabase start -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/cli/supabase-stop.mdx b/apps/temp-docs/docs/reference/cli/supabase-stop.mdx deleted file mode 100644 index ca813c5a1c2..00000000000 --- a/apps/temp-docs/docs/reference/cli/supabase-stop.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -id: supabase-stop -title: "supabase stop" -slug: supabase-stop -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/cli.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -```bash -supabase stop -``` - -When you are finished with Supabase, run `supabase stop` to stop the Docker services. \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/.gitkeep b/apps/temp-docs/docs/reference/dart/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/apps/temp-docs/docs/reference/dart/auth-onauthstatechange.mdx b/apps/temp-docs/docs/reference/dart/auth-onauthstatechange.mdx deleted file mode 100644 index e495f9deeb2..00000000000 --- a/apps/temp-docs/docs/reference/dart/auth-onauthstatechange.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -id: auth-onauthstatechange -title: "auth.onAuthStateChange()" -slug: auth-onauthstatechange -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Receive a notification every time an auth event happens. - - - - - - -```dart -final subscription = supabase.auth.onAuthStateChange((event, session) { - print(session?.user?.id); - // handle auth state change -}); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Listen to auth changes - - - - - - - -```dart -final subscription = supabase.auth.onAuthStateChange((event, session) { - print(session?.user?.id); - // handle auth state change -}); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/auth-session.mdx b/apps/temp-docs/docs/reference/dart/auth-session.mdx deleted file mode 100644 index 361bb5d22fb..00000000000 --- a/apps/temp-docs/docs/reference/dart/auth-session.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -id: auth-session -title: "auth.session()" -slug: auth-session -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Returns the session data, if there is an active session. - - - - - - -```dart -final session = supabase.auth.session(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Get the session data - - - - - - - -```dart -final session = supabase.auth.session(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/auth-signin.mdx b/apps/temp-docs/docs/reference/dart/auth-signin.mdx deleted file mode 100644 index 31ab4d1a35a..00000000000 --- a/apps/temp-docs/docs/reference/dart/auth-signin.mdx +++ /dev/null @@ -1,103 +0,0 @@ ---- -id: auth-signin -title: 'auth.signIn()' -slug: auth-signin -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs' -import TabsPanel from '@theme/TabsPanel' - -Log in an existing user, or login via a third-party provider. - - - - - -```dart -final res = await supabase.auth.signIn(email: 'example@email.com', password: 'example-password'); - -final user = res.data?.user; -final error = res.error; -``` - - - - - -## Notes - -- A user can sign up via email, phone number. -- If you provide `email` without a `password`, the user will be sent a magic link. -- The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com) -- Similarly, if you provide `phone` without a `password`, the user will be sent a one time password. -- If you are looking to sign users in with OAuth in Flutter apps, go to [`signInWithProvider()`](/docs/reference/dart/auth-signinwithprovider). - -## Examples - -### Sign in with email. - - - - - -```dart -final res = await supabase.auth.signIn(email: 'example@email.com', password: 'example-password'); - -final user = res.data?.user; -final error = res.error; -``` - - - - - -### Sign in with magic link. - -If email is provided, but no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds. - - - - - -```dart -final res = await supabase.auth.signIn(email: 'example@email.com'); - -final error = res.error; -``` - - - - - -### Get OAuth sign in URL. - -Passing provider parameter to `signIn()` will return a URL to sign your user in via OAuth. -If you are looking to sign in a user via OAuth on Flutter app, go to [`signInWithProvider()`](/docs/reference/dart/auth-signinwithprovider). - - - - - -```dart -final res = await supabase.auth.signIn(provider: Provider.github); - -final url = res.data?.url; -final error = res.error; -``` - - - - diff --git a/apps/temp-docs/docs/reference/dart/auth-signinwithprovider.mdx b/apps/temp-docs/docs/reference/dart/auth-signinwithprovider.mdx deleted file mode 100644 index 62863ba012e..00000000000 --- a/apps/temp-docs/docs/reference/dart/auth-signinwithprovider.mdx +++ /dev/null @@ -1,129 +0,0 @@ ---- -id: auth-signinwithprovider -title: "auth.signInWithProvider()" -slug: auth-signinwithprovider -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Signs the user in using third party OAuth providers. - - - - - - -```dart -final res = await supabase.auth.signInWithProvider(Provider.github); - -final error = res.error; -``` - - - - - - - - - - -## Notes - -- `auth.signInWithProvider()` is only available on `supabase_flutter` -- It will open the browser to the relevant login page. - - - - - - - - - - -## Examples - -### Sign in with provider. - - - - - - - -```dart -final res = await supabase.auth.signInWithProvider(Provider.github); - -final error = res.error; -``` - - - - - - -### With `redirectTo` - -Specify the redirect link to bring back the user via deeplink. -Note that `redirectTo` should be null for Flutter Web. - - - - - - -```dart -final res = await supabase.auth.signInWithProvider( - Provider.github, - options: AuthOptions( - redirectTo: kIsWeb - ? null - : 'io.supabase.flutter://reset-callback/'), -); - -final error = res.error; -``` - - - - - - -### With scopes - -If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request to get back an OAuth provider token. -You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider. - - - - - - -```dart -const { user, session, error } = await supabase.auth.signIn({ - provider: 'github' -}, { - scopes: 'repo gist notifications' -}) -const oAuthToken = session.provider_token // use to access provider API -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/auth-signout.mdx b/apps/temp-docs/docs/reference/dart/auth-signout.mdx deleted file mode 100644 index d1458aec554..00000000000 --- a/apps/temp-docs/docs/reference/dart/auth-signout.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -id: auth-signout -title: "auth.signOut()" -slug: auth-signout -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Signs out the current user, if there is a logged in user. - - - - - - -```dart -final res = await supabase.auth.signOut(); - -final error = res.error; -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Sign out - - - - - - - -```dart -final res = await supabase.auth.signOut(); - -final error = res.error; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/auth-signup.mdx b/apps/temp-docs/docs/reference/dart/auth-signup.mdx deleted file mode 100644 index b891b85bc2f..00000000000 --- a/apps/temp-docs/docs/reference/dart/auth-signup.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -id: auth-signup -title: 'auth.signUp()' -slug: auth-signup -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs' -import TabsPanel from '@theme/TabsPanel' - -Creates a new user. - - - - - -```dart -final res = await supabase.auth.signUp('example@email.com', 'example-password'); - -final user = res.data?.user; -final error = res.error; -``` - - - - - -## Notes - -- By default, the user will need to verify their email address before logging in. If you would like to change this, you can disable "Email Confirmations" by going to Authentication -> Settings on [app.supabase.com](https://app.supabase.com) -- If "Email Confirmations" is turned on, a `user` is returned but `session` will be null -- If "Email Confirmations" is turned off, both a `user` and a `session` will be returned -- When the user confirms their email address, they will be redirected to localhost:3000 by default. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com) - -## Examples - -### Sign up. - - - - - -```dart -final res = await supabase.auth.signUp('example@email.com', 'example-password'); - -final user = res.data?.user; -final error = res.error; -``` - - - - - -### Sign up with third-party providers. - -If you are using Flutter, you can sign up with OAuth providers using the [`signInWithProvider()`](/docs/reference/dart/auth-signinwithprovider) method available on `supabase_flutter`. diff --git a/apps/temp-docs/docs/reference/dart/auth-update.mdx b/apps/temp-docs/docs/reference/dart/auth-update.mdx deleted file mode 100644 index 95451f08b8e..00000000000 --- a/apps/temp-docs/docs/reference/dart/auth-update.mdx +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: auth-update -title: "auth.update()" -slug: auth-update -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Updates user data, if there is a logged in user. - - - - - - -```dart -final res = await supabase.auth.update( - UserAttributes(data: {'hello': 'world'}) -); - -final error = res.error; -``` - - - - - - - - - - -## Notes - -It's generally better to store user data in a table inside your public schema (i.e. `public.users`). -Use the `update()` method if you have data which rarely changes or is specific only to the logged in user. - - - - - - - - - - -## Examples - -### Update a user's metadata. - - - - - - - -```dart -final res = await supabase.auth.update( - UserAttributes(data: {'hello': 'world'}) -); - -final error = res.error; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/auth-user.mdx b/apps/temp-docs/docs/reference/dart/auth-user.mdx deleted file mode 100644 index fb11208dea8..00000000000 --- a/apps/temp-docs/docs/reference/dart/auth-user.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -id: auth-user -title: "auth.user()" -slug: auth-user -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Returns the user data, if there is a logged in user. - - - - - - -```dart -final user = supabase.auth.user(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Get the logged in user - - - - - - - -```dart -final user = supabase.auth.user(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/containedby.mdx b/apps/temp-docs/docs/reference/dart/containedby.mdx deleted file mode 100644 index 0902ece9744..00000000000 --- a/apps/temp-docs/docs/reference/dart/containedby.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: containedby -title: ".containedBy()" -slug: containedby -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .containedBy('main_exports', ['cars', 'food', 'machine']) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .containedBy('main_exports', ['cars', 'food', 'machine']) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .containedBy('main_exports', ['orks', 'surveillance', 'evil']) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .containedBy('main_exports', ['cars', 'food', 'machine']) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .containedBy('main_exports', ['cars', 'food', 'machine']) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/contains.mdx b/apps/temp-docs/docs/reference/dart/contains.mdx deleted file mode 100644 index c350feeecbc..00000000000 --- a/apps/temp-docs/docs/reference/dart/contains.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: contains -title: ".contains()" -slug: contains -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .contains('main_exports', ['oil']) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .contains('main_exports', ['oil']) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .contains('main_exports', ['oil']) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .contains('main_exports', ['oil']) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .contains('main_exports', ['oil']) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/delete.mdx b/apps/temp-docs/docs/reference/dart/delete.mdx deleted file mode 100644 index 37b570eefa3..00000000000 --- a/apps/temp-docs/docs/reference/dart/delete.mdx +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: delete -title: "Delete data: delete()" -slug: delete -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Performs a DELETE on the table. - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .match({ 'id': 666 }) - .execute(); -``` - - - - - - - - - - -## Notes - -TODO update link to dart -- `delete()` should always be combined with [Filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to delete. - - - - - - - - - - -## Examples - -### Delete records - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .match({ 'id': 666 }) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/eq.mdx b/apps/temp-docs/docs/reference/dart/eq.mdx deleted file mode 100644 index b631453c7f3..00000000000 --- a/apps/temp-docs/docs/reference/dart/eq.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: eq -title: ".eq()" -slug: eq -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` exactly matches the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .eq('name', 'The shire') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .eq('name', 'The shire') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .eq('name', 'San Francisco') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .eq('name', 'Mordor') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .eq('name', 'San Francisco') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/filter.mdx b/apps/temp-docs/docs/reference/dart/filter.mdx deleted file mode 100644 index b637f533442..00000000000 --- a/apps/temp-docs/docs/reference/dart/filter.mdx +++ /dev/null @@ -1,170 +0,0 @@ ---- -id: filter -title: ".filter()" -slug: filter -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose `column` satisfies the filter. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .filter('name', 'in', '("Paris","Tokyo")') - .execute(); -``` - - - - - - - - - - -## Notes - -- `.filter()` expects you to use the raw [PostgREST syntax](https://postgrest.org/en/stable/api.html#horizontal-filtering-rows) for the filter values, so it should only be used as an escape hatch in case other filters don't work. - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .filter('name', 'in', '("Paris","Tokyo")') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .filter('name', 'in', '("Paris","Tokyo")') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .filter('name', 'in', '("Paris","Tokyo")') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .filter('name', 'in', '("Paris","Tokyo")') -``` - - - - - - -### Filter embedded resources - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, countries ( name )') - .filter('countries.name', 'in', '("France","Japan")') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/getsubscriptions.mdx b/apps/temp-docs/docs/reference/dart/getsubscriptions.mdx deleted file mode 100644 index 1ddf8924852..00000000000 --- a/apps/temp-docs/docs/reference/dart/getsubscriptions.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -id: getsubscriptions -title: "getSubscriptions()" -slug: getsubscriptions -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Returns an array of all your subscriptions. - - - - - - -```dart -final subscriptions = supabase.getSubscriptions(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Get all subscriptions - - - - - - - -```dart -final subscriptions = supabase.getSubscriptions(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/gt.mdx b/apps/temp-docs/docs/reference/dart/gt.mdx deleted file mode 100644 index 4c211f5b871..00000000000 --- a/apps/temp-docs/docs/reference/dart/gt.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: gt -title: ".gt()" -slug: gt -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` is greater than the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .gt('country_id', 250) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .gt('country_id', 250) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .gt('country_id', 250) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .gt('country_id', 250) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .gt('country_id', 250) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/gte.mdx b/apps/temp-docs/docs/reference/dart/gte.mdx deleted file mode 100644 index 1effd302292..00000000000 --- a/apps/temp-docs/docs/reference/dart/gte.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: gte -title: ".gte()" -slug: gte -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` is greater than or equal to the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .gte('country_id', 250) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .gte('country_id', 250) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .gte('country_id', 250) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .gte('country_id', 250) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .gte('country_id', 250) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/ilike.mdx b/apps/temp-docs/docs/reference/dart/ilike.mdx deleted file mode 100644 index 35fa42c2602..00000000000 --- a/apps/temp-docs/docs/reference/dart/ilike.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: ilike -title: ".ilike()" -slug: ilike -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value in the stated `column` matches the supplied `pattern` (case insensitive). - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .ilike('name', '%la%') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .ilike('name', '%la%') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .ilike('name', '%la%') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .ilike('name', '%la%') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .ilike('name', '%la%') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/in_.mdx b/apps/temp-docs/docs/reference/dart/in_.mdx deleted file mode 100644 index 23d18ca4ed3..00000000000 --- a/apps/temp-docs/docs/reference/dart/in_.mdx +++ /dev/null @@ -1,148 +0,0 @@ ---- -id: in_ -title: ".in_()" -slug: in_ -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` is found on the specified `values`. - -`is_` and `in_` filter methods are suffixed with `_` to avoid collisions with reserved keywords. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .in_('name', ['Rio de Janeiro', 'San Francisco']) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .in_('name', ['Rio de Janeiro', 'San Francisco']) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .in_('name', ['Rio de Janeiro', 'San Francisco']) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .in_('name', ['Rio de Janeiro', 'San Francisco']) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .in_('name', ['Rio de Janeiro', 'San Francisco']) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/index.mdx b/apps/temp-docs/docs/reference/dart/index.mdx deleted file mode 100644 index acffea0ac94..00000000000 --- a/apps/temp-docs/docs/reference/dart/index.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -id: index -title: "Getting started" -slug: getting-started -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - -Supabase Dart. \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/initializing.mdx b/apps/temp-docs/docs/reference/dart/initializing.mdx deleted file mode 100644 index 87b3b493a6c..00000000000 --- a/apps/temp-docs/docs/reference/dart/initializing.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -id: initializing -title: "Initializing" -slug: initializing -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -## Dart -You can initialize a new Supabase client using the `SupabaseClient()` method. - -The Supabase client is your entrypoint to the rest of the Supabase functionality -and is the easiest way to interact with everything we offer within the Supabase ecosystem. - - -## Flutter - -For `supabase_flutter`, you will be using the static `initialize()` method on `Supabase` class. - - - - - - - - - - - - - - - - - - - - -## Examples - -### Dart SupabaseClient() - - - - - - - -```dart -final supabase = SupabaseClient('https://xyzcompany.supabase.co', 'public-anon-key'); -``` - - - - - - -### Flutter initialize() - - - - - - - -```dart title="main.dart" -Future main() async { - await Supabase.initialize(url: 'https://xyzcompany.supabase.co', anonKey: 'public-anon-key'); - runApp(MyApp()); -} -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/insert.mdx b/apps/temp-docs/docs/reference/dart/insert.mdx deleted file mode 100644 index c5422081ee2..00000000000 --- a/apps/temp-docs/docs/reference/dart/insert.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -id: insert -title: "Create data: insert()" -slug: insert -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Performs an INSERT into the table. - - - - - - -```dart -final res = await supabase - .from('cities') - .insert([ - {'name': 'The Shire', 'country_id': 554} - ]).execute(); -``` - - - - - - - - - - -## Notes - -- By default, every time you run `insert()`, the client library will make a `select` to return the full record. -This is convenient, but it can also cause problems if your Policies are not configured to allow the `select` operation. -If you are using Row Level Security and you are encountering problems, try setting the `returning` param to `minimal`. - - - - - - - - - - -## Examples - -### Create a record - - - - - - - -```dart -final res = await supabase - .from('cities') - .insert([ - {'name': 'The Shire', 'country_id': 554} - ]).execute(); -``` - - - - - - -### Bulk create - - - - - - - -```dart -final res = await supabase - .from('cities') - .insert([ - {'name': 'The Shire', 'country_id': 554}, - {'name': 'Rohan', 'country_id': 555}, - ]).execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/installing.mdx b/apps/temp-docs/docs/reference/dart/installing.mdx deleted file mode 100644 index 290000ecd86..00000000000 --- a/apps/temp-docs/docs/reference/dart/installing.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: installing -title: "Installing" -slug: installing -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -## Dart - -Dart libraries are built and supported by the community. - -```bash -dart pub add supabase -``` - -Find the source code on [GitHub](https://github.com/supabase/supabase-dart). - -## Flutter - -For Flutter project, you can use [supabase_flutter](https://github.com/supabase/supabase-flutter). - -```bash -flutter pub add supabase_flutter -``` - -`supabase_flutter` plugin uses `supabase` plugin internally, and it adds some Flutter specific functionality such as handling deeplinks coming back from magic link verifications. -If you are creating a Flutter application, we recommend using `supabase_flutter` instead of `supabase`. - -For the most part `supabase_flutter` shares the same API as `supabase` with few exceptions such as initialization or OAuth sign in. \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/is_.mdx b/apps/temp-docs/docs/reference/dart/is_.mdx deleted file mode 100644 index c1d5af70780..00000000000 --- a/apps/temp-docs/docs/reference/dart/is_.mdx +++ /dev/null @@ -1,148 +0,0 @@ ---- -id: is_ -title: ".is_()" -slug: is_ -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -A check for exact equality (null, true, false), finds all rows whose value on the stated `column` exactly match the specified `value`. - -`is_` and `in_` filter methods are suffixed with `_` to avoid collisions with reserved keywords. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .is_('name', null) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .is_('name', null) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .is_('name', null) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .is_('name', null) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .is_('name', null) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/like.mdx b/apps/temp-docs/docs/reference/dart/like.mdx deleted file mode 100644 index 4fae8c3c8c7..00000000000 --- a/apps/temp-docs/docs/reference/dart/like.mdx +++ /dev/null @@ -1,191 +0,0 @@ ---- -id: like -title: ".like()" -slug: like -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value in the stated `column` matches the supplied `pattern` (case sensitive). - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .like('name', '%la%') - .execute(); -``` - - - - - - -## Parameters - - -
    - -
  • -

    - - column - - - required - - - object - -

    -
    - -The column to filter on. - -
    - -
  • - - -
  • -

    - - pattern - - - required - - - string - -

    -
    - -The pattern to filter with. - -
    - -
  • - -
- - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .like('name', '%la%') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .like('name', '%la%') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .like('name', '%la%') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .like('name', '%la%') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/limit.mdx b/apps/temp-docs/docs/reference/dart/limit.mdx deleted file mode 100644 index 2a22a201405..00000000000 --- a/apps/temp-docs/docs/reference/dart/limit.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -id: limit -title: "limit()" -slug: limit -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Limits the result with the specified count. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .limit(1) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .limit(1) - .execute(); -``` - - - - - - -### With embedded resources - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, cities(name)') - .eq('name', 'United States') - .limit(1, foreignTable: 'cities' ) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/lt.mdx b/apps/temp-docs/docs/reference/dart/lt.mdx deleted file mode 100644 index b98cd7589b7..00000000000 --- a/apps/temp-docs/docs/reference/dart/lt.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: lt -title: ".lt()" -slug: lt -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` is less than the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .lt('country_id', 250) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .lt('country_id', 250) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .lt('country_id', 250) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .lt('country_id', 250) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .lt('country_id', 250) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/lte.mdx b/apps/temp-docs/docs/reference/dart/lte.mdx deleted file mode 100644 index 8337ccc9a89..00000000000 --- a/apps/temp-docs/docs/reference/dart/lte.mdx +++ /dev/null @@ -1,191 +0,0 @@ ---- -id: lte -title: ".lte()" -slug: lte -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` is less than or equal to the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .lte('country_id', 250) - .execute(); -``` - - - - - - -## Parameters - - -
    - -
  • -

    - - column - - - required - - - object - -

    -
    - -The column to filter on. - -
    - -
  • - - -
  • -

    - - value - - - required - - - object - -

    -
    - -The value to filter with. - -
    - -
  • - -
- - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .lte('country_id', 250) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .lte('country_id', 250) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .lte('country_id', 250) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .lte('country_id', 250) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/match.mdx b/apps/temp-docs/docs/reference/dart/match.mdx deleted file mode 100644 index 69f9a18c47d..00000000000 --- a/apps/temp-docs/docs/reference/dart/match.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: match -title: ".match()" -slug: match -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose columns match the specified `query` object. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .match({'name': 'Beijing', 'country_id': 156}) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .match({'name': 'Beijing', 'country_id': 156}) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .match({'name': 'Beijing', 'country_id': 156}) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .match({'name': 'Beijing', 'country_id': 156}) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .match({'name': 'Beijing', 'country_id': 156}) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/neq.mdx b/apps/temp-docs/docs/reference/dart/neq.mdx deleted file mode 100644 index 92654e12b36..00000000000 --- a/apps/temp-docs/docs/reference/dart/neq.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: neq -title: ".neq()" -slug: neq -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose value on the stated `column` doesn't match the specified `value`. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .neq('name', 'The shire') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .neq('name', 'The shire') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .neq('name', 'San Francisco') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .neq('name', 'Mordor') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities') - .neq('name', 'Lagos') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/not.mdx b/apps/temp-docs/docs/reference/dart/not.mdx deleted file mode 100644 index cc41b7f6038..00000000000 --- a/apps/temp-docs/docs/reference/dart/not.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: not -title: ".not()" -slug: not -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows which doesn't satisfy the filter. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .not('name', 'eq', 'Paris') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .not('name', 'eq', 'Paris') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Mordor' }) - .not('name', 'eq', 'Paris') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .delete() - .not('name', 'eq', 'Paris') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_cities) - .not('name', 'eq', 'Paris') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/or.mdx b/apps/temp-docs/docs/reference/dart/or.mdx deleted file mode 100644 index 4852ebc659b..00000000000 --- a/apps/temp-docs/docs/reference/dart/or.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -id: or -title: ".or()" -slug: or -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows satisfying at least one of the filters. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .or('id.eq.20,id.eq.30') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .or('id.eq.20,id.eq.30') - .execute(); -``` - - - - - - -### Use `or` with `and` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .or('id.gt.20,and(name.eq.New Zealand,name.eq.France)') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/order.mdx b/apps/temp-docs/docs/reference/dart/order.mdx deleted file mode 100644 index 18daaacd619..00000000000 --- a/apps/temp-docs/docs/reference/dart/order.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -id: order -title: "order()" -slug: order -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Orders the result with the specified column. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .order('id', ascending: false ) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .order('id', ascending: false ) - .execute(); -``` - - - - - - -### With embedded resources - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, cities(name)') - .eq('name', 'United States') - .order('name', foreignTable: 'cities') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/overlaps.mdx b/apps/temp-docs/docs/reference/dart/overlaps.mdx deleted file mode 100644 index d7ca0f689b2..00000000000 --- a/apps/temp-docs/docs/reference/dart/overlaps.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: overlaps -title: ".overlaps()" -slug: overlaps -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .overlaps('main_exports', ['computers', 'minerals']) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, main_exports') - .overlaps('main_exports', ['computers', 'minerals']) - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .overlaps('main_exports', ['computers', 'minerals']) - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .overlaps('main_exports', ['computers', 'minerals']) - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .overlaps('main_exports', ['computers', 'minerals']) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/range.mdx b/apps/temp-docs/docs/reference/dart/range.mdx deleted file mode 100644 index affd16f8583..00000000000 --- a/apps/temp-docs/docs/reference/dart/range.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -id: range -title: "range()" -slug: range -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Limits the result to rows within the specified range, inclusive. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .range(0,3) - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .range(0,3) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/rangeadjacent.mdx b/apps/temp-docs/docs/reference/dart/rangeadjacent.mdx deleted file mode 100644 index f31f4f505e9..00000000000 --- a/apps/temp-docs/docs/reference/dart/rangeadjacent.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: rangeadjacent -title: ".rangeAdjacent()" -slug: rangeadjacent -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeAdjacent('population_range_millions', '[70, 185]') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeAdjacent('population_range_millions', '[70, 185]') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .rangeAdjacent('population_range_millions', '[70, 185]') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .rangeAdjacent('population_range_millions', '[70, 185]') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .rangeAdjacent('population_range_millions', '[70, 185]') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/rangegt.mdx b/apps/temp-docs/docs/reference/dart/rangegt.mdx deleted file mode 100644 index 6ddd4b34ed8..00000000000 --- a/apps/temp-docs/docs/reference/dart/rangegt.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: rangegt -title: ".rangeGt()" -slug: rangegt -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeGt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeGt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .rangeGt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .rangeGt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .rangeGt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/rangegte.mdx b/apps/temp-docs/docs/reference/dart/rangegte.mdx deleted file mode 100644 index 3a674440832..00000000000 --- a/apps/temp-docs/docs/reference/dart/rangegte.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: rangegte -title: ".rangeGte()" -slug: rangegte -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeGte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeGte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .rangeGte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .rangeGte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .rangeGte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/rangelt.mdx b/apps/temp-docs/docs/reference/dart/rangelt.mdx deleted file mode 100644 index 43cb40cbd68..00000000000 --- a/apps/temp-docs/docs/reference/dart/rangelt.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: rangelt -title: ".rangeLt()" -slug: rangelt -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeLt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeLt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .rangeLt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .rangeLt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .rangeLt('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/rangelte.mdx b/apps/temp-docs/docs/reference/dart/rangelte.mdx deleted file mode 100644 index c673b888736..00000000000 --- a/apps/temp-docs/docs/reference/dart/rangelte.mdx +++ /dev/null @@ -1,145 +0,0 @@ ---- -id: rangelte -title: ".rangeLte()" -slug: rangelte -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeLte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .select('name, id, population_range_millions') - .rangeLte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `update()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .update({ 'name': 'Mordor' }) - .rangeLte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `delete()` - - - - - - - -```dart -final res = await supabase - .from('countries') - .delete() - .rangeLte('population_range_millions', '[150, 250]') - .execute(); -``` - - - - - - -### With `rpc()` - - - - - - - -```dart -// Only valid if the Stored Procedure returns a table type. -final res = await supabase - .rpc('echo_all_countries') - .rangeLte('population_range_millions', [150, 250]) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/removesubscription.mdx b/apps/temp-docs/docs/reference/dart/removesubscription.mdx deleted file mode 100644 index 76504e2880d..00000000000 --- a/apps/temp-docs/docs/reference/dart/removesubscription.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -id: removesubscription -title: "removeSubscription()" -slug: removesubscription -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Removes an active subscription and returns the number of open connections. - - - - - - -```dart -supabase.removeSubscription(mySubscription); -``` - - - - - - - - - - -## Notes - -- Removing subscriptions is a great way to maintain the performance of your project's database. Supabase will automatically handle cleanup 30 seconds after a user is disconnected, but unused subscriptions may cause degradation as more users are simultaneously subscribed. - - - - - - - - - - -## Examples - -### Remove a subscription - - - - - - - -```dart -supabase.removeSubscription(mySubscription); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/reset-password-email.mdx b/apps/temp-docs/docs/reference/dart/reset-password-email.mdx deleted file mode 100644 index 27086ba3c05..00000000000 --- a/apps/temp-docs/docs/reference/dart/reset-password-email.mdx +++ /dev/null @@ -1,114 +0,0 @@ ---- -id: reset-password-email -title: "Reset Password (Email)" -slug: reset-password-email -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Sends a reset request to an email address. - - - - - - -```dart -final res = await supabase.auth.api.resetPasswordForEmail('user@example.com'); - -final error = res.error; -``` - - - - - - - - - - -## Notes - -Sends a reset request to an email address. - -When the user clicks the reset link in the email they will be forwarded to: - -`#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery` - -Your app must detect `type=recovery` in the fragment and display a password reset form to the user. - -You should then use the access_token in the url and new password to update the user as follows: - -```dart -final res = await supabase.auth.api.updateUser( - accessToken, - UserAttributes(password: 'NEW_PASSWORD'), -); -``` - - - - - - - - - - -## Examples - -### Reset password - - - - - - - -```dart -final res = await supabase.auth.api.resetPasswordForEmail('user@example.com'); - -final error = res.error; -``` - - - - - - -### Reset password for Flutter - - - - - - - -You can pass `redirectTo` to open the app via deeplink when user opens the password reset email. -```dart -final res = await supabase.auth.api.resetPasswordForEmail( - 'user@example.com', - options: AuthOptions(redirectTo: kIsWeb - ? null - : 'io.supabase.flutter://reset-callback/'), -); - -final error = res.error; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/rpc.mdx b/apps/temp-docs/docs/reference/dart/rpc.mdx deleted file mode 100644 index f24ef39b765..00000000000 --- a/apps/temp-docs/docs/reference/dart/rpc.mdx +++ /dev/null @@ -1,119 +0,0 @@ ---- -id: rpc -title: "Stored Procedures: rpc()" -slug: rpc -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -You can call stored procedures as a "Remote Procedure Call". - -That's a fancy way of saying that you can put some logic into your database then call it from anywhere. -It's especially useful when the logic rarely changes - like password resets and updates. - - - - - - -```dart -final res = await supabase - .rpc('hello_world') - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### Call a stored procedure - -This is an example invoking a stored procedure. - - - - - -```dart -final res = await supabase - .rpc('hello_world') - .execute(); -``` - - - - - - -### With Parameters - - - - - - - -```dart -final res = await supabase - .rpc('echo_city', params: { 'name': 'The Shire' }) - .execute(); -``` - - - - - - -### With count option - -You can specify a count option to get the row count along with your data. -Allowed values for count option are `exact`, `planned` and `estimated`. - - - - - - -```dart -final res = await supabase - .rpc('hello_world') - .execute(count: CountOption.exact); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/select.mdx b/apps/temp-docs/docs/reference/dart/select.mdx deleted file mode 100644 index 15037ea81b6..00000000000 --- a/apps/temp-docs/docs/reference/dart/select.mdx +++ /dev/null @@ -1,272 +0,0 @@ ---- -id: select -title: "Fetch data: select()" -slug: select -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Performs vertical filtering with SELECT. - - - - - - -```dart -final res = await supabase - .from('cities') - .select() - .execute(); - -final data = res.data; -final error = res.error; -``` - - - - - - - - - - -## Notes - -- By default, Supabase projects will return a maximum of 1,000 rows. This setting can be changed in Project API Settings. It's recommended that you keep it low to limit the payload size of accidental or malicious requests. You can use `range()` queries to paginate through your data. -- `select()` can be combined with [Modifiers](/docs/reference/dart/using-modifiers) -- `select()` can be combined with [Filters](/docs/reference/dart/using-filters) - - - - - - - - - - -## Examples - -### Getting your data - - - - - - - -```dart -final res = await supabase - .from('cities') - .select() - .execute(); - -final data = res.data; -final error = res.error; -``` - - - - - - -### Selecting specific columns - -You can select specific fields from your tables. - - - - - -```dart -final res = await supabase - .from('cities') - .select('name') - .execute(); -``` - - - - - - -### Query foreign tables - -If your database has relationships, you can query related tables too. - - - - - -```dart -final res = await supabase - .from('countries') - .select(''' - name, - cities ( - name - ) - ''') - .execute(); -``` - - - - - - -### Query the same foreign table multiple times - -Sometimes you will need to query the same foreign table twice. -In this case, you can use the name of the joined column to identify -which join you intend to use. For convenience, you can also give an -alias for each column. For example, if we had a shop of products, -and we wanted to get the supplier and the purchaser at the same time -(both in the users) table: - - - - - - -```dart -final res = await supabase - .from('products') - .select(''' - id, - supplier:supplier_id ( name ), - purchaser:purchaser_id ( name ) - ''') - .execute(); -``` - - - - - - -### Filtering with inner joins - -If you want to filter a table based on a child table's values you can use the `!inner()` function. For example, if you wanted -to select all rows in a `message` table which belong to a user with the `username` "Jane": - - - - - - - -``` -Not yet implemented -``` - - - - - - -### Querying with count option - -You can get the number of rows by using the count option. -Allowed values for count option are [exact](https://postgrest.org/en/stable/api.html#exact-count), [planned](https://postgrest.org/en/stable/api.html#planned-count) and [estimated](https://postgrest.org/en/stable/api.html#estimated-count). - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name') - .execute(count: CountOption.exact); - -final count = res.count; -``` - - - - - - -### Querying JSON data - -If you have data inside of a JSONB column, you can apply select -and query filters to the data values. Postgres offers a -[number of operators](https://www.postgresql.org/docs/current/functions-json.html) -for querying JSON data. Also see -[PostgREST docs](http://postgrest.org/en/v7.0.0/api.html#json-columns) for more details. - - - - - - -```dart -final res = await supabase - .from('users') - .select(''' - id, name, - address->street - ''') - .eq('address->postcode', 90210) - .execute(); -``` - - - - - - -### Return data as CSV - -By default the data is returned in JSON format, however you can also request for it to be returned as Comma Separated Values. - - - - - - -```dart -final res = await supabase - .from('users') - .select() - .csv() - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/single.mdx b/apps/temp-docs/docs/reference/dart/single.mdx deleted file mode 100644 index 8d201ae0dca..00000000000 --- a/apps/temp-docs/docs/reference/dart/single.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -id: single -title: "single()" -slug: single -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Retrieves only one row from the result. Result must be one row (e.g. using limit), otherwise this will result in an error. - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .single() - .execute(); -``` - - - - - - - - - - - - - - - - - - - - - - -## Examples - -### With `select()` - - - - - - - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .single() - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-createbucket.mdx b/apps/temp-docs/docs/reference/dart/storage-createbucket.mdx deleted file mode 100644 index 01ea9fa63b0..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-createbucket.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -id: storage-createbucket -title: "createBucket()" -slug: storage-createbucket -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Creates a new Storage bucket - - - - - - -```dart -final res = await supabase - .storage - .createBucket('avatars'); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: `insert` - - `objects` permissions: none - - - - - - - - - - -## Examples - -### Create bucket - - - - - - - -```dart -final res = await supabase - .storage - .createBucket('avatars'); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-deletebucket.mdx b/apps/temp-docs/docs/reference/dart/storage-deletebucket.mdx deleted file mode 100644 index 60a020ac22b..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-deletebucket.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -id: storage-deletebucket -title: "deleteBucket()" -slug: storage-deletebucket -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Deletes an existing bucket. A bucket can't be deleted with existing objects inside it. You must first `empty()` the bucket. - - - - - - -```dart -final res = await supabase - .storage - .deleteBucket('avatars'); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: `select` and `delete` - - `objects` permissions: none - - - - - - - - - - -## Examples - -### Delete bucket - - - - - - - -```dart -final res = await supabase - .storage - .deleteBucket('avatars'); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-emptybucket.mdx b/apps/temp-docs/docs/reference/dart/storage-emptybucket.mdx deleted file mode 100644 index 0476cb9d25c..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-emptybucket.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -id: storage-emptybucket -title: "emptyBucket()" -slug: storage-emptybucket -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Removes all objects inside a single bucket. - - - - - - -```dart -final res = await supabase - .storage - .emptyBucket('avatars'); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: `select` - - `objects` permissions: `select` and `delete` - - - - - - - - - - -## Examples - -### Empty bucket - - - - - - - -```dart -final res = await supabase - .storage - .emptyBucket('avatars'); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-from-createsignedurl.mdx b/apps/temp-docs/docs/reference/dart/storage-from-createsignedurl.mdx deleted file mode 100644 index 9609d9a96c6..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-from-createsignedurl.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -id: storage-from-createsignedurl -title: "from.createSignedUrl()" -slug: storage-from-createsignedurl -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Create signed url to download file without requiring permissions. This URL can be valid for a set number of seconds. - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .createSignedUrl('avatar1.png', 60); - -final signedURL = res.data; -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `select` - - - - - - - - - - -## Examples - -### Create Signed URL - - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .createSignedUrl('avatar1.png', 60); - -final signedURL = res.data; -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-from-download.mdx b/apps/temp-docs/docs/reference/dart/storage-from-download.mdx deleted file mode 100644 index f5173ee7804..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-from-download.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: storage-from-download -title: "from.download()" -slug: storage-from-download -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Downloads a file. - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .download('avatar1.png'); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `select` - - - - - - - - - - -## Examples - -### Download file - - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .download('avatar1.png'); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-from-getpublicurl.mdx b/apps/temp-docs/docs/reference/dart/storage-from-getpublicurl.mdx deleted file mode 100644 index 1013ec51f67..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-from-getpublicurl.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -id: storage-from-getpublicurl -title: 'from.getPublicUrl()' -slug: storage-from-getpublicurl -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs' -import TabsPanel from '@theme/TabsPanel' - -Retrieve URLs for assets in public buckets - - - - - -```dart -final res = supabase - .storage - .from('public-bucket') - .getPublicUrl('avatar1.png'); - -final publicURL = res.data; -``` - - - - - -## Notes - -- The bucket needs to be set to public, either via [updateBucket()](/docs/reference/javascript/storage-updatebucket) or by going to Storage on [app.supabase.com](https://app.supabase.com), clicking the overflow menu on a bucket and choosing "Make public" -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: none - -## Examples - -### Returns the URL for an asset in a public bucket - - - - - -```dart -final res = supabase - .storage - .from('public-bucket') - .getPublicUrl('avatar1.png'); - -final publicURL = res.data; -``` - - - - diff --git a/apps/temp-docs/docs/reference/dart/storage-from-list.mdx b/apps/temp-docs/docs/reference/dart/storage-from-list.mdx deleted file mode 100644 index 36c9dc50985..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-from-list.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: storage-from-list -title: "from.list()" -slug: storage-from-list -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Lists all the files within a bucket. - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .list(); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `select` - - - - - - - - - - -## Examples - -### List files in a bucket - - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .list(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-from-move.mdx b/apps/temp-docs/docs/reference/dart/storage-from-move.mdx deleted file mode 100644 index 7c14443d94a..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-from-move.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: storage-from-move -title: "from.move()" -slug: storage-from-move -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Moves an existing file, optionally renaming it at the same time. - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .move('public/avatar1.png', 'private/avatar2.png'); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `update` and `select` - - - - - - - - - - -## Examples - -### Move file - - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .move('public/avatar1.png', 'private/avatar2.png'); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-from-remove.mdx b/apps/temp-docs/docs/reference/dart/storage-from-remove.mdx deleted file mode 100644 index 083be494c4e..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-from-remove.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: storage-from-remove -title: "from.remove()" -slug: storage-from-remove -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Deletes files within the same bucket - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .remove(['avatar1.png']); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `delete` and `select` - - - - - - - - - - -## Examples - -### Delete file - - - - - - - -```dart -final res = await supabase - .storage - .from('avatars') - .remove(['avatar1.png']); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-from-update.mdx b/apps/temp-docs/docs/reference/dart/storage-from-update.mdx deleted file mode 100644 index cbe7ccccfd9..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-from-update.mdx +++ /dev/null @@ -1,83 +0,0 @@ ---- -id: storage-from-update -title: "from.update()" -slug: storage-from-update -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Replaces an existing file at the specified path with a new one. - - - - - - -```dart -final avatarFile = File('path/to/file'); -final res = await supabase - .storage - .from('avatars') - .update('public/avatar1.png', avatarFile, fileOptions: FileOptions( - cacheControl: '3600', - upsert: false - )); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `update` and `select` - - - - - - - - - - -## Examples - -### Update file - - - - - - - -```dart -final avatarFile = File('path/to/file'); -final res = await supabase - .storage - .from('avatars') - .update('public/avatar1.png', avatarFile, fileOptions: FileOptions( - cacheControl: '3600', - upsert: false - )); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-from-upload.mdx b/apps/temp-docs/docs/reference/dart/storage-from-upload.mdx deleted file mode 100644 index 59b18350554..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-from-upload.mdx +++ /dev/null @@ -1,152 +0,0 @@ ---- -id: storage-from-upload -title: "from.upload()" -slug: storage-from-upload -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Uploads a file to an existing bucket. - - - - - - -```dart -final avatarFile = File('path/to/file'); -final res = await supabase - .storage - .from('avatars') - .upload('public/avatar1.png', avatarFile, fileOptions: FileOptions( - cacheControl: '3600', - upsert: false - )); -``` - - - - - - -## Parameters - - -
    - -
  • -

    - - path - - - required - - - string - -

    -
    - -The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload. - -
    - -
  • - - -
  • -

    - - fileBody - - - required - - - ArrayBuffer | ArrayBufferView | Blob | Buffer | File | FormData | ReadableStream | ReadableStream | URLSearchParams | string - -

    -
    - -The body of the file to be stored in the bucket. - -
    - -
  • - - -
  • -

    - - fileOptions - - - optional - - - FileOptions - -

    -
    - -HTTP headers. -`cacheControl`: string, the `Cache-Control: max-age=` seconds value. -`contentType`: string, the `Content-Type` header value. Should be specified if using a `fileBody` that is neither `Blob` nor `File` nor `FormData`, otherwise will default to `text/plain;charset=UTF-8`. -`upsert`: boolean, whether to perform an upsert. - -
    - -
  • - -
- - -## Notes - -- Policy permissions required: - - `buckets` permissions: none - - `objects` permissions: `insert` - - - - - - - - - - -## Examples - -### Upload file - - - - - - - -```dart -final avatarFile = File('path/to/file'); -final res = await supabase - .storage - .from('avatars') - .upload('public/avatar1.png', avatarFile, fileOptions: FileOptions( - cacheControl: '3600', - upsert: false - )); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-getbucket.mdx b/apps/temp-docs/docs/reference/dart/storage-getbucket.mdx deleted file mode 100644 index 77608338562..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-getbucket.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -id: storage-getbucket -title: "getBucket()" -slug: storage-getbucket -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Retrieves the details of an existing Storage bucket. - - - - - - -```dart -final res = await supabase - .storage - .getBucket('avatars') -``` - - - - - - -## Parameters - - -
    - -
  • -

    - - id - - - required - - - string - -

    -
    - -The unique identifier of the bucket you would like to retrieve. - -
    - -
  • - -
- - -## Notes - -- Policy permissions required: - - `buckets` permissions: `select` - - `objects` permissions: none - - - - - - - - - - -## Examples - -### Get bucket - - - - - - - -```dart -final res = await supabase - .storage - .getBucket('avatars') -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-listbuckets.mdx b/apps/temp-docs/docs/reference/dart/storage-listbuckets.mdx deleted file mode 100644 index c6b8d028480..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-listbuckets.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -id: storage-listbuckets -title: "listBuckets()" -slug: storage-listbuckets -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Retrieves the details of all Storage buckets within an existing product. - - - - - - -```dart -final res = await supabase - .storage - .listBuckets() -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: `select` - - `objects` permissions: none - - - - - - - - - - -## Examples - -### List buckets - - - - - - - -```dart -final res = await supabase - .storage - .listBuckets() -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/storage-updatebucket.mdx b/apps/temp-docs/docs/reference/dart/storage-updatebucket.mdx deleted file mode 100644 index c89037e2f2d..00000000000 --- a/apps/temp-docs/docs/reference/dart/storage-updatebucket.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -id: storage-updatebucket -title: "updateBucket()" -slug: storage-updatebucket -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Updates a new Storage bucket - - - - - - -```dart -final res = await supabase - .storage - .updateBucket('avatars', { public: false }); -``` - - - - - - - - - - -## Notes - -- Policy permissions required: - - `buckets` permissions: `update` - - `objects` permissions: none - - - - - - - - - - -## Examples - -### Update bucket - - - - - - - -```dart -final res = await supabase - .storage - .updateBucket('avatars', { public: false }); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/stream.mdx b/apps/temp-docs/docs/reference/dart/stream.mdx deleted file mode 100644 index 167b41e13c4..00000000000 --- a/apps/temp-docs/docs/reference/dart/stream.mdx +++ /dev/null @@ -1,147 +0,0 @@ ---- -id: stream -title: "stream()" -slug: stream -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Notifies of data at the queried table. - - - - - - -```dart -supabase - .from('countries') - .stream() - .execute(); -``` - - - - - - - - - - -## Notes - -- `stream()` will emit the initial data as well as any further change on the database as `Stream` of `List>` by combining Postgrest and Realtime. - - - - - - - - - - -## Examples - -### Listening to a specific table - - - - - - - -```dart -supabase - .from('countries') - .stream() - .execute(); -``` - - - - - - -### Listening to a specific rows within a table - -You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match. -This syntax is the as how you can filter data in Realtime - - - - - - -```dart -supabase - .from('countries:id=eq.120') - .stream() - .execute(); -``` - - - - - - -### With `order()` - - - - - - - -```dart -supabase - .from('countries') - .stream() - .order('name', ascending: false) - .execute(); -``` - - - - - - -### With `limit()` - - - - - - - -```dart -supabase - .from('countries') - .stream() - .order('name', ascending: false) - .limit(10) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/subscribe.mdx b/apps/temp-docs/docs/reference/dart/subscribe.mdx deleted file mode 100644 index 6c109f64659..00000000000 --- a/apps/temp-docs/docs/reference/dart/subscribe.mdx +++ /dev/null @@ -1,237 +0,0 @@ ---- -id: subscribe -title: "on().subscribe()" -slug: subscribe -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Subscribe to realtime changes in your database. - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.all, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - - - - - -## Notes - -- Realtime is disabled by default for new Projects for better database performance and security. You can turn it on by [managing replication](/docs/guides/api#managing-realtime). -- If you want to receive the "previous" data for updates and deletes, you will need to set `REPLICA IDENTITY` to `FULL`, like this: `ALTER TABLE your_table REPLICA IDENTITY FULL;` - - - - - - - - - - -## Examples - -### Listen to all database changes - - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.all, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - -### Listening to a specific table - - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.all, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - -### Listening to inserts - - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.insert, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - -### Listening to updates - -By default, Supabase will send only the updated record. If you want to receive the previous values as well you can -enable full replication for the table you are listening too: - -```sql -alter table "your_table" replica identity full; -``` - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.update, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - -### Listening to deletes - -By default, Supabase does not send deleted records. If you want to receive the deleted record you can -enable full replication for the table you are listening too: - -```sql -alter table "your_table" replica identity full; -``` - - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.delete, (payload) { - // Handle realtime payload - }) - .subscribe(); -``` - - - - - - -### Listening to multiple events - -You can chain listeners if you want to listen to multiple events for each table. - - - - - -```dart -final mySubscription = supabase - .from('countries') - .on(SupabaseEventTypes.insert, handleInsert) - .on(SupabaseEventTypes.delete, handleDelete) - .subscribe(); -``` - - - - - - -### Listening to row level changes - -You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match. - - - - - -```dart -final mySubscription = supabase - .from('countries:id=eq.200') - .on(SupabaseEventTypes.update, handleRecordUpdated) - .subscribe(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/textsearch.mdx b/apps/temp-docs/docs/reference/dart/textsearch.mdx deleted file mode 100644 index edda6a8dd14..00000000000 --- a/apps/temp-docs/docs/reference/dart/textsearch.mdx +++ /dev/null @@ -1,147 +0,0 @@ ---- -id: textsearch -title: ".textSearch()" -slug: textsearch -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Finds all rows whose tsvector value on the stated `column` matches to_tsquery(query). - - - - - - - - - - - - - - - - - - - - -## Examples - -### Text search - - - - - - - -```dart -final res = await supabase - .from('quotes') - .select('catchphrase') - .textSearch('catchphrase', "'fat' & 'cat'", - config: 'english' - ) - .execute(); -``` - - - - - - -### Basic normalization - -Uses PostgreSQL's `plainto_tsquery` function. - - - - - -```dart -final res = await supabase - .from('quotes') - .select('catchphrase') - .textSearch('catchphrase', "'fat' & 'cat'", - type: TextSearchType.plain, - config: 'english' - ) - .execute(); -``` - - - - - - -### Full normalization - -Uses PostgreSQL's `phraseto_tsquery` function. - - - - - -```dart -final res = await supabase - .from('quotes') - .select('catchphrase') - .textSearch('catchphrase', "'fat' & 'cat'", - type: TextSearchType.phrase, - config: 'english' - ) - .execute(); -``` - - - - - - -### Full normalization - -Uses PostgreSQL's `websearch_to_tsquery` function. -This function will never raise syntax errors, which makes it possible to use raw user-supplied input for search, and can be used -with advanced operators. - -- `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery. -- `"quoted text"`: text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery. -- `OR`: the word “or” will be converted to the | operator. -- `-`: a dash will be converted to the ! operator. - - - - - - -```dart -final res = await supabase - .from('quotes') - .select('catchphrase') - .textSearch('catchphrase', "'fat or cat'", - type: TextSearchType.websearch, - config: 'english' - ) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/update.mdx b/apps/temp-docs/docs/reference/dart/update.mdx deleted file mode 100644 index 18519852ff0..00000000000 --- a/apps/temp-docs/docs/reference/dart/update.mdx +++ /dev/null @@ -1,109 +0,0 @@ ---- -id: update -title: "Modify data: update()" -slug: update -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Performs an UPDATE on the table. - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Middle Earth' }) - .match({ 'name': 'Auckland' }) - .execute(); -``` - - - - - - - - - - -## Notes - -TODO update the link to dart -- `update()` should always be combined with [Filters](/docs/reference/javascript/using-filters) to target the item(s) you wish to update. - - - - - - - - - - -## Examples - -### Updating your data - - - - - - - -```dart -final res = await supabase - .from('cities') - .update({ 'name': 'Middle Earth' }) - .match({ 'name': 'Auckland' }) - .execute(); -``` - - - - - - -### Updating JSON data - -Postgres offers a -[number of operators](https://www.postgresql.org/docs/current/functions-json.html) -for working with JSON data. Right now it is only possible to update an entire JSON document, -but we are [working on ideas](https://github.com/PostgREST/postgrest/issues/465) for updating individual keys. - - - - - - -```dart -final res = await supabase - .from('users') - .update({ - 'address': { - 'street': 'Melrose Place', - 'postcode': 90210 - } - }) - .eq('address->postcode', 90210) - .execute(); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/upsert.mdx b/apps/temp-docs/docs/reference/dart/upsert.mdx deleted file mode 100644 index 085eab75a02..00000000000 --- a/apps/temp-docs/docs/reference/dart/upsert.mdx +++ /dev/null @@ -1,128 +0,0 @@ ---- -id: upsert -title: "Upsert data: upsert()" -slug: upsert -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Performs an UPSERT into the table. - - - - - - -```dart -final res = await supabase - .from('messages') - .upsert({ 'id': 3, 'message': 'foo', 'username': 'supabot' }) - .execute(); -``` - - - - - - - - - - -## Notes - -- Primary keys should be included in the data payload in order for an update to work correctly. -- Primary keys must be natural, not surrogate. There are however, [workarounds](https://github.com/PostgREST/postgrest/issues/1118) for surrogate primary keys. - - - - - - - - - - -## Examples - -### Upsert your data - - - - - - - -```dart -final res = await supabase - .from('messages') - .upsert({ 'id': 3, 'message': 'foo', 'username': 'supabot' }) - .execute(); -``` - - - - - - -### Upserting into tables with constraints - -Running the following will cause supabase to upsert data into the `users` table. -If the username 'supabot' already exists, the `onConflict` argument tells supabase to overwrite that row -based on the column passed into `onConflict`. - - - - - - -```dart -final res = await supabase - .from('users') - .upsert({ 'username': 'supabot' }, { 'onConflict': 'username' }) - .execute(); -``` - - - - - - -### Return the exact number of rows - -Allowed values for count option are `exact`, `planned` and `estimated`. - - - - - - -```dart -final res = await supabase - .from('users') - .upsert({ - 'id': 3, - 'message': 'foo', - 'username': 'supabot' - }) - .execute(count: CountOption.exact); -``` - - - - - \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/using-filters.mdx b/apps/temp-docs/docs/reference/dart/using-filters.mdx deleted file mode 100644 index 3296a3ee251..00000000000 --- a/apps/temp-docs/docs/reference/dart/using-filters.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: using-filters -title: "Using Filters" -slug: using-filters -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Filters can be used on `select()`, `update()`, and `delete()` queries. - -If a Stored Procedure returns a table response, you can also apply filters. - -### Applying Filters - -You must apply your filters to the end of your query. For example: - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .eq('name', 'The Shire') // Correct - .execute(); - -final res = await supabase - .from('cities') - .eq('name', 'The Shire') // Incorrect - .select('name, country_id') - .execute(); -``` - -### Chaining - -Filters can be chained together to produce advanced queries. For example: - -```dart -final res = await supabase - .from('cities') - .select('name, country_id') - .gte('population', 1000) - .lt('population', 10000) - .execute(); -``` \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/using-modifiers.mdx b/apps/temp-docs/docs/reference/dart/using-modifiers.mdx deleted file mode 100644 index 8aefaf43501..00000000000 --- a/apps/temp-docs/docs/reference/dart/using-modifiers.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: using-modifiers -title: "Using Modifiers" -slug: using-modifiers -custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml ---- - -import Tabs from '@theme/Tabs'; -import TabsPanel from '@theme/TabsPanel'; - -Modifiers can be used on `select()` queries. - -If a Stored Procedure returns a table response, you can also apply modifiers to the `rpc()` function. \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/dart/v0.mdx b/apps/temp-docs/docs/reference/dart/v0.mdx new file mode 100644 index 00000000000..9ba0ee46873 --- /dev/null +++ b/apps/temp-docs/docs/reference/dart/v0.mdx @@ -0,0 +1,26 @@ +--- +id: intro +slug: / +sidebar_label: Supabase Dart Library +--- + +# Supabase Dart Library + +:::caution +You're viewing the docs for an older version of the `supabase-flutter` library. +::: + +This reference documents every object and method available in Supabase's isomorphic Dart library, `supabase-dart`. + +You can use the `supabase-dart` library to: + +- interact with your Postgres database +- listen to database changes +- invoke Deno Edge Functions +- build login and user management functionality +- manage large files + +## Additional Links + +- Source Code: [github.com/supabase/supabase-dart](https://github.com/supabase/supabase-dart) +- [Known bugs and issues](https://github.com/supabase/supabase-dart/issues) diff --git a/apps/temp-docs/docs/reference/javascript/v1.mdx b/apps/temp-docs/docs/reference/javascript/v1.mdx new file mode 100644 index 00000000000..97230e84aea --- /dev/null +++ b/apps/temp-docs/docs/reference/javascript/v1.mdx @@ -0,0 +1,20 @@ +--- +id: intro +title: 'Supabase JavaScript Library' +slug: / +sidebar_label: Supabase JavaScript Library +--- + +:::caution +You're viewing the docs for an older version of the `supabase-js` library. +::: + +This reference documents every object and method available in Supabase's isomorphic JavaScript library, `supabase-js`. + +You can use the `supabase-js` library to: + +- interact with your Postgres database +- listen to database changes +- invoke Deno Edge Functions +- build login and user management functionality +- manage large files diff --git a/apps/temp-docs/docs/reference/javascript/v1/generating-types.mdx b/apps/temp-docs/docs/reference/javascript/v1/generating-types.mdx new file mode 100644 index 00000000000..033cfdb9165 --- /dev/null +++ b/apps/temp-docs/docs/reference/javascript/v1/generating-types.mdx @@ -0,0 +1,42 @@ +--- +id: generating-types +title: 'Generating Types' +slug: generating-types +custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml +--- + +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +Supabase will soon release native type generators that dump your database types for various languages. For now, we support TypeScript [through third-party tools](/docs/guides/api/generating-types). + +## Usage with TypeScript + +`supabase-js` ships with type definitions for usage with TypeScript and for convenient IntelliSense auto-complete and documentation in your editor. + +When using TypeScript, you can pass the type of database row as a type parameter to the `from` method to get better auto-completion support down the chain. +If you don't provide a type for the row you need to explicitly pass `from('tableName')`. + +```ts +type Message = { + id: number + inserted_at: string + message: string + user_id: string + channel_id: number + author: { username: string } +} + +const response = await supabase + .from('messages') // Message maps to the type of the row in your database. + .select('*, author:user_id(username)') + .match({ channel_id: 2 }) // Your IDE will be able to help with auto-completion. +response.data // Response data will be of type Array. + +// If you don't provide a type for the row you need to explicitly pass `from('tableName')`. +const response = await supabase + .from('messages') + .select('*, author:user_id(username)') + .match({ channel_id: 2 }) +response.data // Response data will be of type Array. +``` diff --git a/apps/temp-docs/docs/reference/javascript/v1/initializing.mdx b/apps/temp-docs/docs/reference/javascript/v1/initializing.mdx new file mode 100644 index 00000000000..711f03f2aed --- /dev/null +++ b/apps/temp-docs/docs/reference/javascript/v1/initializing.mdx @@ -0,0 +1,151 @@ +--- +id: initializing +title: 'Initializing' +slug: initializing +custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml +--- + +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +You can initialize a new Supabase client using the `createClient()` method. + +The Supabase client is your entrypoint to the rest of the Supabase functionality +and is the easiest way to interact with everything we offer within the Supabase ecosystem. + +## Parameters + +
    + +
  • +

    + + supabaseUrl + + + required + + + string + +

    +
    + +The unique Supabase URL which is supplied when you create a new project in your project dashboard. + +
    + +
  • + +
  • +

    + + supabaseKey + + + required + + + string + +

    +
    + +The unique Supabase Key which is supplied when you create a new project in your project dashboard. + +
    + +
  • + +
  • +

    + + options + + + optional + + + SupabaseClientOptions + +

    +
    + +No description provided. + +
    + +
  • + +
+ +## Examples + +### createClient() + +```js +import { createClient } from '@supabase/supabase-js' + +// Create a single supabase client for interacting with your database +const supabase = createClient( + 'https://xyzcompany.supabase.co', + 'public-anon-key' +) +``` + +### With additional parameters + +```js +import { createClient } from '@supabase/supabase-js' + +const options = { + schema: 'public', + headers: { 'x-my-custom-header': 'my-app-name' }, + autoRefreshToken: true, + persistSession: true, + detectSessionInUrl: true, +} +const supabase = createClient( + 'https://xyzcompany.supabase.co', + 'public-anon-key', + options +) +``` + +### API schemas + +```js +import { createClient } from '@supabase/supabase-js' + +// Provide a custom schema. Defaults to "public". +const supabase = createClient( + 'https://xyzcompany.supabase.co', + 'public-anon-key', + { + schema: 'other_schema', + } +) +``` + +By default the API server points to the `public` schema. You can enable other database schemas within the Dashboard. +Go to `Settings > API > Schema` and add the schema which you want to expose to the API. + +Note: each client connection can only access a single schema, so the code above can access the `other_schema` schema but cannot access the `public` schema. + +### Custom `fetch` implementation + +```js +import { createClient } from '@supabase/supabase-js' + +const supabase = createClient( + 'https://xyzcompany.supabase.co', + 'public-anon-key', + { + fetch: fetch.bind(globalThis), + } +) +``` + +`supabase-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests, +but an alternative `fetch` implementation can be provided as an option. +This is most useful in environments where `cross-fetch` is not compatible (for instance Cloudflare Workers). diff --git a/apps/temp-docs/docs/reference/javascript/v1/installing.mdx b/apps/temp-docs/docs/reference/javascript/v1/installing.mdx new file mode 100644 index 00000000000..4441c7253d7 --- /dev/null +++ b/apps/temp-docs/docs/reference/javascript/v1/installing.mdx @@ -0,0 +1,37 @@ +--- +id: installing +title: 'Installing' +slug: installing +custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1.yml +--- + +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +All JavaScript libraries are built directly by the Supabase team. + +Other languages are built by the community and supported by Supabase. + +## JavaScript + +Via NPM + +```bash +npm install @supabase/supabase-js +``` + +Via Yarn + +```bash +yarn add @supabase/supabase-js +``` + +Find the source code on [GitHub](https://github.com/supabase/supabase-js). + +Or via CDN + +```js + +//or + +``` diff --git a/apps/temp-docs/docs/reference/storage.mdx b/apps/temp-docs/docs/reference/storage.mdx new file mode 100644 index 00000000000..4c038f6c7aa --- /dev/null +++ b/apps/temp-docs/docs/reference/storage.mdx @@ -0,0 +1,28 @@ +--- +slug: / +sidebar_position: 1 +sidebar_label: Storage Server +--- + +# Supabase Storage Server + +An S3 compatible object storage service that integrates with Postgres. + +- Uses Postgres as it's datastore for storing metadata +- Authorization rules are written as Postgres Row Level Security policies +- Integrates with S3 as the storage backend (with more in the pipeline!) +- Extremely lightweight and performant + +Read [this post](https://supabase.com/blog/supabase-storage) on why we decided to build a new object storage service. + +## Client libraries + +- [JavaScript](https://github.com/supabase/storage-js) +- [Dart](https://github.com/supabase/storage-dart) + +## Additional Links + +- [Source Code](https://github.com/supabase/storage-api) +- [Known bugs and issues](https://github.com/supabase/storage-js/issues) +- [Storage Guides](https://supabase.com/docs/guides/storage) +- [OpenAPI Docs](https://supabase.github.io/storage-api/) diff --git a/apps/temp-docs/docs/reference/storage/release-notes.mdx b/apps/temp-docs/docs/reference/storage/release-notes.mdx new file mode 100644 index 00000000000..8dad269f0d9 --- /dev/null +++ b/apps/temp-docs/docs/reference/storage/release-notes.mdx @@ -0,0 +1,7 @@ +--- +id: release-notes +--- + +# Release Notes + +All release notes can be found in the [GitHub Releases](https://github.com/supabase/storage-api/releases) page. diff --git a/apps/temp-docs/layouts/Default.tsx b/apps/temp-docs/layouts/Default.tsx index d9fa6f17424..12493ef2abc 100644 --- a/apps/temp-docs/layouts/Default.tsx +++ b/apps/temp-docs/layouts/Default.tsx @@ -1,22 +1,19 @@ -import { useEffect } from 'react' +import { useEffect, FC } from 'react' import Head from 'next/head' import NavBar from '../components/Navigation/NavBar' import SideBar from '../components/Navigation/SideBar' import Footer from '../components/Footer' -const Layout = ({ - meta, - children, - toc, - menuItems, - currentPage, -}: { - meta: { title: string; description: string; hide_table_of_contents?: boolean } +interface Props { + meta: { title: string; description?: string; hide_table_of_contents?: boolean } children: any toc?: any menuItems: any currentPage: string -}) => { + versions: string[] +} + +const Layout: FC = ({ meta, children, toc, menuItems, currentPage, versions }) => { useEffect(() => { const key = localStorage.getItem('supabaseDarkMode') if (!key) { @@ -27,7 +24,7 @@ const Layout = ({ } }, []) - console.log('default', currentPage) + console.log('Default:Layout', { currentPage }) return ( <> @@ -49,7 +46,7 @@ const Layout = ({
- +
diff --git a/apps/temp-docs/layouts/Guide.tsx b/apps/temp-docs/layouts/Guide.tsx index 3fbaeee5bc4..00b36a428ee 100644 --- a/apps/temp-docs/layouts/Guide.tsx +++ b/apps/temp-docs/layouts/Guide.tsx @@ -1,7 +1,7 @@ import { MDXProvider } from '@mdx-js/react' import { NextSeo } from 'next-seo' import { useRouter } from 'next/router' -import { menuItems } from '~/components/Navigation/Nav.constants' +import { menuItems } from '~/components/Navigation/Navigation.constants' import Layout from '~/layouts/Default' import { getPageType } from '~/lib/helpers' import getComponents from '~/lib/mdx/getComponents' @@ -22,6 +22,7 @@ export default function ContentsLayout({ context }: any) { menuItems[page] } currentPage={page} + versions={[]} >
{context.children}
diff --git a/apps/temp-docs/lib/docs.ts b/apps/temp-docs/lib/docs.ts index 4af21292994..7942f7ac243 100644 --- a/apps/temp-docs/lib/docs.ts +++ b/apps/temp-docs/lib/docs.ts @@ -1,16 +1,11 @@ import fs from 'fs' import { join } from 'path' import matter from 'gray-matter' +import nonGeneratedReferencePages from 'data/nonGeneratedReferencePages' +import { REFERENCES } from 'components/Navigation/Navigation.constants' const docsDirectory = process.cwd() -const nonGeneratedReferencePages = [ - 'docs/reference/javascript/installing', - 'docs/reference/javascript/release-notes', - 'docs/reference/javascript/upgrade-guide', - 'docs/reference/javascript/typescript-support', -] - const getPathToGeneratedDoc = (slug: string) => { const sections = slug.split('/') const updatedSections = sections.slice() @@ -19,13 +14,21 @@ const getPathToGeneratedDoc = (slug: string) => { } export function getDocsBySlug(slug: string) { - console.log('getDocsBySlug', { slug }) const realSlug = slug.replace(/\.mdx$/, '') + const formattedSlug = - realSlug.includes('/javascript/') && !nonGeneratedReferencePages.includes(realSlug) + (realSlug.includes('reference/javascript/') && + !nonGeneratedReferencePages.includes(realSlug)) || + (realSlug.includes('reference/dart/') && !nonGeneratedReferencePages.includes(realSlug)) || + (realSlug.includes('reference/cli/') && !nonGeneratedReferencePages.includes(realSlug)) || + (realSlug.includes('reference/api/') && !nonGeneratedReferencePages.includes(realSlug)) || + (realSlug.includes('reference/auth/') && !nonGeneratedReferencePages.includes(realSlug)) || + (realSlug.includes('reference/storage/') && !nonGeneratedReferencePages.includes(realSlug)) ? getPathToGeneratedDoc(realSlug) : realSlug + console.log('getDocsBySlug', { slug, formattedSlug }) + // files can either be .md or .mdx // we need to check which one exists let fullPath @@ -55,12 +58,24 @@ export function getDocsBySlug(slug: string) { export function getAllDocs() { const slugs = walk('docs') - console.log('getAllDocs', slugs) const docs = slugs.map((slug) => getDocsBySlug(slug)) return docs } +export function getLibraryVersions(slug: string) { + const paths = slug.split('/') + if (paths.includes('reference') && paths.length >= 3) { + const reference = REFERENCES[paths[2]] + if (reference?.library !== undefined) { + const path = `data/nav/${reference.library}` + const list = fs.readdirSync(path).map((file) => file.split('.')[0]) + return list.reverse() + } + } + return [] +} + function walk(dir: string) { let results: string[] = [] const list = fs.readdirSync(dir) diff --git a/apps/temp-docs/lib/helpers.ts b/apps/temp-docs/lib/helpers.ts index 93ec6fdb7cd..957482fe354 100644 --- a/apps/temp-docs/lib/helpers.ts +++ b/apps/temp-docs/lib/helpers.ts @@ -6,14 +6,14 @@ export function getPageType(asPath: string) { if (asPath.includes('/guides')) { page = 'docs' - } else if (asPath.includes('/reference/javascript')) { - page = 'reference/javascript' } else if (asPath.includes('/reference/javascript/v1')) { page = 'reference/javascript/v1' - } else if (asPath.includes('/reference/dart')) { - page = 'reference/dart' + } else if (asPath.includes('/reference/javascript')) { + page = 'reference/javascript' } else if (asPath.includes('/reference/dart/v0')) { page = 'reference/dart/v0' + } else if (asPath.includes('/reference/dart')) { + page = 'reference/dart' } else if (asPath.includes('/reference/api')) { page = 'reference/api' } else if (asPath.includes('/reference/cli')) { diff --git a/apps/temp-docs/package.json b/apps/temp-docs/package.json index 16a4b5a0822..4a8db191589 100644 --- a/apps/temp-docs/package.json +++ b/apps/temp-docs/package.json @@ -7,24 +7,31 @@ "build": "next build", "start": "next start", "lint": "next lint", + "generate:all": "npm-run-all --parallel gen:api gen:cli gen:gotrue gen:storage gen:supabase-dart:v0 gen:supabase-dart:v1 gen:supabase-js:v1 gen:supabase-js:v2", + "gen:api": "npm-run-all gen:api:usage", - "gen:api:usage": "ts-node ./generator/index.ts gen --type api --url https://api.supabase.com --input ../../spec/transforms/api_v0_openapi_deparsed.json --output ./_api/usage.mdx", + "gen:api:usage": "ts-node ./generator/index.ts gen --type api --url https://api.supabase.com --input ../../spec/transforms/api_v0_openapi_deparsed.json --output ./docs/reference/api/generated/usage.mdx", + "gen:cli": "npm-run-all gen:cli:commands gen:cli:config", - "gen:cli:commands": "ts-node ./generator/index.ts gen --type cli --input ../../spec/cli_v1_commands.yaml --output ./_cli/generated/usage.mdx ", - "gen:cli:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/cli_v1_config.yaml --output ./_cli/generated/config.mdx", + "gen:cli:commands": "ts-node ./generator/index.ts gen --type cli --input ../../spec/cli_v1_commands.yaml --output ./docs/reference/cli/generated/usage.mdx ", + "gen:cli:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/cli_v1_config.yaml --output ./docs/reference/cli/generated/config.mdx", + "gen:gotrue": "npm-run-all gen:gotrue:config gen:gotrue:usage", - "gen:gotrue:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/gotrue_v1_config.yaml --output ./_gotrue/config.mdx", - "gen:gotrue:usage": "ts-node ./generator/index.ts gen --type api --input ../../spec/transforms/auth_v1_openapi_deparsed.json --output ./_gotrue/usage.mdx", + "gen:gotrue:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/gotrue_v1_config.yaml --output ./docs/reference/auth/generated/config.mdx", + "gen:gotrue:usage": "ts-node ./generator/index.ts gen --type api --input ../../spec/transforms/auth_v1_openapi_deparsed.json --output ./docs/reference/auth/generated/usage.mdx", + "gen:storage": "npm-run-all gen:storage:api gen:storage:config", - "gen:storage:api": "ts-node ./generator/index.ts gen --type api --input ../../spec/transforms/storage_v0_openapi_deparsed.json --output ./_storage/generated/usage.mdx", - "gen:storage:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/storage_v0_config.yaml --output ./_storage/generated/config.mdx", + "gen:storage:api": "ts-node ./generator/index.ts gen --type api --input ../../spec/transforms/storage_v0_openapi_deparsed.json --output ./docs/reference/storage/generated/usage.mdx", + "gen:storage:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/storage_v0_config.yaml --output ./docs/reference/storage/generated/config.mdx", + "gen:supabase-dart:v0": "npm-run-all gen:supabase-dart:v0:ref", - "gen:supabase-dart:v0:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_dart_v0.yml --output ./_supabase_dart_versioned_docs/version-v0/generated", + "gen:supabase-dart:v0:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_dart_v0.yml --output ./docs/reference/dart/v0/generated", "gen:supabase-dart:v1": "npm-run-all gen:supabase-dart:v1:ref", - "gen:supabase-dart:v1:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_dart_v1.yml --output ./_supabase_dart/generated", + "gen:supabase-dart:v1:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_dart_v1.yml --output ./docs/reference/dart/generated", + "gen:supabase-js:v1": "npm-run-all gen:supabase-js:v1:ref", - "gen:supabase-js:v1:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_js_v1.yml --output ./_supabase_js_versioned_docs/version-v1/generated", + "gen:supabase-js:v1:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_js_v1.yml --output ./docs/reference/javascript/v1/generated", "gen:supabase-js:v2": "npm-run-all gen:supabase-js:v2:ref", "gen:supabase-js:v2:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_js_v2.yml --output ./docs/reference/javascript/generated" }, diff --git a/apps/temp-docs/pages/[...slug].tsx b/apps/temp-docs/pages/[...slug].tsx index 018f615b9b1..6ee70385677 100644 --- a/apps/temp-docs/pages/[...slug].tsx +++ b/apps/temp-docs/pages/[...slug].tsx @@ -3,9 +3,9 @@ import { useRouter } from 'next/router' import { MDXRemote } from 'next-mdx-remote' import { serialize } from 'next-mdx-remote/serialize' import components from '../components/index' -import { menuItems } from '../components/Navigation/Nav.constants' +import { menuItems } from '../components/Navigation/Navigation.constants' import { getPageType } from '../lib/helpers' -import { getAllDocs, getDocsBySlug } from '../lib/docs' +import { getAllDocs, getDocsBySlug, getLibraryVersions } from '../lib/docs' import Layout from '~/layouts/Default' // table of contents extractor @@ -18,15 +18,29 @@ interface Meta { hide_table_of_contents: boolean } -export default function Doc({ meta, content, toc }: { meta: Meta; content: any; toc: any }) { +export default function Doc({ + meta, + content, + versions, + toc, +}: { + meta: Meta + content: any + versions: string[] + toc: any +}) { const { asPath } = useRouter() const page = getPageType(asPath) - console.log('[slug]', { meta, asPath, page }) - return ( // @ts-ignore - + @@ -44,13 +58,14 @@ export async function getStaticProps({ params }: { params: { slug: string[] } }) } let doc = getDocsBySlug(slug) - const content = await serialize(doc.content || '') + const versions = getLibraryVersions(slug) return { props: { ...doc, content, + versions, toc: toc(doc.content, { maxdepth: 2 }), }, } diff --git a/apps/temp-docs/pages/index.tsx b/apps/temp-docs/pages/index.tsx index e5ab19cd79c..d11b16a831b 100644 --- a/apps/temp-docs/pages/index.tsx +++ b/apps/temp-docs/pages/index.tsx @@ -2,7 +2,7 @@ import { MDXProvider } from '@mdx-js/react' import { MDXRemote } from 'next-mdx-remote' import { serialize } from 'next-mdx-remote/serialize' import components from '~/components' -import { menuItems } from '~/components/Navigation/Nav.constants' +import { menuItems } from '~/components/Navigation/Navigation.constants' import Layout from '~/layouts/Default' import { getDocsBySlug } from '../lib/docs' @@ -15,7 +15,7 @@ export default function Home({ }) { console.log({ menuItems }, 'index') return ( - + From 51a6b0524a504bec68301f7cb9e39ea7c3ba9e48 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Oct 2022 15:21:28 +0700 Subject: [PATCH 02/10] Update naming in side bar --- apps/temp-docs/components/Navigation/Navigation.constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/temp-docs/components/Navigation/Navigation.constants.ts b/apps/temp-docs/components/Navigation/Navigation.constants.ts index f573d630134..be47bb3933c 100644 --- a/apps/temp-docs/components/Navigation/Navigation.constants.ts +++ b/apps/temp-docs/components/Navigation/Navigation.constants.ts @@ -301,7 +301,7 @@ export const menuItems: NavMenu = { { name: 'Supabase Javascript Library', url: '/reference/javascript', items: [] }, { name: 'Supabase Flutter Library', url: '/reference/dart', items: [] }, { name: 'Supabase CLI', url: '/reference/cli', items: [] }, - { name: 'Supabase API', url: '/reference/api', items: [] }, + { name: 'Management API', url: '/reference/api', items: [] }, ], }, { From e53ca04de339cbb1fd69ccb8efe8fde8d0b01f74 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Oct 2022 15:32:19 +0700 Subject: [PATCH 03/10] Patch --- apps/temp-docs/components/Navigation/SideBar.tsx | 1 + apps/temp-docs/data/nav/auth-server.ts | 1 - apps/temp-docs/docs/reference/auth/release-notes.mdx | 7 +++++++ apps/temp-docs/lib/helpers.ts | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/temp-docs/components/Navigation/SideBar.tsx b/apps/temp-docs/components/Navigation/SideBar.tsx index 19285ac73cc..bdf5d4b453c 100644 --- a/apps/temp-docs/components/Navigation/SideBar.tsx +++ b/apps/temp-docs/components/Navigation/SideBar.tsx @@ -73,6 +73,7 @@ const SideBar = ({ menuItems = [] }: { menuItems: any }) => { )} {menuItems.length === 1 ? (
+

{menuItems[0].label}

{menuItems[0].items.map((item) => ( diff --git a/apps/temp-docs/data/nav/auth-server.ts b/apps/temp-docs/data/nav/auth-server.ts index 93d3b0f4a1f..8dfa1bbe110 100644 --- a/apps/temp-docs/data/nav/auth-server.ts +++ b/apps/temp-docs/data/nav/auth-server.ts @@ -3,7 +3,6 @@ const Nav = [ label: 'Auth', items: [ { name: 'Auth Server', url: '/reference/auth', items: [] }, - { name: 'Usage', url: '/reference/auth/usage', items: [] }, { name: 'Configuration', url: '/reference/auth/config', items: [] }, { name: 'Release Notes', url: '/reference/auth/release-notes', items: [] }, ], diff --git a/apps/temp-docs/docs/reference/auth/release-notes.mdx b/apps/temp-docs/docs/reference/auth/release-notes.mdx index e69de29bb2d..cb164542845 100644 --- a/apps/temp-docs/docs/reference/auth/release-notes.mdx +++ b/apps/temp-docs/docs/reference/auth/release-notes.mdx @@ -0,0 +1,7 @@ +--- +id: release-notes +--- + +# Release Notes + +All release notes can be found in the [GitHub Releases](https://github.com/supabase/gotrue/releases) page. diff --git a/apps/temp-docs/lib/helpers.ts b/apps/temp-docs/lib/helpers.ts index 957482fe354..72a2484e483 100644 --- a/apps/temp-docs/lib/helpers.ts +++ b/apps/temp-docs/lib/helpers.ts @@ -18,6 +18,10 @@ export function getPageType(asPath: string) { page = 'reference/api' } else if (asPath.includes('/reference/cli')) { page = 'reference/cli' + } else if (asPath.includes('/reference/auth')) { + page = 'reference/auth' + } else if (asPath.includes('/reference/storage')) { + page = 'reference/storage' } else if (asPath.includes('/reference')) { page = 'reference' } else { From 3f942051c3d7b55b26f6e1a08a61a503e0896563 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Oct 2022 15:35:09 +0700 Subject: [PATCH 04/10] Update build command --- apps/temp-docs/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/temp-docs/package.json b/apps/temp-docs/package.json index 4a8db191589..27cc92fd1e8 100644 --- a/apps/temp-docs/package.json +++ b/apps/temp-docs/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "next dev --port 3001", - "build": "next build", + "build": "npm run generate:all && next build", "start": "next start", "lint": "next lint", @@ -29,7 +29,7 @@ "gen:supabase-dart:v0:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_dart_v0.yml --output ./docs/reference/dart/v0/generated", "gen:supabase-dart:v1": "npm-run-all gen:supabase-dart:v1:ref", "gen:supabase-dart:v1:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_dart_v1.yml --output ./docs/reference/dart/generated", - + "gen:supabase-js:v1": "npm-run-all gen:supabase-js:v1:ref", "gen:supabase-js:v1:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_js_v1.yml --output ./docs/reference/javascript/v1/generated", "gen:supabase-js:v2": "npm-run-all gen:supabase-js:v2:ref", From adac616e8676c92786fd5cc259100f3639bb40be Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Oct 2022 15:50:41 +0700 Subject: [PATCH 05/10] update --- .../docs/reference/dart/initializing.mdx | 42 ++ .../docs/reference/dart/installing.mdx | 24 + .../docs/reference/dart/upgrade-guide.mdx | 581 ++++++++++++++++++ .../{release-notes.md => release-notes.mdx} | 0 ...ript-support.md => typescript-support.mdx} | 0 apps/temp-docs/package.json | 9 +- 6 files changed, 648 insertions(+), 8 deletions(-) create mode 100644 apps/temp-docs/docs/reference/dart/initializing.mdx create mode 100644 apps/temp-docs/docs/reference/dart/installing.mdx create mode 100644 apps/temp-docs/docs/reference/dart/upgrade-guide.mdx rename apps/temp-docs/docs/reference/javascript/{release-notes.md => release-notes.mdx} (100%) rename apps/temp-docs/docs/reference/javascript/{typescript-support.md => typescript-support.mdx} (100%) diff --git a/apps/temp-docs/docs/reference/dart/initializing.mdx b/apps/temp-docs/docs/reference/dart/initializing.mdx new file mode 100644 index 00000000000..3a76f300c65 --- /dev/null +++ b/apps/temp-docs/docs/reference/dart/initializing.mdx @@ -0,0 +1,42 @@ +--- +id: initializing +title: 'Initializing' +slug: initializing +--- + +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +## Flutter + +For `supabase-flutter`, you will be using the static `initialize()` method on `Supabase` class. + +### Flutter `initialize()` + +```dart title="main.dart" +Future main() async { + await Supabase.initialize(url: 'https://xyzcompany.supabase.co', anonKey: 'public-anon-key'); + runApp(MyApp()); +} +``` + +### Access `SupabaseClient` instance + +Once you initialize Supabase in your `main()` method, you can access the `SupabaseClient` instance from anywhere in your app. + +```dart +final supabase = Supabase.instance.client; +``` + +## Other Dart Projects + +You can initialize a new Supabase client using the `SupabaseClient()` method. + +The Supabase client is your entrypoint to the rest of the Supabase functionality +and is the easiest way to interact with everything we offer within the Supabase ecosystem. + +### Dart `SupabaseClient()` + +```dart +final supabase = SupabaseClient('https://xyzcompany.supabase.co', 'public-anon-key'); +``` diff --git a/apps/temp-docs/docs/reference/dart/installing.mdx b/apps/temp-docs/docs/reference/dart/installing.mdx new file mode 100644 index 00000000000..49822681a67 --- /dev/null +++ b/apps/temp-docs/docs/reference/dart/installing.mdx @@ -0,0 +1,24 @@ +--- +id: installing +title: 'Installing' +slug: installing +--- + +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +## Flutter + +For Flutter project, you can use [supabase_flutter](https://pub.dev/packages/supabase_flutter) package. + +```bash +flutter pub add supabase_flutter +``` + +## Other Dart projects + +For non-Flutter projects using Dart, such as server-side Dart or Angular-Dart, you can use the [supabase](https://pub.dev/packages/supabase) package. + +```bash +dart pub add supabase +``` diff --git a/apps/temp-docs/docs/reference/dart/upgrade-guide.mdx b/apps/temp-docs/docs/reference/dart/upgrade-guide.mdx new file mode 100644 index 00000000000..5ceb6784e50 --- /dev/null +++ b/apps/temp-docs/docs/reference/dart/upgrade-guide.mdx @@ -0,0 +1,581 @@ +--- +id: upgrade-guide +title: Upgrade to supabase-flutter v1 +description: 'Learn how to upgrade to supabase-flutter v1.' +--- + +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +supabase-flutter focuses on improving the developer experience and making it easier to use. This guide will help you upgrade from supabase-flutter v0 to v1. + +## Upgrade the client library + +Update the package in your pubspec.yaml file. + +```yaml +supabase_flutter: ^1.0.0 +``` + +## Error handling + +The way supabase-flutter throws error has changed in v1. In v0, errors were returned as a response. In v1, errors are thrown as exceptions. This makes it more intuitive as a Flutter developer to handle errors. + + + + + +```dart +final res = await supabase.from('my_table').select().execute(); +final error = res.error; +if(error != null) { + // handle error +} +final data = res.data; +``` + + + + + +```dart +try { + final data = supabase.from('my_table').select(); +} catch (error) { + // handle error +} +``` + + + + +## Auth classes / methods + +### Usage of `SupabaseAuthState` and `SupabaseAuthRequiredState` classes + +In v0, `SupabaseAuthState` and `SupabaseAuthRequiredState` were required to handle automatic token refresh and to listen to auth state change. In v1, `SupabaseAuthState` and `SupabaseAuthRequiredState` are deprecated, and token refresh will happen automatically just by initializing Supabase. [`onAuthStateChange`](/docs/reference/dart/upgrade-guide#listening-to-auth-state-change) can be used to action on auth state change. + + + + + +```dart +await Supabase.initialize( + url: 'SUPABASE_URL', + anonKey: 'SUPABASE_ANON_KEY', +); +... + +class AuthState extends SupabaseAuthState { + ... +} + +... + +class AuthRequiredState extends SupabaseAuthState { + ... +} +``` + + + + + +```dart +await Supabase.initialize( + url: 'SUPABASE_URL', + anonKey: 'SUPABASE_ANON_KEY', +); +``` + + + + +### Listening to auth state change + +`onAuthStateChange` now returns a `Stream`. + + + + + +```dart +final authSubscription = supabase.auth.onAuthStateChange((event, session) { + // handle auth state change +}); + +// Unsubscribe when no longer needed +authSubscription.data?.unsubscribe(); +``` + + + + + +```dart +final authSubscription = supabase.auth.onAuthStateChange.listen((data) { + final AuthChangeEvent event = data.event; + final Session? session = data.session; + // handle auth state change + }); + +// Unsubscribe when no longer needed +authSubscription.cancel(); +``` + + + + +### Sign in with email and password + +The signIn() method has been deprecated in favor of more explicit method signatures to help with type hinting. Previously it was difficult for developers to know what they were missing (e.g., a lot of developers didn't realize they could use passwordless magic links). + + + + + +```dart +await supabase.auth.signIn(email: email, password: password); +``` + + + + + +```dart +await supabase.auth.signInWithPassword(email: email, password: password); +``` + + + + +### Sign in with magic link + + + + + +```dart +await supabase.auth.signIn(email: email); +``` + + + + + +```dart +await supabase.auth.signInWithOtp(email: email); +``` + + + + +### Sign in with a third-party OAuth provider + + + + + +```dart +await supabase.auth.signInWithProvider( + Provider.github, + options: AuthOptions( + redirectTo: kIsWeb + ? null + : 'io.supabase.flutter://reset-callback/'), +); +``` + + + + + +```dart +await supabase.auth.signInWithOAuth( + Provider.github, + redirectTo: kIsWeb ? null : 'io.supabase.flutter://reset-callback/', +); +``` + + + + +### Sign in with phone + + + + + +```dart +await supabase.auth.signIn( + phone: '+13334445555', + password: 'example-password', +); +``` + + + + + +```dart +await supabase.auth.signInWithPassword( + phone: '+13334445555', + password: 'example-password', +); +``` + + + + +### Sign in with phone using OTP + + + + + +```dart +final res = await supabase.auth.signIn(phone: phone); +``` + + + + + +```dart +await supabase.auth.signInWithOtp( + phone: phone, +); + +// After receiving a SMS with a OTP. +await supabase.auth.verifyOTP( + type: OtpType.sms, + token: token, + phone: phone, +); +``` + + + + +### Reset password for email + + + + + +```dart +await supabase.auth.api.resetPasswordForEmail( + email, + options: + AuthOptions(redirectTo: 'io.supabase.flutter://reset-callback/'), +); +``` + + + + + +```dart +await supabase.auth.resetPasswordForEmail( + email, + redirectTo: kIsWeb ? null : 'io.supabase.flutter://reset-callback/', +); +``` + + + + +### Get the user's current session + + + + + +```dart + final session = supabase.auth.session(); +``` + + + + + +```dart +final Session? session = supabase.auth.currentSession; +``` + + + + +### Get the logged-in user + + + + + +```dart +final user = supabase.auth.user(); +``` + + + + + +```dart +final User? user = supabase.auth.currentUser; +``` + + + + +### Update user data for a logged-in user + + + + + +```dart +await supabase.auth.update( + UserAttributes(data: {'hello': 'world'}) +); +``` + + + + + +```dart +await supabase.updateUser( + UserAttributes( + data: { 'hello': 'world' }, + ), +); +``` + + + + +## Data methods + +`.insert()` / `.upsert()` / `.update()` / `.delete()` don't return rows by default. + +Previously, these methods return inserted/updated/deleted rows by default (which caused [some confusion](https://github.com/supabase/supabase/discussions/1548)), and you can opt to not return it by specifying `returning: 'minimal'`. Now the default behavior is to not return rows. To return inserted/updated/deleted rows, add a `.select()` call at the end. + +Also, calling `.execute()` at the end of the query was a requirement in v0, but in v1 `.execute` is deperecated. + +### Insert without returning inserted data + + + + + +```dart +await supabase + .from('my_table') + .insert(data, returning: ReturningOption.minimal) + .execute(); + +``` + + + + + +```dart +await supabase.from('my_table').insert(data); +``` + + + + +### Insert with returning inserted data + + + + + +```dart +final res = await supabase + .from('my_table') + .insert(data) + .execute(); +``` + + + + + +```dart +final insertedData = await supabase.from('my_table').insert(data).select(); +``` + + + + +## Realtime methods + +### Stream + +`.stream()` no longer needs the `.execute()` at the end. Also, filtering by `eq` is a lot easier now. `primaryKey` is now a named parameter to make it more obvious what to pass. + + + + + +```dart +supabase.from('my_table:id=eq.120') + .stream(['id']) + .listen(); +``` + + + + + +```dart +supabase.from('my_table') + .stream(primaryKey: ['id']) + .eq('id', '120') + .listen(); +``` + + + + +### Subscribe + + + + + +```dart +final subscription = supabase + .from('countries') + .on(SupabaseEventTypes.all, (payload) { + // Handle realtime payload + }) + .subscribe(); +``` + + + + + +```dart +final channel = supabase.channel('*'); +channel.on( + RealtimeListenTypes.postgresChanges, + ChannelFilter(event: '*', schema: '*'), + (payload, [ref]) { + // Handle realtime payload + }, +).subscribe(); +``` + + + + +### Unsubscribe + + + + + +```dart +supabase.removeSubscription(subscription); +``` + + + + + +```dart +await supabase.removeChannel(channel); +``` + + + diff --git a/apps/temp-docs/docs/reference/javascript/release-notes.md b/apps/temp-docs/docs/reference/javascript/release-notes.mdx similarity index 100% rename from apps/temp-docs/docs/reference/javascript/release-notes.md rename to apps/temp-docs/docs/reference/javascript/release-notes.mdx diff --git a/apps/temp-docs/docs/reference/javascript/typescript-support.md b/apps/temp-docs/docs/reference/javascript/typescript-support.mdx similarity index 100% rename from apps/temp-docs/docs/reference/javascript/typescript-support.md rename to apps/temp-docs/docs/reference/javascript/typescript-support.mdx diff --git a/apps/temp-docs/package.json b/apps/temp-docs/package.json index 27cc92fd1e8..a538b9f53b6 100644 --- a/apps/temp-docs/package.json +++ b/apps/temp-docs/package.json @@ -4,32 +4,25 @@ "private": true, "scripts": { "dev": "next dev --port 3001", - "build": "npm run generate:all && next build", + "build": "next build", "start": "next start", "lint": "next lint", - "generate:all": "npm-run-all --parallel gen:api gen:cli gen:gotrue gen:storage gen:supabase-dart:v0 gen:supabase-dart:v1 gen:supabase-js:v1 gen:supabase-js:v2", - "gen:api": "npm-run-all gen:api:usage", "gen:api:usage": "ts-node ./generator/index.ts gen --type api --url https://api.supabase.com --input ../../spec/transforms/api_v0_openapi_deparsed.json --output ./docs/reference/api/generated/usage.mdx", - "gen:cli": "npm-run-all gen:cli:commands gen:cli:config", "gen:cli:commands": "ts-node ./generator/index.ts gen --type cli --input ../../spec/cli_v1_commands.yaml --output ./docs/reference/cli/generated/usage.mdx ", "gen:cli:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/cli_v1_config.yaml --output ./docs/reference/cli/generated/config.mdx", - "gen:gotrue": "npm-run-all gen:gotrue:config gen:gotrue:usage", "gen:gotrue:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/gotrue_v1_config.yaml --output ./docs/reference/auth/generated/config.mdx", "gen:gotrue:usage": "ts-node ./generator/index.ts gen --type api --input ../../spec/transforms/auth_v1_openapi_deparsed.json --output ./docs/reference/auth/generated/usage.mdx", - "gen:storage": "npm-run-all gen:storage:api gen:storage:config", "gen:storage:api": "ts-node ./generator/index.ts gen --type api --input ../../spec/transforms/storage_v0_openapi_deparsed.json --output ./docs/reference/storage/generated/usage.mdx", "gen:storage:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/storage_v0_config.yaml --output ./docs/reference/storage/generated/config.mdx", - "gen:supabase-dart:v0": "npm-run-all gen:supabase-dart:v0:ref", "gen:supabase-dart:v0:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_dart_v0.yml --output ./docs/reference/dart/v0/generated", "gen:supabase-dart:v1": "npm-run-all gen:supabase-dart:v1:ref", "gen:supabase-dart:v1:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_dart_v1.yml --output ./docs/reference/dart/generated", - "gen:supabase-js:v1": "npm-run-all gen:supabase-js:v1:ref", "gen:supabase-js:v1:ref": "ts-node ./generator/index.ts gen --type legacy --input ../../spec/supabase_js_v1.yml --output ./docs/reference/javascript/v1/generated", "gen:supabase-js:v2": "npm-run-all gen:supabase-js:v2:ref", From ad45baa2ada01c9b45f3fef10c9166d4f56eccf0 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Oct 2022 16:03:28 +0700 Subject: [PATCH 06/10] Update build command --- apps/temp-docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/temp-docs/package.json b/apps/temp-docs/package.json index a538b9f53b6..052948427fe 100644 --- a/apps/temp-docs/package.json +++ b/apps/temp-docs/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "next dev --port 3001", - "build": "next build", + "build": "npm run generate:all && next build", "start": "next start", "lint": "next lint", "generate:all": "npm-run-all --parallel gen:api gen:cli gen:gotrue gen:storage gen:supabase-dart:v0 gen:supabase-dart:v1 gen:supabase-js:v1 gen:supabase-js:v2", From 77a7a5179abe2f4a1998b1228cc0a481e22d517f Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Oct 2022 16:13:40 +0700 Subject: [PATCH 07/10] Add generated folders --- apps/temp-docs/.gitignore | 4 +++- apps/temp-docs/docs/reference/api/generated/.gitkeep | 0 apps/temp-docs/docs/reference/auth/generated/.gitkeep | 0 apps/temp-docs/docs/reference/cli/generated/.gitkeep | 0 apps/temp-docs/docs/reference/dart/generated/.gitkeep | 0 apps/temp-docs/docs/reference/dart/v0/generated/.gitkeep | 0 apps/temp-docs/docs/reference/javascript/generated/.gitkeep | 0 .../temp-docs/docs/reference/javascript/v1/generated/.gitkeep | 0 apps/temp-docs/docs/reference/storage/generated/.gitkeep | 0 9 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 apps/temp-docs/docs/reference/api/generated/.gitkeep create mode 100644 apps/temp-docs/docs/reference/auth/generated/.gitkeep create mode 100644 apps/temp-docs/docs/reference/cli/generated/.gitkeep create mode 100644 apps/temp-docs/docs/reference/dart/generated/.gitkeep create mode 100644 apps/temp-docs/docs/reference/dart/v0/generated/.gitkeep create mode 100644 apps/temp-docs/docs/reference/javascript/generated/.gitkeep create mode 100644 apps/temp-docs/docs/reference/javascript/v1/generated/.gitkeep create mode 100644 apps/temp-docs/docs/reference/storage/generated/.gitkeep diff --git a/apps/temp-docs/.gitignore b/apps/temp-docs/.gitignore index f6ec88eea34..fd62e0e6867 100644 --- a/apps/temp-docs/.gitignore +++ b/apps/temp-docs/.gitignore @@ -18,4 +18,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -**/*/generated/**/* \ No newline at end of file +**/*/generated/**/* +!**/*/generated/.gitkeep +!**/*/generated/**/.gitkeep \ No newline at end of file diff --git a/apps/temp-docs/docs/reference/api/generated/.gitkeep b/apps/temp-docs/docs/reference/api/generated/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/apps/temp-docs/docs/reference/auth/generated/.gitkeep b/apps/temp-docs/docs/reference/auth/generated/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/apps/temp-docs/docs/reference/cli/generated/.gitkeep b/apps/temp-docs/docs/reference/cli/generated/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/apps/temp-docs/docs/reference/dart/generated/.gitkeep b/apps/temp-docs/docs/reference/dart/generated/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/apps/temp-docs/docs/reference/dart/v0/generated/.gitkeep b/apps/temp-docs/docs/reference/dart/v0/generated/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/apps/temp-docs/docs/reference/javascript/generated/.gitkeep b/apps/temp-docs/docs/reference/javascript/generated/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/apps/temp-docs/docs/reference/javascript/v1/generated/.gitkeep b/apps/temp-docs/docs/reference/javascript/v1/generated/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/apps/temp-docs/docs/reference/storage/generated/.gitkeep b/apps/temp-docs/docs/reference/storage/generated/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d From 7cf931f6245c2dd55ef81865cae4a3f076513c51 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Oct 2022 16:32:39 +0700 Subject: [PATCH 08/10] test --- apps/temp-docs/layouts/Default.tsx | 9 ++++++++- apps/temp-docs/pages/[...slug].tsx | 25 ++++++++----------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/apps/temp-docs/layouts/Default.tsx b/apps/temp-docs/layouts/Default.tsx index 12493ef2abc..c6b07acc354 100644 --- a/apps/temp-docs/layouts/Default.tsx +++ b/apps/temp-docs/layouts/Default.tsx @@ -13,7 +13,14 @@ interface Props { versions: string[] } -const Layout: FC = ({ meta, children, toc, menuItems, currentPage, versions }) => { +const Layout: FC = ({ + meta, + children, + toc, + menuItems, + currentPage, + versions = ['v2', 'v1'], +}) => { useEffect(() => { const key = localStorage.getItem('supabaseDarkMode') if (!key) { diff --git a/apps/temp-docs/pages/[...slug].tsx b/apps/temp-docs/pages/[...slug].tsx index 6ee70385677..5a55099aa94 100644 --- a/apps/temp-docs/pages/[...slug].tsx +++ b/apps/temp-docs/pages/[...slug].tsx @@ -18,29 +18,20 @@ interface Meta { hide_table_of_contents: boolean } -export default function Doc({ - meta, - content, - versions, - toc, -}: { +interface Props { meta: Meta content: any - versions: string[] + // versions: string[] toc: any -}) { +} + +export default function Doc({ meta, content, toc }: Props) { const { asPath } = useRouter() const page = getPageType(asPath) return ( // @ts-ignore - + @@ -59,13 +50,13 @@ export async function getStaticProps({ params }: { params: { slug: string[] } }) let doc = getDocsBySlug(slug) const content = await serialize(doc.content || '') - const versions = getLibraryVersions(slug) + // const versions = getLibraryVersions(slug) return { props: { ...doc, content, - versions, + // versions, toc: toc(doc.content, { maxdepth: 2 }), }, } From 2eecdaab24a8c9c68e66e311a5299f156243ba91 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Oct 2022 16:50:58 +0700 Subject: [PATCH 09/10] Change the way we read available versions --- .../components/Navigation/NavBar.tsx | 8 ++++-- .../Navigation/Navigation.constants.ts | 4 +++ .../components/Navigation/Navigation.types.ts | 1 + apps/temp-docs/data/nav/README.md | 8 ++++-- apps/temp-docs/layouts/Default.tsx | 12 ++------ apps/temp-docs/lib/docs.ts | 28 ++++++++++--------- apps/temp-docs/pages/[...slug].tsx | 5 +--- apps/temp-docs/pages/index.tsx | 3 +- 8 files changed, 35 insertions(+), 34 deletions(-) diff --git a/apps/temp-docs/components/Navigation/NavBar.tsx b/apps/temp-docs/components/Navigation/NavBar.tsx index 4d35ee4d5e4..6b5acba1d00 100644 --- a/apps/temp-docs/components/Navigation/NavBar.tsx +++ b/apps/temp-docs/components/Navigation/NavBar.tsx @@ -4,19 +4,23 @@ import { useRouter } from 'next/router' import { useState, useEffect, FC } from 'react' import { IconMenu, IconSearch, Input, IconCommand, Button, IconMoon, IconSun, Listbox } from 'ui' import { useTheme } from '../Providers' +import { REFERENCES } from './Navigation.constants' interface Props { currentPage: string - versions: string[] } -const NavBar: FC = ({ currentPage, versions }) => { +const NavBar: FC = ({ currentPage }) => { const { isDarkMode, toggleTheme } = useTheme() const [mounted, setMounted] = useState(false) const { asPath, push } = useRouter() const pathSegments = asPath.split('/') + const library = pathSegments.length >= 3 ? pathSegments[2] : undefined + const libraryMeta = REFERENCES?.[library] ?? undefined + const versions = libraryMeta?.versions ?? [] + const version = versions.includes(pathSegments[pathSegments.indexOf(library) + 1]) ? pathSegments[pathSegments.indexOf(library) + 1] : versions[0] diff --git a/apps/temp-docs/components/Navigation/Navigation.constants.ts b/apps/temp-docs/components/Navigation/Navigation.constants.ts index be47bb3933c..6815a1bbb6c 100644 --- a/apps/temp-docs/components/Navigation/Navigation.constants.ts +++ b/apps/temp-docs/components/Navigation/Navigation.constants.ts @@ -13,21 +13,25 @@ export const REFERENCES: References = { javascript: { name: 'supabase-js', library: 'supabase-js', + versions: ['v2', 'v1'], icon: '/docs/img/libraries/javascript-icon.svg', }, dart: { name: 'Flutter', library: 'supabase-dart', + versions: ['v1', 'v0'], icon: '/docs/img/libraries/dart-icon.svg', }, cli: { name: 'CLI', library: undefined, + versions: [], icon: '/docs/img/libraries/cli-icon.svg', }, api: { name: 'API', library: undefined, + versions: [], icon: '/docs/img/libraries/api-icon.svg', }, } diff --git a/apps/temp-docs/components/Navigation/Navigation.types.ts b/apps/temp-docs/components/Navigation/Navigation.types.ts index 91617d172ff..3422099a2ae 100644 --- a/apps/temp-docs/components/Navigation/Navigation.types.ts +++ b/apps/temp-docs/components/Navigation/Navigation.types.ts @@ -17,6 +17,7 @@ export interface References { [key: string]: { name: string library?: string + versions: string[] icon: string } } diff --git a/apps/temp-docs/data/nav/README.md b/apps/temp-docs/data/nav/README.md index 521203dfe5d..452165a6740 100644 --- a/apps/temp-docs/data/nav/README.md +++ b/apps/temp-docs/data/nav/README.md @@ -1,11 +1,13 @@ # [WIP] Adding navigation for a new section +[Note] This isn't the best way for versioning in my opinion, but this is the current way to do it while we're migrating to Next.js + This folder holds the structure for the side navigation menu in the reference documentation pages. Each reference section (as well as their individual versions where applicable) have its own set of navigation. The following are relevant to adding navigation for a new section: - `getPageType()` from `lib/helpers` -- `menuItems` from `components/Navigation/Navigation.constants` +- `menuItems` and `REFERENCES` from `components/Navigation/Navigation.constants` - `NavMenu` from `components/Navigation/Navigation.types` ## Adding navigation for a section that doesn't require versioning @@ -18,9 +20,9 @@ Finally, add the menu to `menuItems` under a new key - the key should be what yo ## Adding navigation for a section that requires versioning -This is more applicable for client libraries (e.g supabase-js and supabase-dart). Versions will all sit within their own folder - if the folder doesn't exist yet, just create one. +This is more applicable for client libraries (e.g supabase-js and supabase-dart). Versions will all sit within their own folder - if the folder doesn't exist yet, just create one. The navigation for each section will then be named as 'v1', 'v2', and so on. -The navigation for each section will then be named as 'v1', 'v2', and so on. The version selector in `NavBar` will pick up what available versions there are from here. +Then, update `REFERENCES` accordingly. Thereafter, update `getPageType` to be able to get the page type based on the URL path - preferably follow the syntax of `reference/{section_name}/{version}`. Typically the latest version available will not have the `/{version}` in it. diff --git a/apps/temp-docs/layouts/Default.tsx b/apps/temp-docs/layouts/Default.tsx index c6b07acc354..c4220745f8b 100644 --- a/apps/temp-docs/layouts/Default.tsx +++ b/apps/temp-docs/layouts/Default.tsx @@ -10,17 +10,9 @@ interface Props { toc?: any menuItems: any currentPage: string - versions: string[] } -const Layout: FC = ({ - meta, - children, - toc, - menuItems, - currentPage, - versions = ['v2', 'v1'], -}) => { +const Layout: FC = ({ meta, children, toc, menuItems, currentPage }) => { useEffect(() => { const key = localStorage.getItem('supabaseDarkMode') if (!key) { @@ -53,7 +45,7 @@ const Layout: FC = ({
- +
diff --git a/apps/temp-docs/lib/docs.ts b/apps/temp-docs/lib/docs.ts index 7942f7ac243..7612b4b00c4 100644 --- a/apps/temp-docs/lib/docs.ts +++ b/apps/temp-docs/lib/docs.ts @@ -63,19 +63,6 @@ export function getAllDocs() { return docs } -export function getLibraryVersions(slug: string) { - const paths = slug.split('/') - if (paths.includes('reference') && paths.length >= 3) { - const reference = REFERENCES[paths[2]] - if (reference?.library !== undefined) { - const path = `data/nav/${reference.library}` - const list = fs.readdirSync(path).map((file) => file.split('.')[0]) - return list.reverse() - } - } - return [] -} - function walk(dir: string) { let results: string[] = [] const list = fs.readdirSync(dir) @@ -92,3 +79,18 @@ function walk(dir: string) { }) return results } + +// [Joshen] Initially tried to simplify the NavBar versioning by reading the directory +// but caused some issues on Vercel. Just gonna park this for now. +export function getLibraryVersions(slug: string) { + const paths = slug.split('/') + if (paths.includes('reference') && paths.length >= 3) { + const reference = REFERENCES[paths[2]] + if (reference?.library !== undefined) { + const path = `data/nav/${reference.library}` + const list = fs.readdirSync(path).map((file) => file.split('.')[0]) + return list.reverse() + } + } + return [] +} diff --git a/apps/temp-docs/pages/[...slug].tsx b/apps/temp-docs/pages/[...slug].tsx index 5a55099aa94..3a1c8a90c0c 100644 --- a/apps/temp-docs/pages/[...slug].tsx +++ b/apps/temp-docs/pages/[...slug].tsx @@ -5,7 +5,7 @@ import { serialize } from 'next-mdx-remote/serialize' import components from '../components/index' import { menuItems } from '../components/Navigation/Navigation.constants' import { getPageType } from '../lib/helpers' -import { getAllDocs, getDocsBySlug, getLibraryVersions } from '../lib/docs' +import { getAllDocs, getDocsBySlug } from '../lib/docs' import Layout from '~/layouts/Default' // table of contents extractor @@ -21,7 +21,6 @@ interface Meta { interface Props { meta: Meta content: any - // versions: string[] toc: any } @@ -50,13 +49,11 @@ export async function getStaticProps({ params }: { params: { slug: string[] } }) let doc = getDocsBySlug(slug) const content = await serialize(doc.content || '') - // const versions = getLibraryVersions(slug) return { props: { ...doc, content, - // versions, toc: toc(doc.content, { maxdepth: 2 }), }, } diff --git a/apps/temp-docs/pages/index.tsx b/apps/temp-docs/pages/index.tsx index d11b16a831b..7be96f8bb61 100644 --- a/apps/temp-docs/pages/index.tsx +++ b/apps/temp-docs/pages/index.tsx @@ -13,9 +13,8 @@ export default function Home({ meta: { title: string; description: string } content: any }) { - console.log({ menuItems }, 'index') return ( - + From 49d1fa8f1b989f7bfad34d0afad75150179ffccd Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Oct 2022 16:53:37 +0700 Subject: [PATCH 10/10] fix --- apps/temp-docs/layouts/Guide.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/temp-docs/layouts/Guide.tsx b/apps/temp-docs/layouts/Guide.tsx index 00b36a428ee..3a2538ddcf0 100644 --- a/apps/temp-docs/layouts/Guide.tsx +++ b/apps/temp-docs/layouts/Guide.tsx @@ -22,7 +22,6 @@ export default function ContentsLayout({ context }: any) { menuItems[page] } currentPage={page} - versions={[]} >
{context.children}