mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 02:15:05 +03:00
36 files changed
+1550
-142
No files matched your search
+5
-5
@@ -71,11 +71,11 @@ To contribute code to [Supabase](https://supabase.com), you must fork the [Supab
|
||||
|
||||
Then visit, and edit, any of the following sites:
|
||||
|
||||
| Site | Directory | Scope name | Description | Local development server |
|
||||
| -------------------------------------------- | -------------- | ---------- | ------------------------------------ | ------------------------ |
|
||||
| [supabase.com](https://supabase.com) | `/apps/www` | www | The main website | http://localhost:3000 |
|
||||
| [app.supabase.com](https://app.supabase.com) | `/studio` | studio | Studio dashboard | http://localhost:8082 |
|
||||
| [supabase.com/docs] Next.js based Docs site | `/apps/docs` . | docs | Guides and Reference (Next.js based) | http://localhost:3001 |
|
||||
| Site | Directory | Scope name | Description | Local development server |
|
||||
| ---------------------------------------------- | -------------- | ---------- | ------------------------------------ | ------------------------ |
|
||||
| [supabase.com](https://supabase.com) | `/apps/www` | www | The main website | http://localhost:3000 |
|
||||
| [app.supabase.com](https://app.supabase.com) | `/studio` | studio | Studio dashboard | http://localhost:8082 |
|
||||
| [supabase.com/docs](https://supabase.com/docs) | `/apps/docs` | docs | Guides and Reference (Next.js based) | http://localhost:3001 |
|
||||
|
||||
#### Running sites individually
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ export const getAnchor = (text: any): string | undefined => {
|
||||
if (typeof text === 'object') {
|
||||
if (Array.isArray(text)) {
|
||||
const customAnchor = text.find(
|
||||
(x) => typeof x === 'string' && x.includes('{#') && x.endsWith('}')
|
||||
(x) => typeof x === 'string' && x.includes('[#') && x.endsWith(']')
|
||||
)
|
||||
if (customAnchor !== undefined) return customAnchor.slice(3, customAnchor.indexOf('}'))
|
||||
if (customAnchor !== undefined) return customAnchor.slice(2, customAnchor.indexOf(']'))
|
||||
|
||||
const formattedText = text
|
||||
.map((x) => {
|
||||
@@ -33,8 +33,8 @@ export const getAnchor = (text: any): string | undefined => {
|
||||
return anchor
|
||||
}
|
||||
} else if (typeof text === 'string') {
|
||||
if (text.includes('{#') && text.endsWith('}')) {
|
||||
return text.slice(text.indexOf('{#') + 2, text.indexOf('}'))
|
||||
if (text.includes('[#') && text.endsWith(']')) {
|
||||
return text.slice(text.indexOf('[#') + 2, text.indexOf(']'))
|
||||
} else {
|
||||
return text
|
||||
.toLowerCase()
|
||||
@@ -48,9 +48,9 @@ export const getAnchor = (text: any): string | undefined => {
|
||||
|
||||
export const removeAnchor = (text: any) => {
|
||||
if (typeof text === 'object' && Array.isArray(text)) {
|
||||
return text.filter((x) => !(typeof x === 'string' && x.includes('{#') && x.endsWith('}')))
|
||||
return text.filter((x) => !(typeof x === 'string' && x.includes('[#') && x.endsWith(']')))
|
||||
} else if (typeof text === 'string') {
|
||||
if (text.indexOf('{#') > 0) return text.slice(0, text.indexOf('{#'))
|
||||
if (text.indexOf('[#') > 0) return text.slice(0, text.indexOf('[#'))
|
||||
else return text
|
||||
}
|
||||
return text
|
||||
|
||||
@@ -8,7 +8,6 @@ import { useInView } from 'react-intersection-observer'
|
||||
|
||||
const Heading = ({ tag, children }) => {
|
||||
const HeadingTag = `${tag}` as any
|
||||
|
||||
const anchor = getAnchor(children)
|
||||
const link = `#${anchor}`
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ id: release-notes
|
||||
title: Release Notes
|
||||
---
|
||||
|
||||
## v1.0.0 {#1.0.0}
|
||||
## v1.0.0 [#1.0.0]
|
||||
|
||||
Adds the following routes:
|
||||
|
||||
|
||||
@@ -8,30 +8,42 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabItem from '@theme/TabItem'
|
||||
|
||||
All JavaScript libraries are built directly by the Supabase team. this is in reference/js/installing
|
||||
|
||||
Other languages are built by the community and supported by Supabase.
|
||||
|
||||
## JavaScript
|
||||
|
||||
Via NPM
|
||||
<Tabs
|
||||
scrollable
|
||||
size="small"
|
||||
type="underlined"
|
||||
defaultActiveId="npm"
|
||||
>
|
||||
<TabPanel id="npm" label="npm">
|
||||
|
||||
```bash
|
||||
```sh
|
||||
npm install @supabase/supabase-js
|
||||
```
|
||||
|
||||
Via Yarn
|
||||
</TabPanel>
|
||||
<TabPanel id="yarn" label="Yarn">
|
||||
|
||||
```bash
|
||||
```sh
|
||||
yarn add @supabase/supabase-js
|
||||
```
|
||||
|
||||
Find the source code on [GitHub](https://github.com/supabase/supabase-js).
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
Or via CDN
|
||||
### CDN
|
||||
|
||||
```js
|
||||
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
|
||||
//or
|
||||
<script src="https://unpkg.com/@supabase/supabase-js@2"></script>
|
||||
```
|
||||
|
||||
## Deno
|
||||
|
||||
You can use supabase-js in the Deno runtime via esm.sh:
|
||||
|
||||
```ts
|
||||
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
|
||||
```
|
||||
@@ -16,7 +16,7 @@ toc_max_heading_level: 3
|
||||
|
||||
<% sections.forEach(function(section){ %>
|
||||
|
||||
## <%- section.title %> {#<%= section.id %>}
|
||||
## <%- section.title %> [#<%= section.id %>]
|
||||
|
||||
<%- section.description %>
|
||||
|
||||
@@ -24,7 +24,7 @@ toc_max_heading_level: 3
|
||||
|
||||
<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY IF THIS IS VERSION "next" -->
|
||||
|
||||
### <%- operation.summary %> {#<%- operation.operationId %>}
|
||||
### <%- operation.summary %> [#<%- operation.operationId %>]
|
||||
|
||||
\`\`\`
|
||||
<%- operation.operation.toUpperCase() %> <%- operation.fullPath %>
|
||||
|
||||
@@ -14,11 +14,11 @@ toc_max_heading_level: 3
|
||||
|
||||
<!-- AUTOGENERATED: DO NOT EDIT DIRECTLY -->
|
||||
|
||||
## <%= section.title %> {#<%= section.id %>}
|
||||
## <%= section.title %> [#<%= section.id %>]
|
||||
|
||||
<% section.parameters.forEach(function(parameter){ %>
|
||||
|
||||
### \`<%- parameter.title %>\` {#<%= parameter.id %>}
|
||||
### \`<%- parameter.title %>\` [#<%= parameter.id %>]
|
||||
|
||||
<%- parameter.description %>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ The APIs are:
|
||||
- **Fast.** <br />Our benchmarks for basic reads are more than 300% faster than Firebase. The API is a very thin layer on top of Postgres, which does most of the heavy lifting.
|
||||
- **Scalable.** <br />The API can serve thousands of simultaneous requests, and works well for Serverless workloads.
|
||||
|
||||
## REST API {#rest-api-overview}
|
||||
## REST API [#rest-api-overview]
|
||||
|
||||
Supabase provides a RESTful API using [PostgREST](https://postgrest.org/). This is a very thin API layer on top of Postgres.
|
||||
It provides everything you need from a CRUD API:
|
||||
@@ -41,7 +41,7 @@ It provides everything you need from a CRUD API:
|
||||
></iframe>
|
||||
</div>
|
||||
|
||||
## GraphQL API {#graphql-api-overview}
|
||||
## GraphQL API [#graphql-api-overview]
|
||||
|
||||
<Admonition type='note'>
|
||||
|
||||
@@ -51,7 +51,7 @@ GraphQL is in Beta, and may have breaking changes. It is only available on self-
|
||||
|
||||
GraphQL in Supabase works through [pg_graphql](https://supabase.com/blog/pg-graphql), an open source PostgreSQL extension for GraphQL.
|
||||
|
||||
## Realtime API {#realtime-api-overview}
|
||||
## Realtime API [#realtime-api-overview]
|
||||
|
||||
Supabase provides a Realtime API using [Realtime](https://github.com/supabase/realtime). You can use this to listen to database changes over websockets.
|
||||
Realtime leverages PostgreSQL's built-in logical replication. You can manage your Realtime API simply by managing Postgres publications.
|
||||
@@ -130,7 +130,7 @@ You are provided with two keys:
|
||||
|
||||
### Accessing the docs in the Dashboard
|
||||
|
||||
#### REST API {#rest-api-dashboard-docs}
|
||||
#### REST API [#rest-api-dashboard-docs]
|
||||
|
||||
Supabase generates documentation in the [Dashboard](https://app.supabase.com) which updates as you make database changes.
|
||||
Let's view the documentation for a `countries` table which we created in our database.
|
||||
|
||||
@@ -147,7 +147,7 @@ const App = () => (
|
||||
|
||||
If you created your own theme, you may not need to override any of the them.
|
||||
|
||||
### Create your own theme {#create-theme}
|
||||
### Create your own theme [#create-theme]
|
||||
|
||||
You can create your own theme by following the same structure within a `appearance.theme` property.
|
||||
See the list of [tokens within a theme](https://github.com/supabase-community/auth-ui/blob/main/packages/react/common/theming/Themes.tsx).
|
||||
@@ -199,7 +199,7 @@ const App = () => (
|
||||
|
||||
You can swich between different variations of your theme with the ["theme" prop](#switch-theme-variations).
|
||||
|
||||
### Custom CSS classes {#custom-css-classes}
|
||||
### Custom CSS classes [#custom-css-classes]
|
||||
|
||||
You can use custom CSS classes for the following elements:
|
||||
`"button"`, `"container"`, `"anchor"`, `"divider"`, `"label"`, `"input"`, `"loader"`, `"message"`.
|
||||
@@ -224,7 +224,7 @@ const App = () => (
|
||||
)
|
||||
```
|
||||
|
||||
### Custom inline CSS {#custom-inline-styles}
|
||||
### Custom inline CSS [#custom-inline-styles]
|
||||
|
||||
You can use custom CSS inline styles for the following elements:
|
||||
`"button"`, `"container"`, `"anchor"`, `"divider"`, `"label"`, `"input"`, `"loader"`, `"message"`.
|
||||
@@ -249,7 +249,7 @@ const App = () => (
|
||||
)
|
||||
```
|
||||
|
||||
### Custom labels {#custom-labels}
|
||||
### Custom labels [#custom-labels]
|
||||
|
||||
You can use custom labels with `localization.variables`. See the [list of labels](https://github.com/supabase-community/auth-ui/blob/main/packages/react/common/lib/Localization/en.json) that can be overwritten.
|
||||
|
||||
|
||||
@@ -371,9 +371,9 @@ export const handle: Handle = async ({ event, resolve }) => {
|
||||
}
|
||||
```
|
||||
|
||||
## Migrate from 0.7.x to 0.8 {#migration}
|
||||
## Migrate from 0.7.x to 0.8 [#migration]
|
||||
|
||||
### Set up the Supabase client {#migration-set-up-supabase-client}
|
||||
### Set up the Supabase client [#migration-set-up-supabase-client]
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
@@ -421,7 +421,7 @@ export const supabaseClient = createClient(env.PUBLIC_SUPABASE_URL, env.PUBLIC_S
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
### Initialize the client {#migration-initialize-client}
|
||||
### Initialize the client [#migration-initialize-client]
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
@@ -477,7 +477,7 @@ export const supabaseClient = createClient(env.PUBLIC_SUPABASE_URL, env.PUBLIC_S
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
### Set up hooks {#migration-set-up-hooks}
|
||||
### Set up hooks [#migration-set-up-hooks]
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
@@ -524,7 +524,7 @@ import '$lib/db'
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
### Typings {#migration-typings}
|
||||
### Typings [#migration-typings]
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
@@ -581,7 +581,7 @@ declare namespace App {
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
### withPageAuth {#migration-with-page-auth}
|
||||
### withPageAuth [#migration-with-page-auth]
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
@@ -659,7 +659,7 @@ export const load: PageLoad = async (event) => {
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
### withApiAuth {#migration-with-api-auth}
|
||||
### withApiAuth [#migration-with-api-auth]
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
@@ -712,7 +712,7 @@ export const GET: RequestHandler = async (event) => {
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
## Migrate from 0.6.11 and below to 0.7.0 {#migration-0-7}
|
||||
## Migrate from 0.6.11 and below to 0.7.0 [#migration-0-7]
|
||||
|
||||
There are numerous breaking changes in the latest 0.7.0 version of this library.
|
||||
|
||||
@@ -720,7 +720,7 @@ There are numerous breaking changes in the latest 0.7.0 version of this library.
|
||||
|
||||
The environment variable prefix is now `PUBLIC_` instead of `VITE_` (e.g., `VITE_SUPABASE_URL` is now `PUBLIC_SUPABASE_URL`).
|
||||
|
||||
### Set up the Supabase client {#migration-set-up-supabase-client-0-7}
|
||||
### Set up the Supabase client [#migration-set-up-supabase-client-0-7]
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
@@ -769,7 +769,7 @@ setupSupabaseHelpers({
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
### Initialize the client {#migration-initialize-client-0-7}
|
||||
### Initialize the client [#migration-initialize-client-0-7]
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
@@ -817,7 +817,7 @@ The `@supabase/auth-helpers-svelte` library is no longer required as the `@supab
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
### Set up hooks {#migration-set-up-hooks-0-7}
|
||||
### Set up hooks [#migration-set-up-hooks-0-7]
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
@@ -871,7 +871,7 @@ export const handle = sequence(auth(), yourHandler)
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
### Typings {#migration-typings-0-7}
|
||||
### Typings [#migration-typings-0-7]
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
|
||||
@@ -53,7 +53,7 @@ Procedural languages are automatically installed within `pg_catalog`, so you don
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
## `http_get` {#http_get}
|
||||
## `http_get` [#http_get]
|
||||
|
||||
Creates an HTTP GET request returning the request's ID. HTTP requests are not started until the transaction is committed.
|
||||
|
||||
@@ -98,7 +98,7 @@ request_id
|
||||
|
||||
After triggering `http_get`, use [`http_get_result`](#http_get_result) to get the result of the request.
|
||||
|
||||
## `http_post` {#http_post}
|
||||
## `http_post` [#http_post]
|
||||
|
||||
Creates an HTTP POST request with a JSON body, returning the request's ID. HTTP requests are not started until the transaction is committed.
|
||||
|
||||
@@ -150,7 +150,7 @@ request_id
|
||||
|
||||
After triggering `http_post`, use [`http_get_result`](#http_get_result) to get the result of the request.
|
||||
|
||||
## `http_collect_response` {#http_collect_response}
|
||||
## `http_collect_response` [#http_collect_response]
|
||||
|
||||
Given a `request_id` reference, retrieves the response.
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ values
|
||||
|
||||
The functions we'll cover in this guide are:
|
||||
|
||||
### `to_tsvector()` {#to-tsvector}
|
||||
### `to_tsvector()` [#to-tsvector]
|
||||
|
||||
Converts your data into searchable "tokens". `to_tsvector()` stands for "to text search vector". For example:
|
||||
|
||||
@@ -67,14 +67,14 @@ select to_tsvector('green eggs and ham')
|
||||
|
||||
Collectively these tokens are called a "document" which Postgres can use for comparisons.
|
||||
|
||||
### `to_tsquery()` {#to-tsquery}
|
||||
### `to_tsquery()` [#to-tsquery]
|
||||
|
||||
Converts a query string into "tokens" to match. `to_tsquery()` stands for "to text search query".
|
||||
|
||||
This conversion step is important because we will want to "fuzzy match" on keywords.
|
||||
For example if a user searches for "eggs", and a column has the value "egg", we probably still want to return a match.
|
||||
|
||||
### Match: `@@` {#match}
|
||||
### Match: `@@` [#match]
|
||||
|
||||
The `@@` symbol is the "match" symbol for Full Text Search. It returns any matches between a `to_tsvector` result and a `to_tsquery` result.
|
||||
|
||||
@@ -449,7 +449,7 @@ final result = await client
|
||||
Visit [PostgreSQL: Text Search Functions and Operators](https://www.postgresql.org/docs/current/functions-textsearch.html)
|
||||
to learn about additional query operators you can use to do more advanced `full text queries`, such as:
|
||||
|
||||
### Proximity: `<->` {#proximity}
|
||||
### Proximity: `<->` [#proximity]
|
||||
|
||||
The proximity symbol is useful for searching for terms that are a certain "distance" apart.
|
||||
For example, to find the phrase `big dreams`, where the a match for "big" is followed immediately by a match for "dreams":
|
||||
@@ -538,7 +538,7 @@ final result = await client
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
### Negation: `!` {#negation}
|
||||
### Negation: `!` [#negation]
|
||||
|
||||
The negation symbol can be used to find phrases which _don't_ contain a search term.
|
||||
For example, to find records that have the word `big` but not `little`:
|
||||
|
||||
@@ -12,7 +12,7 @@ Supabase provides several [tools](https://github.com/supabase-community/firebase
|
||||
- `firestoreusers2json` ([TypeScript](https://github.com/supabase-community/firebase-to-supabase/blob/main/auth/firestoreusers2json.ts), [JavaScript](https://github.com/supabase-community/firebase-to-supabase/blob/main/auth/firestoreusers2json.js)) exports users from an existing Firebase project to a `.json` file on your local system.
|
||||
- `import_users` ([TypeScript](https://github.com/supabase-community/firebase-to-supabase/blob/main/auth/import_users.ts), [JavaScript](https://github.com/supabase-community/firebase-to-supabase/blob/main/auth/import_users.js)) imports users from a saved `.json` file into your Supabase project (inserting those users into the `auth.users` table of your `PostgreSQL` database instance).
|
||||
|
||||
## Set up the migration tool {#set-up-migration-tool}
|
||||
## Set up the migration tool [#set-up-migration-tool]
|
||||
|
||||
1. Clone the [firebase-to-supabase](https://github.com/supabase-community/firebase-to-supabase) repository:
|
||||
|
||||
@@ -36,7 +36,7 @@ git clone https://github.com/supabase-community/firebase-to-supabase.git
|
||||
1. Under **Connection Info**, copy the Host string and replace the entry in your `supabase-service.json` file.
|
||||
1. Enter the password you used when you created your Supabase project in the `password` entry in the `supabase-service.json` file.
|
||||
|
||||
## Generate a Firebase private key {#generate-firebase-private-key}
|
||||
## Generate a Firebase private key [#generate-firebase-private-key]
|
||||
|
||||
1. Log in to your [Firebase Console](https://console.firebase.google.com/project) and open your project.
|
||||
1. Click the gear icon next to **Project Overview** in the sidebar and select **Project Settings**.
|
||||
@@ -44,7 +44,7 @@ git clone https://github.com/supabase-community/firebase-to-supabase.git
|
||||
1. Click **Generate new private key**.
|
||||
1. Rename the downloaded file to `firebase-service.json`.
|
||||
|
||||
## Save your Firebase password hash parameters {#save-firebase-hash-parameters}
|
||||
## Save your Firebase password hash parameters [#save-firebase-hash-parameters]
|
||||
|
||||
1. Log in to your [Firebase Console](https://console.firebase.google.com/project) and open your project.
|
||||
1. Select **Authentication** (Build section) in the sidebar.
|
||||
@@ -64,14 +64,14 @@ hash_config {
|
||||
|
||||
## Command line options
|
||||
|
||||
### Dump Firestore users to a JSON file {#dump-firestore-users}
|
||||
### Dump Firestore users to a JSON file [#dump-firestore-users]
|
||||
|
||||
`node firestoreusers2json.js [<filename.json>] [<batch_size>]`
|
||||
|
||||
- `filename.json`: (optional) output filename (defaults to `./users.json`)
|
||||
- `batchSize`: (optional) number of users to fetch in each batch (defaults to 100)
|
||||
|
||||
### Import JSON users file to Supabase Auth (PostgreSQL: auth.users) {#import-json-users-file}
|
||||
### Import JSON users file to Supabase Auth (PostgreSQL: auth.users) [#import-json-users-file]
|
||||
|
||||
`node import_users.js <path_to_json_file> [<batch_size>]`
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Supabase provides several [tools](https://github.com/supabase-community/firebase
|
||||
1. Files are downloaded from a Firebase storage bucket to a local filesystem.
|
||||
2. Files are uploaded from the local filesystem to a Supabase storage bucket.
|
||||
|
||||
## Set up the migration tool {#set-up-migration-tool}
|
||||
## Set up the migration tool [#set-up-migration-tool]
|
||||
|
||||
1. Clone the [firebase-to-supabase](https://github.com/supabase-community/firebase-to-supabase) repository:
|
||||
|
||||
@@ -25,7 +25,7 @@ git clone https://github.com/supabase-community/firebase-to-supabase.git
|
||||
1. Copy the **Project URL** and update the `SUPABASE_URL` value in `supabase-keys.js`.
|
||||
1. Under **Project API keys**, copy the **service_role** key and update the `SUPABASE_KEY` value in `supabase-keys.js`.
|
||||
|
||||
## Generate a Firebase private key {#generate-firebase-private-key}
|
||||
## Generate a Firebase private key [#generate-firebase-private-key]
|
||||
|
||||
1. Log in to your [Firebase Console](https://console.firebase.google.com/project) and open your project.
|
||||
1. Click the gear icon next to **Project Overview** in the sidebar and select **Project Settings**.
|
||||
@@ -35,7 +35,7 @@ git clone https://github.com/supabase-community/firebase-to-supabase.git
|
||||
|
||||
## Command line options
|
||||
|
||||
### Download Firestore Storage bucket to a local filesystem folder {#download-firestore-storage-bucket}
|
||||
### Download Firestore Storage bucket to a local filesystem folder [#download-firestore-storage-bucket]
|
||||
|
||||
`node download.js <prefix> [<folder>] [<batchSize>] [<limit>] [<token>]`
|
||||
|
||||
@@ -47,7 +47,7 @@ git clone https://github.com/supabase-community/firebase-to-supabase.git
|
||||
|
||||
To process in batches using multiple command-line executions, you must use the same parameters with a new `<token>` on subsequent calls. Use the token displayed on the last call to continue the process at a given point.
|
||||
|
||||
### Upload files to Supabase Storage bucket {#upload-to-supabase-storage-bucket}
|
||||
### Upload files to Supabase Storage bucket [#upload-to-supabase-storage-bucket]
|
||||
|
||||
`node upload.js <prefix> <folder> <bucket>`
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ Supabase provides several [tools](https://github.com/supabase-community/firebase
|
||||
|
||||
The Firestore `collection` is "flattened" and converted to a table with basic columns of one of the following types: `text`, `numeric`, `boolean`, or `jsonb`. If your structure is more complex, you can write a program to split the newly-created `json` file into multiple, related tables before you import your `json` file(s) to Supabase.
|
||||
|
||||
## Set up the migration tool {#set-up-migration-tool}
|
||||
## Set up the migration tool [#set-up-migration-tool]
|
||||
|
||||
1. Clone the [firebase-to-supabase](https://github.com/supabase-community/firebase-to-supabase) repository:
|
||||
|
||||
@@ -35,7 +35,7 @@ git clone https://github.com/supabase-community/firebase-to-supabase.git
|
||||
1. Under **Connection Info**, copy the Host string and replace the entry in your `supabase-service.json` file.
|
||||
1. Enter the password you used when you created your Supabase project in the `password` entry in the `supabase-service.json` file.
|
||||
|
||||
## Generate a Firebase private key {#generate-firebase-private-key}
|
||||
## Generate a Firebase private key [#generate-firebase-private-key]
|
||||
|
||||
1. Log in to your [Firebase Console](https://console.firebase.google.com/project) and open your project.
|
||||
1. Click the gear icon next to **Project Overview** in the sidebar and select **Project Settings**.
|
||||
@@ -79,7 +79,7 @@ And split it into two files (one table for users and one table for items):
|
||||
]
|
||||
```
|
||||
|
||||
### Import JSON file to Supabase (PostgreSQL) {#import-to-supabase}
|
||||
### Import JSON file to Supabase (PostgreSQL) [#import-to-supabase]
|
||||
|
||||
`node json2supabase.js <path_to_json_file> [<primary_key_strategy>] [<primary_key_name>]`
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Alternatively, use the [Heroku to Supabase migration tool](https://migrate.supab
|
||||
></iframe>
|
||||
</div>
|
||||
|
||||
## Retrieve your Heroku database credentials {#retrieve-heroku-credentials}
|
||||
## Retrieve your Heroku database credentials [#retrieve-heroku-credentials]
|
||||
|
||||
1. Log in to your [Heroku account](https://heroku.com) and select the project you want to migrate.
|
||||
1. Click **Resources** in the menu and select your **Heroku Postgres** database.
|
||||
@@ -33,13 +33,13 @@ Alternatively, use the [Heroku to Supabase migration tool](https://migrate.supab
|
||||
- User (`$HEROKU_USER`)
|
||||
- Password (`$HEROKU_PASSWORD`)
|
||||
|
||||
## Retrieve your Supabase Host {#retrieve-supabase-host}
|
||||
## Retrieve your Supabase Host [#retrieve-supabase-host]
|
||||
|
||||
1. If you're new to Supabase, [create a project](https://app.supabase.com).
|
||||
1. Go to the [Database settings](https://app.supabase.com/project/_/settings/database) for your project in the Supabase Dashboard.
|
||||
1. Under **Connection Info**, note your Host (`$SUPABASE_HOST`).
|
||||
|
||||
## Export your Heroku database to a file {#export-heroku-database}
|
||||
## Export your Heroku database to a file [#export-heroku-database]
|
||||
|
||||
Use `pg_dump` with your Heroku credentials to export your Heroku database to a file (e.g., `heroku_dump.sql`).
|
||||
|
||||
@@ -49,7 +49,7 @@ pg_dump --clean --if-exists --quote-all-identifiers \
|
||||
--no-owner --no-privileges > heroku_dump.sql
|
||||
```
|
||||
|
||||
## Import the database to your Supabase project {#import-database-to-supabase}
|
||||
## Import the database to your Supabase project [#import-database-to-supabase]
|
||||
|
||||
Use `psql` to import the Heroku database file to your Supabase project.
|
||||
|
||||
|
||||
@@ -3,23 +3,23 @@ import Layout from '~/layouts/DefaultGuideLayout'
|
||||
export const meta = {
|
||||
id: 'compute-add-ons',
|
||||
title: 'Compute Add-ons',
|
||||
description: 'Learn about your project\'s instance and additional add-ons.',
|
||||
description: "Learn about your project's instance and additional add-ons.",
|
||||
}
|
||||
|
||||
Every project on the Supabase Platform comes with its own dedicated Postgres instance running inside a virtual machine (VM). The following table describes the base instance with additional compute add-ons available if you need extra performance when scaling up Supabase.
|
||||
|
||||
Plan | Pricing | CPU | Memory | Disk IO Bandwidth | Connections: Direct | Connections: Pooler
|
||||
-----|---------|-----|--------|-------------------|---------------------|--------------------
|
||||
Free (Included) | $0 | 2-core ARM (shared) | 1 GB | Up to 2,085 Mbps | 10 (recommended) | 50 (recommended)
|
||||
Small | $5 | 2-core ARM (shared) | 2 GB | Up to 2,085 Mbps | 30 (recommended) | 75 (recommended)
|
||||
Medium | $50 | 2-core ARM (shared) | 4 GB | Up to 2,085 Mbps | 50 (recommended) | 150 (recommended)
|
||||
Large | $100 | 2-core ARM (dedicated) | 8 GB | Up to 4,750 Mbps | 100 (recommended) | 300 (recommended)
|
||||
XL | $200 | 4-core ARM (dedicated) | 16 GB | Up to 4,750 Mbps | 200 (recommended) | 600 (recommended)
|
||||
2XL | $400 | 8-core ARM (dedicated) | 32 GB | Up to 4,750 Mbps | 350 (recommended) | 1200 (recommended)
|
||||
4XL | $950 | 16-core ARM (dedicated) | 64 GB | Up to 4,750 Mbps | 420 (recommended) | 2800 (recommended)
|
||||
8XL | $1,860 | 32-core ARM (dedicated) | 128 GB | Up to 9,000 Mbps | 450 (recommended) | 5600 (recommended)
|
||||
12XL | $2,790 | 48-core ARM (dedicated) | 192 GB | Up to 13,500 Mbps | 480 (recommended) | 8600 (recommended)
|
||||
16XL | $3,720 | 64-core ARM (dedicated) | 256 GB | Up to 19,000 Mbps | 500 (recommended) | 11,600 (recommended)
|
||||
| Plan | Pricing | CPU | Memory | Disk IO Bandwidth | Connections: Direct | Connections: Pooler |
|
||||
| --------------- | ------- | ----------------------- | ------ | ----------------- | ------------------- | -------------------- |
|
||||
| Free (Included) | $0 | 2-core ARM (shared) | 1 GB | Up to 2,085 Mbps | 10 (recommended) | 50 (recommended) |
|
||||
| Small | $5 | 2-core ARM (shared) | 2 GB | Up to 2,085 Mbps | 30 (recommended) | 75 (recommended) |
|
||||
| Medium | $50 | 2-core ARM (shared) | 4 GB | Up to 2,085 Mbps | 50 (recommended) | 150 (recommended) |
|
||||
| Large | $100 | 2-core ARM (dedicated) | 8 GB | Up to 4,750 Mbps | 100 (recommended) | 300 (recommended) |
|
||||
| XL | $200 | 4-core ARM (dedicated) | 16 GB | Up to 4,750 Mbps | 200 (recommended) | 600 (recommended) |
|
||||
| 2XL | $400 | 8-core ARM (dedicated) | 32 GB | Up to 4,750 Mbps | 350 (recommended) | 1200 (recommended) |
|
||||
| 4XL | $950 | 16-core ARM (dedicated) | 64 GB | Up to 4,750 Mbps | 420 (recommended) | 2800 (recommended) |
|
||||
| 8XL | $1,860 | 32-core ARM (dedicated) | 128 GB | Up to 9,000 Mbps | 450 (recommended) | 5600 (recommended) |
|
||||
| 12XL | $2,790 | 48-core ARM (dedicated) | 192 GB | Up to 13,500 Mbps | 480 (recommended) | 8600 (recommended) |
|
||||
| 16XL | $3,720 | 64-core ARM (dedicated) | 256 GB | Up to 19,000 Mbps | 500 (recommended) | 11,600 (recommended) |
|
||||
|
||||
[Contact us](https://supabase.com/contact/enterprise) if you require a custom plan.
|
||||
|
||||
@@ -27,7 +27,7 @@ XL | $200 | 4-core ARM (dedicated) | 16 GB | Up to 4,750 Mbps | 200 (recommended
|
||||
|
||||
All Postgres instances on Supabase are dedicated applications running inside dedicated virtual machines. However, the underlying hardware resources, for example the physical CPU, may be shared between multiple VMs, but appear to the OS as if it is a dedicated hardware CPU. This is commonly referred to as a vCPU (virtual CPU). Cloud providers use these shared hardware resources to save cost—you can upgrade to a larger compute add-on to guarantee a dedicated physical CPU for your instance.
|
||||
|
||||
## Compute upgrades {#upgrades}
|
||||
## Compute upgrades [#upgrades]
|
||||
|
||||
When considering compute upgrades, assess whether your bottlenecks are hardware-constrained or software-constrained. For example, you may want to look into [optimizing the number of connections](/docs/guides/platform/performance#optimizing-the-number-of-connections) or [examining query performance](/docs/guides/platform/performance#examining-query-performance). When you're happy with your Postgres instance's performance, then you can focus on additional compute resources. For example, you can load test your application in staging to understand your compute requirements. You can also start out on a smaller tier, [create a report](https://app.supabase.com/project/_/reports) in the Dashboard to monitor your CPU utilization, and upgrade later as needed
|
||||
|
||||
|
||||
@@ -794,6 +794,8 @@ Congratulations, that is it! You have now built a fully functional user manageme
|
||||
## See also
|
||||
|
||||
- [Flutter Tutorial: building a Flutter chat app](https://supabase.com/blog/flutter-tutorial-building-a-chat-app)
|
||||
- [Flutter Tutorial - Part 2: Authentication and Authorization with RLS](https://supabase.com/blog/flutter-authentication-and-authorization-with-rls)
|
||||
|
||||
|
||||
export const Page = ({ children }) => <Layout meta={meta} children={children} />
|
||||
|
||||
|
||||
@@ -111,10 +111,7 @@ function MyApp({ Component, pageProps }) {
|
||||
const [supabase] = useState(() => createBrowserSupabaseClient())
|
||||
|
||||
return (
|
||||
<SessionContextProvider
|
||||
supabaseClient={supabase}
|
||||
initialSession={pageProps.initialSession}
|
||||
>
|
||||
<SessionContextProvider supabaseClient={supabase} initialSession={pageProps.initialSession}>
|
||||
<Component {...pageProps} />
|
||||
</SessionContextProvider>
|
||||
)
|
||||
@@ -140,10 +137,7 @@ function MyApp({
|
||||
const [supabase] = useState(() => createBrowserSupabaseClient())
|
||||
|
||||
return (
|
||||
<SessionContextProvider
|
||||
supabaseClient={supabase}
|
||||
initialSession={pageProps.initialSession}
|
||||
>
|
||||
<SessionContextProvider supabaseClient={supabase} initialSession={pageProps.initialSession}>
|
||||
<Component {...pageProps} />
|
||||
</SessionContextProvider>
|
||||
)
|
||||
|
||||
@@ -86,7 +86,7 @@ With Supabase, Tyler can use Flutter to build a performant app quickly at a low
|
||||
experience and has even joined the SupaSquad.
|
||||
|
||||
> Update: After being part of the SupaSquad, Tyler joined Supabase full time as part of the DevRel squad, focusing on Flutter. This is some of his latest work: [Flutter Tutorial: building a Flutter chat app
|
||||
> ](https://supabase.com/blog/flutter-tutorial-building-a-chat-app).
|
||||
> ](https://supabase.com/blog/flutter-tutorial-building-a-chat-app) and [Flutter Authentication and Authorization with RLS](https://supabase.com/blog/flutter-authentication-and-authorization-with-rls).
|
||||
|
||||
You can download and install spot for [iOS](https://apps.apple.com/us/app/spot-videos/id1564675926?utm_source=supabase&utm_campaign=static)
|
||||
and [Android](https://play.google.com/store/apps/details?id=app.spotvideo&utm_source=supabase&utm_campaign=static)
|
||||
|
||||
@@ -16,6 +16,8 @@ This is the first of a series of Flutter Tutorials. During the series, you will
|
||||
|
||||
In the first part, I will show you how to build a chat application, where users can sign up and talk to other users in a single chat room. The exchange of messages will happen in real time, meaning that you do not have to refresh the page to load new messages.
|
||||
|
||||
In the second part, I will show you how to implement [Authentication and Authorization (with RLS)](https://supabase.com/blog/flutter-authentication-and-authorization-with-rls) to the chat app.
|
||||
|
||||
In order to build this chat app, we will need a database to store all of the chat information. We will be using [Supabase](https://supabase.com/) to store the chat information. Supabase is a back end as a service that provides auth, database, storage and functions to easily create a scalable application. Supabase is a suitable backend for this app, because it provides a nice set of APIs on Postgres database that we can easily call by using the SDK. It is also perfect for chat apps like the one we are about to create, because we can subscribe to real time changes on the database.
|
||||
|
||||
This article also assumes that you have installed Flutter already on your machine. If not, you can go to the [official Flutter page](https://docs.flutter.dev/get-started/install) to start the installation.
|
||||
@@ -885,6 +887,7 @@ If you have any questions please reach out via [Twitter](https://twitter.com/dsh
|
||||
|
||||
## More Flutter Resources
|
||||
|
||||
- [Part 2: Flutter Authentication and Authorization with RLS](https://supabase.com/blog/flutter-authentication-and-authorization-with-rls)
|
||||
- [Flutter Supabase Quick Starter Guide](https://supabase.com/docs/guides/with-flutter)
|
||||
- [supabase-flutter v1.0 released](https://supabase.com/blog/supabase-flutter-sdk-v1-released)
|
||||
- [Open source map based Flutter app with CI/CD and scalable statemanagement example](https://github.com/dshukertjr/spot)
|
||||
|
||||
@@ -159,4 +159,5 @@ If you have any feedbacks, please let us know in the issues of the [supabase-flu
|
||||
|
||||
- [supabase-flutter 1.0 developer preview](https://pub.dev/packages/supabase_flutter)
|
||||
- [Flutter Tutorial: building a Flutter chat app](https://supabase.com/blog/flutter-tutorial-building-a-chat-app)
|
||||
- [Flutter Tutorial - Part 2: Authentication and Authorization with RLS](https://supabase.com/blog/flutter-authentication-and-authorization-with-rls)
|
||||
- [Build a Flutter app with Very Good CLI and Supabase](https://verygood.ventures/blog/flutter-app-very-good-cli-supabase)
|
||||
@@ -99,4 +99,5 @@ It required massive support from the community to bring the supabase-flutter to
|
||||
- [supabase-flutter documentation](https://supabase.com/docs/reference/dart/)
|
||||
- [v0 to v1 migration guide](https://supabase.com/docs/reference/dart/upgrade-guide)
|
||||
- [Flutter Tutorial: building a Flutter chat app](https://supabase.com/blog/flutter-tutorial-building-a-chat-app)
|
||||
- [Flutter Tutorial - Part 2: Authentication and Authorization with RLS](https://supabase.com/blog/flutter-authentication-and-authorization-with-rls)
|
||||
- [Build a Flutter app with Very Good CLI and Supabase](https://verygood.ventures/blog/flutter-app-very-good-cli-supabase)
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
|
After Width: | Height: | Size: 316 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 757 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 103 KiB |
@@ -3,7 +3,7 @@
|
||||
// This enables autocomplete, go to definition, etc.
|
||||
|
||||
import { serve } from 'https://deno.land/std@0.131.0/http/server.ts'
|
||||
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.0.0'
|
||||
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
|
||||
import { corsHeaders } from '../_shared/cors.ts'
|
||||
|
||||
console.log(`Function "get-tshirt-competition" up and running!`)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// https://deno.land/manual/getting_started/setup_your_environment
|
||||
// This enables autocomplete, go to definition, etc.
|
||||
|
||||
import { serve } from "https://deno.land/std@0.131.0/http/server.ts"
|
||||
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.0.0'
|
||||
import { serve } from 'https://deno.land/std@0.131.0/http/server.ts'
|
||||
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
@@ -29,14 +29,11 @@ serve(async (req) => {
|
||||
{ global: { headers: { Authorization: req.headers.get('Authorization')! } } }
|
||||
)
|
||||
|
||||
const { data, error } = await supabaseClient
|
||||
.storage
|
||||
.from('my-bucket')
|
||||
.download('sample.txt')
|
||||
const { data, error } = await supabaseClient.storage.from('my-bucket').download('sample.txt')
|
||||
if (error) throw error
|
||||
|
||||
// file contents are returned as a blob, we can convert it to utf-8 text by calling text() method.
|
||||
const contents = await data.text();
|
||||
const contents = await data.text()
|
||||
|
||||
// prints out the contents of the file
|
||||
console.log(contents)
|
||||
@@ -45,14 +42,12 @@ serve(async (req) => {
|
||||
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
||||
status: 200,
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.error(error)
|
||||
|
||||
return new Response(JSON.stringify({ error: error.message }), {
|
||||
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
||||
status: 400,
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
@@ -2,8 +2,8 @@
|
||||
// https://deno.land/manual/getting_started/setup_your_environment
|
||||
// This enables autocomplete, go to definition, etc.
|
||||
|
||||
import { serve } from "https://deno.land/std@0.131.0/http/server.ts"
|
||||
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.0.0'
|
||||
import { serve } from 'https://deno.land/std@0.131.0/http/server.ts'
|
||||
import { createClient, SupabaseClient } from 'https://esm.sh/@supabase/supabase-js@2'
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
@@ -11,58 +11,58 @@ const corsHeaders = {
|
||||
}
|
||||
|
||||
interface Task {
|
||||
name: string;
|
||||
status: number;
|
||||
name: string
|
||||
status: number
|
||||
}
|
||||
|
||||
async function getTask(supabaseClient: any, id: string) {
|
||||
const { data: task, error } = await supabaseClient.from('tasks').select('*').eq('id', id);
|
||||
async function getTask(supabaseClient: SupabaseClient, id: string) {
|
||||
const { data: task, error } = await supabaseClient.from('tasks').select('*').eq('id', id)
|
||||
if (error) throw error
|
||||
|
||||
return new Response(JSON.stringify({ task }), {
|
||||
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
||||
status: 200,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
async function getAllTasks(supabaseClient: any) {
|
||||
async function getAllTasks(supabaseClient: SupabaseClient) {
|
||||
const { data: tasks, error } = await supabaseClient.from('tasks').select('*')
|
||||
if (error) throw error
|
||||
|
||||
return new Response(JSON.stringify({ tasks }), {
|
||||
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
||||
status: 200,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
async function deleteTask(supabaseClient: any, id: string) {
|
||||
const { error } = await supabaseClient.from('tasks').delete().eq('id', id);
|
||||
async function deleteTask(supabaseClient: SupabaseClient, id: string) {
|
||||
const { error } = await supabaseClient.from('tasks').delete().eq('id', id)
|
||||
if (error) throw error
|
||||
|
||||
return new Response(JSON.stringify({}), {
|
||||
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
||||
status: 200,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
async function updateTask(supabaseClient: any, id: string, task: Task) {
|
||||
const { error } = await supabaseClient.from('tasks').update(task).eq('id', id);
|
||||
async function updateTask(supabaseClient: SupabaseClient, id: string, task: Task) {
|
||||
const { error } = await supabaseClient.from('tasks').update(task).eq('id', id)
|
||||
if (error) throw error
|
||||
|
||||
return new Response(JSON.stringify({ task }), {
|
||||
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
||||
status: 200,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
async function createTask(supabaseClient: any, task: Task) {
|
||||
const { error } = await supabaseClient.from('tasks').insert(task);
|
||||
async function createTask(supabaseClient: SupabaseClient, task: Task) {
|
||||
const { error } = await supabaseClient.from('tasks').insert(task)
|
||||
if (error) throw error
|
||||
|
||||
return new Response(JSON.stringify({ task }), {
|
||||
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
||||
status: 200,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
serve(async (req) => {
|
||||
@@ -90,10 +90,10 @@ serve(async (req) => {
|
||||
const matchingPath = taskPattern.exec(url)
|
||||
const id = matchingPath ? matchingPath.pathname.groups.id : null
|
||||
|
||||
let task = null;
|
||||
if (method === "POST" || method === "PUT") {
|
||||
const body = await req.json();
|
||||
task = body.task;
|
||||
let task = null
|
||||
if (method === 'POST' || method === 'PUT') {
|
||||
const body = await req.json()
|
||||
task = body.task
|
||||
}
|
||||
|
||||
// call relevant method based on method and id
|
||||
@@ -112,7 +112,7 @@ serve(async (req) => {
|
||||
return getAllTasks(supabaseClient)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.error(error)
|
||||
|
||||
return new Response(JSON.stringify({ error: error.message }), {
|
||||
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// This enables autocomplete, go to definition, etc.
|
||||
|
||||
import { serve } from 'https://deno.land/std@0.131.0/http/server.ts'
|
||||
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.0.0'
|
||||
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
|
||||
import { corsHeaders } from '../_shared/cors.ts'
|
||||
|
||||
console.log(`Function "select-from-table-with-auth-rls" up and running!`)
|
||||
|
||||
@@ -46,7 +46,7 @@ const ProviderForm: FC<Props> = ({ provider }) => {
|
||||
const { error } = await authConfig.update(payload)
|
||||
|
||||
if (!error) {
|
||||
resetForm({ values: payload, initialValues: payload })
|
||||
resetForm({ values: { ...values }, initialValues: { ...values } })
|
||||
setOpen(false)
|
||||
ui.setNotification({ category: 'success', message: 'Successfully updated settings' })
|
||||
} else {
|
||||
|
||||
@@ -29,7 +29,7 @@ const PITRDurationSelection: FC<Props> = ({
|
||||
const addonUpdateDisabled = useFlag('disableProjectCreationAndUpdate')
|
||||
|
||||
// Only projects of version greater than supabase-postgrest-14.1.0.44 can use PITR
|
||||
const canUsePITR = getSemanticVersion(ui.selectedProject?.kpsVersion ?? '') > 141044
|
||||
const canUsePITR = getSemanticVersion(ui.selectedProject?.dbVersion ?? '') > 141044
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FC, useState } from 'react'
|
||||
import { Listbox, IconLoader, Button, IconPlus, IconAlertCircle, IconCreditCard } from 'ui'
|
||||
import * as Tooltip from '@radix-ui/react-tooltip'
|
||||
import { Listbox, IconLoader, Button, IconPlus, IconAlertCircle, IconCreditCard } from 'ui'
|
||||
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
||||
|
||||
import { checkPermissions, useFlag, useStore } from 'hooks'
|
||||
@@ -319,16 +319,54 @@ const PaymentSummaryPanel: FC<Props> = ({
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-end">
|
||||
<Button
|
||||
block
|
||||
type="primary"
|
||||
size="medium"
|
||||
loading={isSubmitting}
|
||||
disabled={isSubmitting || isLoadingPaymentMethods || !hasChangesToPlan}
|
||||
onClick={() => validateOrder()}
|
||||
>
|
||||
Confirm payment
|
||||
</Button>
|
||||
<Tooltip.Root delayDuration={0}>
|
||||
<Tooltip.Trigger className="w-full">
|
||||
<Button
|
||||
block
|
||||
type="primary"
|
||||
size="medium"
|
||||
loading={isSubmitting}
|
||||
disabled={
|
||||
isSubmitting ||
|
||||
isLoadingPaymentMethods ||
|
||||
!hasChangesToPlan ||
|
||||
!selectedPaymentMethod
|
||||
}
|
||||
onClick={() => validateOrder()}
|
||||
>
|
||||
Confirm payment
|
||||
</Button>
|
||||
</Tooltip.Trigger>
|
||||
{!hasChangesToPlan ? (
|
||||
<Tooltip.Content side="bottom">
|
||||
<Tooltip.Arrow className="radix-tooltip-arrow" />
|
||||
<div
|
||||
className={[
|
||||
'rounded bg-scale-100 py-1 px-2 leading-none shadow',
|
||||
'border border-scale-200',
|
||||
].join(' ')}
|
||||
>
|
||||
<span className="text-xs text-scale-1200">
|
||||
No changes made to your subscription
|
||||
</span>
|
||||
</div>
|
||||
</Tooltip.Content>
|
||||
) : !selectedPaymentMethod ? (
|
||||
<Tooltip.Content side="bottom">
|
||||
<Tooltip.Arrow className="radix-tooltip-arrow" />
|
||||
<div
|
||||
className={[
|
||||
'rounded bg-scale-100 py-1 px-2 leading-none shadow',
|
||||
'border border-scale-200',
|
||||
].join(' ')}
|
||||
>
|
||||
<span className="text-xs text-scale-1200">Please select a payment method</span>
|
||||
</div>
|
||||
</Tooltip.Content>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</Tooltip.Root>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ export interface ProjectBase {
|
||||
export interface Project extends ProjectBase {
|
||||
// available after projects.fetchDetail
|
||||
connectionString?: string
|
||||
dbVersion?: string
|
||||
kpsVersion?: string
|
||||
restUrl?: string
|
||||
// store subscription tier products.metadata.supabase_prod_id
|
||||
|
||||
Reference in new issue
Block a user