Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Update tabs for database pages part 1

Joshen Lima24d45f2af9d
diff --git a/apps/temp-docs/docs/guides/database/arrays.mdx b/apps/temp-docs/docs/guides/database/arrays.mdx
index 51d7f7474fd..9065f762952 100644
--- a/apps/temp-docs/docs/guides/database/arrays.mdx
+++ b/apps/temp-docs/docs/guides/database/arrays.mdx
@@ -14,14 +14,12 @@ PostgreSQL supports flexible [array types](https://www.postgresql.org/docs/12/ar
Create a test table with a text array (an array of strings):
<Tabs
- groupId="dashboard-or-sql"
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Table editor](https://app.supabase.com/project/_/editor) page in the Dashboard.
1. Click **New Table** and create a table with the name `arraytest`.
@@ -29,46 +27,41 @@ Create a test table with a text array (an array of strings):
1. Click **New Column** and create a column with the name `textarray`, type `text`, and select **Define as array**.
1. Click **Save**.
-</TabItem>
-
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
CREATE TABLE arraytest (id integer NOT NULL, textarray text ARRAY);
```
-</TabItem>
+</TabPanel>
</Tabs>
## Insert a record with an array value
<Tabs
- groupId="dashboard-or-sql"
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- {label: 'JavaScript', value: 'javascript'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Table editor](https://app.supabase.com/project/_/editor) page in the Dashboard.
1. Select the `arraytest` table.
1. Click **Insert row** and add `["Harry", "Larry", "Moe"]`.
1. Click **Save.**
-</TabItem>
-
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
INSERT INTO arraytest (id, textarray) VALUES (1, ARRAY['Harry', 'Larry', 'Moe']);
```
-</TabItem>
+</TabPanel>
+<TabPanel id="js" label="JavaScript">
-<TabItem value="javascript">
Insert a record from the JavaScript client:
```js
@@ -77,21 +70,18 @@ const { data, error } = await supabase
.insert([{ id: 2, textarray: ['one', 'two', 'three', 'four'] }])
```
-</TabItem>
-
+</TabPanel>
</Tabs>
## View the results
<Tabs
- groupId="dashboard-or-sql"
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Table editor](https://app.supabase.com/project/_/editor) page in the Dashboard.
1. Select the `arraytest` table.
@@ -102,8 +92,8 @@ You should see:
| --- | ----------------------- |
| 1 | ["Harry","Larry","Moe"] |
-</TabItem>
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
SELECT * FROM arraytest;
@@ -115,7 +105,7 @@ You should see:
| --- | ----------------------- |
| 1 | ["Harry","Larry","Moe"] |
-</TabItem>
+</TabPanel>
</Tabs>
## Query array data
@@ -123,14 +113,12 @@ You should see:
PostgreSQL uses 1-based indexing (e.g., `textarray[1]` is the first item in the array).
<Tabs
- groupId="dashboard-or-sql"
- defaultValue="sql"
- values={[
- {label: 'SQL', value: 'sql'},
- {label: 'JavaScript', value: 'javascript'},
- ]}>
-
-<TabItem value="sql">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
To select the first item from the array and get the total length of the array:
@@ -144,9 +132,8 @@ returns:
| --------- | ------------ |
| Harry | 3 |
-</TabItem>
-
-<TabItem value="javascript">
+</TabPanel>
+<TabPanel id="js" label="JavaScript">
This returns the entire array field:
@@ -165,7 +152,7 @@ returns:
]
```
-</TabItem>
+</TabPanel>
</Tabs>
## Resources
diff --git a/apps/temp-docs/docs/guides/database/extensions.mdx b/apps/temp-docs/docs/guides/database/extensions.mdx
index 6a4bb750105..ace05a764b0 100644
--- a/apps/temp-docs/docs/guides/database/extensions.mdx
+++ b/apps/temp-docs/docs/guides/database/extensions.mdx
@@ -14,30 +14,23 @@ Supabase has pre-installed some of the most useful open source extensions.
### Enable and disable extensions
<Tabs
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
2. Click **Extensions** in the sidebar.
3. Enable or disable an extension.
<video width="99%" muted playsInline controls={true}>
- <source
- src="/docs/videos/toggle-extensions.mp4"
- type="video/mp4"
- muted
- playsInline
- />
+ <source src="/docs/videos/toggle-extensions.mp4" type="video/mp4" muted playsInline />
</video>
-</TabItem>
-
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
-- Example: enable the "pgtap" extension and ensure it is installed
@@ -54,8 +47,7 @@ To disable an extension call `drop extension`.
Enabling some extensions with `create extension <extension-name> with schema extensions` may lead to permission issues (e.g., `dblink`, `http`, `pg_cron`).
:::
-</TabItem>
-
+</TabPanel>
</Tabs>
### Full list of extensions
diff --git a/apps/temp-docs/docs/guides/database/extensions/http.mdx b/apps/temp-docs/docs/guides/database/extensions/http.mdx
index c2ff431efc2..d70a5f16e52 100644
--- a/apps/temp-docs/docs/guides/database/extensions/http.mdx
+++ b/apps/temp-docs/docs/guides/database/extensions/http.mdx
@@ -38,20 +38,19 @@ You can use the `http` extension to make these network requests from Postgres.
### Enable the extension
<Tabs
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "http" and enable the extension.
-</TabItem>
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
-- Example: enable the "http" extension
@@ -66,8 +65,7 @@ To disable an extension, call `drop extension`.
It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.
-</TabItem>
-
+</TabPanel>
</Tabs>
### Available functions
diff --git a/apps/temp-docs/docs/guides/database/extensions/pgcron.mdx b/apps/temp-docs/docs/guides/database/extensions/pgcron.mdx
index e7032bf9bd9..7cdf943bdf0 100644
--- a/apps/temp-docs/docs/guides/database/extensions/pgcron.mdx
+++ b/apps/temp-docs/docs/guides/database/extensions/pgcron.mdx
@@ -14,20 +14,19 @@ The `pg_cron` extension is a simple cron-based job scheduler for PostgreSQL that
### Enable the extension
<Tabs
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pg_cron" and enable the extension.
-</TabItem>
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
-- Example: enable the "pg_cron" extension
@@ -45,7 +44,7 @@ grant all privileges on all tables in schema cron to {{DB user}};
drop extension if exists pg_cron;
```
-</TabItem>
+</TabPanel>
</Tabs>
### Syntax
diff --git a/apps/temp-docs/docs/guides/database/extensions/pgnet.mdx b/apps/temp-docs/docs/guides/database/extensions/pgnet.mdx
index 341af926e44..624dcecdef7 100644
--- a/apps/temp-docs/docs/guides/database/extensions/pgnet.mdx
+++ b/apps/temp-docs/docs/guides/database/extensions/pgnet.mdx
@@ -22,20 +22,19 @@ It differs from the `http` extension in that it is asynchronous by default. This
### Enable the extension
<Tabs
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pg_net" and enable the extension.
-</TabItem>
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
-- Example: enable the "pg_net" extension
@@ -52,7 +51,7 @@ To disable an extension, call `drop extension`.
Procedural languages are automatically installed within `pg_catalog`, so you don't need to specify a schema.
-</TabItem>
+</TabPanel>
</Tabs>
## `http_get` {#http_get}
diff --git a/apps/temp-docs/docs/guides/database/extensions/pgtap.mdx b/apps/temp-docs/docs/guides/database/extensions/pgtap.mdx
index b80b7171e3c..7e6b439dc3e 100644
--- a/apps/temp-docs/docs/guides/database/extensions/pgtap.mdx
+++ b/apps/temp-docs/docs/guides/database/extensions/pgtap.mdx
@@ -21,20 +21,19 @@ Let's cover some basic concepts:
### Enable the extension
<Tabs
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "pgtap" and enable the extension.
-</TabItem>
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
-- Enable the "pgtap" extension
@@ -49,8 +48,7 @@ To disable an extension you can call `drop extension`.
It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.
-</TabItem>
-
+</TabPanel>
</Tabs>
### Testing tables
diff --git a/apps/temp-docs/docs/guides/database/extensions/plv8.mdx b/apps/temp-docs/docs/guides/database/extensions/plv8.mdx
index 927199f8464..5e13b5a081a 100644
--- a/apps/temp-docs/docs/guides/database/extensions/plv8.mdx
+++ b/apps/temp-docs/docs/guides/database/extensions/plv8.mdx
@@ -21,20 +21,19 @@ It can be used for database functions, triggers, queries and more.
### Enable the extension
<Tabs
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
3. Search for "plv8" and enable the extension.
-</TabItem>
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
-- Example: enable the "plv8" extension
@@ -49,7 +48,7 @@ To disable an extension, call `drop extension`.
Procedural languages are automatically installed within `pg_catalog`, so you don't need to specify a schema.
-</TabItem>
+</TabPanel>
</Tabs>
### Create `plv8` functions
@@ -69,26 +68,25 @@ $$ language plv8;
You can call `plv8` functions like any other Postgres function:
<Tabs
- defaultValue="sql"
- values={[
- {label: 'SQL', value: 'sql'},
- {label: 'JavaScript', value: 'javascript'},
- ]}>
-
-<TabItem value="sql">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
```sql
select function_name();
```
-</TabItem>
-<TabItem value="javascript">
+</TabPanel>
+<TabPanel id="js" label="JavaScript">
```js
const { data, error } = supabase.rpc('function_name')
```
-</TabItem>
+</TabPanel>
</Tabs>
## Examples
diff --git a/apps/temp-docs/docs/guides/database/extensions/uuid-ossp.mdx b/apps/temp-docs/docs/guides/database/extensions/uuid-ossp.mdx
index 2fe759a5cb6..382199aa5c9 100644
--- a/apps/temp-docs/docs/guides/database/extensions/uuid-ossp.mdx
+++ b/apps/temp-docs/docs/guides/database/extensions/uuid-ossp.mdx
@@ -19,13 +19,12 @@ This makes them particularly well suited as Primary Keys. It is occasionally ref
### Enable the extension
<Tabs
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Database](https://app.supabase.com/project/_/database/tables) page in the Dashboard.
2. Click on **Extensions** in the sidebar.
@@ -34,8 +33,8 @@ This makes them particularly well suited as Primary Keys. It is occasionally ref
**Note**:
Currently `uuid-ossp` extension is enabled by default and cannot be disabled.
-</TabItem>
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
-- Example: enable the "uuid-ossp" extension
@@ -53,8 +52,7 @@ It's good practice to create the extension within a separate schema (like `exten
**Note**:
Currently `uuid-ossp` extension is enabled by default and cannot be disabled.
-</TabItem>
-
+</TabPanel>
</Tabs>
### The `uuid` type
diff --git a/apps/temp-docs/docs/guides/database/functions.mdx b/apps/temp-docs/docs/guides/database/functions.mdx
index 532752d97a5..c4554069883 100644
--- a/apps/temp-docs/docs/guides/database/functions.mdx
+++ b/apps/temp-docs/docs/guides/database/functions.mdx
@@ -65,21 +65,19 @@ At it's most basic a function has the following parts:
After the Function is created, we have several ways of "executing" the function - either directly inside the database using SQL, or with one of the client libraries.
<Tabs
-defaultValue="SQL"
-values={[
- {label: 'SQL', value: 'SQL'},
- {label: 'JS', value: 'JS'},
- {label: 'Dart', value: 'Dart'},
-]}>
-
-<TabItem value="SQL">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
```sql
select hello_world();
```
-</TabItem>
-<TabItem value="JS">
+</TabPanel>
+<TabPanel id="js" label="JavaScript">
```js
const { data, error } = await supabase.rpc('hello_world')
@@ -87,8 +85,8 @@ const { data, error } = await supabase.rpc('hello_world')
Reference: [rpc()](../../reference/javascript/rpc)
-</TabItem>
-<TabItem value="Dart">
+</TabPanel>
+<TabPanel id="dart" label="Dart">
```dart
final res = await supabase
@@ -98,8 +96,7 @@ final res = await supabase
Reference: [rpc()](../../reference/dart/rpc)
-</TabItem>
-
+</TabPanel>
</Tabs>
## Returning data sets
@@ -109,13 +106,12 @@ Database Functions can also return data sets from [Tables](../../guides/database
For example, if we had a database with some Star Wars data inside:
<Tabs
-defaultValue="Data"
-values={[
- {label: 'Data', value: 'Data'},
- {label: 'SQL', value: 'SQL'},
-]}>
-
-<TabItem value="SQL">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
```sql
create table planets (
@@ -143,8 +139,8 @@ values
(4, 'Chewbacca', 3);
```
-</TabItem>
-<TabItem value="Data">
+</TabPanel>
+<TabPanel id="data" label="Data">
<h4>Planets</h4>
@@ -163,8 +159,7 @@ values
| 3 | Princess Leia | 2 |
| 4 | Chewbacca | 3 |
-</TabItem>
-
+</TabPanel>
</Tabs>
We could create a function which returns all the planets:
@@ -181,14 +176,12 @@ $$;
Because this function returns a table set, we can also apply filters and selectors. For example, if we only wanted the first planet:
<Tabs
-defaultValue="SQL"
-values={[
- {label: 'SQL', value: 'SQL'},
- {label: 'JS', value: 'JS'},
- {label: 'Dart', value: 'Dart'},
-]}>
-
-<TabItem value="SQL">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
```sql
select *
@@ -196,15 +189,15 @@ from get_planets()
where id = 1;
```
-</TabItem>
-<TabItem value="JS">
+</TabPanel>
+<TabPanel id="js" label="JavaScript">
```js
const { data, error } = supabase.rpc('get_planets').eq('id', 1)
```
-</TabItem>
-<TabItem value="Dart">
+</TabPanel>
+<TabPanel id="dart" label="Dart">
```dart
final res = await supabase
@@ -213,8 +206,7 @@ final res = await supabase
.execute();
```
-</TabItem>
-
+</TabPanel>
</Tabs>
## Passing parameters
@@ -241,28 +233,26 @@ $$;
Once again, you can execute this function either inside your database using a `select` query, or with the client libraries:
<Tabs
-defaultValue="SQL"
-values={[
- {label: 'SQL', value: 'SQL'},
- {label: 'JS', value: 'JS'},
- {label: 'Dart', value: 'Dart'},
-]}>
-
-<TabItem value="SQL">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
```sql
select * from add_planet('Jakku');
```
-</TabItem>
-<TabItem value="JS">
+</TabPanel>
+<TabPanel id="js" label="JavaScript">
```js
const { data, error } = await supabase.rpc('add_planet', { name: 'Jakku' })
```
-</TabItem>
-<TabItem value="Dart">
+</TabPanel>
+<TabPanel id="dart" label="Dart">
```dart
final res = await supabase
@@ -270,8 +260,7 @@ final res = await supabase
.execute();
```
-</TabItem>
-
+</TabPanel>
</Tabs>
## Suggestions
diff --git a/apps/temp-docs/docs/guides/database/json.mdx b/apps/temp-docs/docs/guides/database/json.mdx
index e65429d53de..11dc1963581 100644
--- a/apps/temp-docs/docs/guides/database/json.mdx
+++ b/apps/temp-docs/docs/guides/database/json.mdx
@@ -16,14 +16,12 @@ When you use the `JSONB` format, the data is parsed when it's put into the datab
## Create a table with a JSON column
<Tabs
- groupId="json"
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Table Editor](https://app.supabase.com/project/_/editor) page in the Dashboard.
2. Click **New Table** and create a table called `books`.
@@ -43,9 +41,8 @@ When you use the `JSONB` format, the data is parsed when it's put into the datab
- Name: `metadata`
- Type: `jsonb`
-</TabItem>
-
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
create table books (
@@ -56,21 +53,18 @@ create table books (
);
```
-</TabItem>
+</TabPanel>
</Tabs>
## Insert data into the table
<Tabs
- groupId="json"
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- {label: 'JavaScript', value: 'javascript'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
1. Go to the [Table Editor](https://app.supabase.com/project/_/editor) page in the Dashboard.
2. Select the `books` table in the sidebar.
@@ -84,9 +78,8 @@ create table books (
| 4 | Green Eggs and Ham | Dr. Seuss | {"ages":[4,8],"price":7.49,"description":"Sam has changing food preferences and eats unusually colored food."} |
| 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | {"ages":[10,99],"price":24.95,"description":"Fourth year of school starts, big drama ensues."} |
-</TabItem>
-
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
insert into books
@@ -119,9 +112,8 @@ values
);
```
-</TabItem>
-
-<TabItem value="javascript">
+</TabPanel>
+<TabPanel id="js" label="JavaScript">
```js
const { data, error } = await supabase.from('books').insert([
@@ -156,8 +148,7 @@ const { data, error } = await supabase.from('books').insert([
title: 'Green Eggs and Ham',
author: 'Dr. Seuss',
metadata: {
- description:
- 'Sam has changing food preferences and eats unusually colored food.',
+ description: 'Sam has changing food preferences and eats unusually colored food.',
price: 7.49,
ages: [4, 8],
},
@@ -174,39 +165,34 @@ const { data, error } = await supabase.from('books').insert([
])
```
-</TabItem>
+</TabPanel>
</Tabs>
## View the data
<Tabs
- groupId="json"
- defaultValue="sql"
- values={[
- {label: 'SQL', value: 'sql'},
- {label: 'JavaScript', value: 'javascript'},
- {label: 'Result', value: 'result'},
- ]}>
-
-<TabItem value="sql">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
```sql
select *
from books;
```
-</TabItem>
-
-<TabItem value="javascript">
+</TabPanel>
+<TabPanel id="js" label="JavaScript">
```js
const { data, error } = await supabase.from('books').select('*')
console.log(JSON.stringify(data, null, 2))
```
-</TabItem>
-
-<TabItem value="result">
+</TabPanel>
+<TabPanel id="result" label="Result">
| id | title | author | metadata |
| --- | ----------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------- |
@@ -218,7 +204,7 @@ console.log(JSON.stringify(data, null, 2))
The data as it appears here has the `JSONB` fields in a different order than when inserted. As mentioned earlier, data is parsed as its inserted when using the JSONB format.
-</TabItem>
+</TabPanel>
</Tabs>
## Query the `JSONB` data
@@ -226,15 +212,12 @@ The data as it appears here has the `JSONB` fields in a different order than whe
Select the title, description, price, and age range for each book.
<Tabs
- groupId="json"
- defaultValue="sql"
- values={[
- {label: 'SQL', value: 'sql'},
- {label: 'JavaScript', value: 'javascript'},
- {label: 'Result', value: 'result'}
- ]}>
-
-<TabItem value="sql">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
```sql
select
@@ -247,9 +230,8 @@ from
books;
```
-</TabItem>
-
-<TabItem value="javascript">
+</TabPanel>
+<TabPanel id="js" label="JavaScript">
```js
const { data, error } = await supabase
@@ -260,9 +242,8 @@ const { data, error } = await supabase
console.log(JSON.stringify(data, null, 2))
```
-</TabItem>
-
-<TabItem value="result">
+</TabPanel>
+<TabPanel id="result" label="Result">
| title | description | price | low_age | high_age |
| ----------------------------------- | ------------------------------------------------------------------ | ----- | ------- | -------- |
@@ -272,7 +253,7 @@ console.log(JSON.stringify(data, null, 2))
| Green Eggs and Ham | Sam has changing food preferences and eats unusually colored food. | 7.49 | 4 | 8 |
| Harry Potter and the Goblet of Fire | Fourth year of school starts, big drama ensues. | 24.95 | 10 | 99 |
-</TabItem>
+</TabPanel>
</Tabs>
Note that the `->` operator returns JSONB data. If you want TEXT/STRING data returned, use the `->>` operator.
diff --git a/apps/temp-docs/docs/guides/database/managing-timezones.mdx b/apps/temp-docs/docs/guides/database/managing-timezones.mdx
index 8a2f67d9c7b..8b4cf4bde75 100644
--- a/apps/temp-docs/docs/guides/database/managing-timezones.mdx
+++ b/apps/temp-docs/docs/guides/database/managing-timezones.mdx
@@ -14,19 +14,19 @@ This is because it makes it much easier to calculate differences between timezon
### Change timezone
<Tabs
- defaultValue="sql"
- groupId="reference/postgres"
- values={[{ label: 'SQL', value: 'sql' }]}>
-
-<TabItem value="sql">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
```sql
alter database postgres
set timezone to 'America/New_York';
```
-</TabItem>
-
+</TabPanel>
</Tabs>
### Full list of timezones
@@ -39,11 +39,12 @@ Get a full list of timezones supported by your database. This will return the fo
- `is_dst`: True if currently observing daylight savings
<Tabs
- defaultValue="sql"
- groupId="reference/postgres"
- values={[{ label: 'SQL', value: 'sql' }]}>
-
-<TabItem value="sql">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
```sql
select name, abbrev, utc_offset, is_dst
@@ -51,8 +52,7 @@ from pg_timezone_names()
order by name;
```
-</TabItem>
-
+</TabPanel>
</Tabs>
### Search for a specific timezone
@@ -60,11 +60,12 @@ order by name;
Use `ilike` (case insensitive search) to find specific timezones.
<Tabs
- defaultValue="sql"
- groupId="reference/postgres"
- values={[{ label: 'SQL', value: 'sql' }]}>
-
-<TabItem value="sql">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
```sql
select *
@@ -72,6 +73,5 @@ from pg_timezone_names()
where name ilike '%york%';
```
-</TabItem>
-
+</TabPanel>
</Tabs>
diff --git a/apps/temp-docs/docs/guides/database/tables.mdx b/apps/temp-docs/docs/guides/database/tables.mdx
index 7f4d0e914ca..0c86ce97fba 100644
--- a/apps/temp-docs/docs/guides/database/tables.mdx
+++ b/apps/temp-docs/docs/guides/database/tables.mdx
@@ -25,7 +25,7 @@ There are a few important differences from a spreadsheet, but it's a good starti
When creating a table, it's best practice to add columns at the same time.
-![Tables and columns](/img/guides/database/tables-columns.png)
+![Tables and columns](/docs/img/guides/database/tables-columns.png)
You must define the "data type" of each column when it is created. You can add and remove columns at any time after creating a table.
@@ -34,22 +34,15 @@ We provide a SQL editor within the Dashboard, or you can [connect](../../guides/
and run the SQL queries yourself.
<Tabs
- groupId="dashboard-or-sql"
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
<video width="99%" muted playsInline controls="true">
- <source
- src="/docs/videos/api/api-create-table-sm.mp4"
- type="video/mp4"
- muted
- playsInline
- />
+ <source src="/docs/videos/api/api-create-table-sm.mp4" type="video/mp4" muted playsInline />
</video>
1. Go to the [Table Editor](https://app.supabase.com/project/_/editor) page in the Dashboard.
@@ -58,8 +51,8 @@ and run the SQL queries yourself.
4. Click **New Column** and create a column with the name `task` and type `text`.
5. Click **Save**.
-</TabItem>
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
create table movies (
@@ -69,7 +62,7 @@ create table movies (
);
```
-</TabItem>
+</TabPanel>
</Tabs>
:::note
@@ -178,14 +171,12 @@ Use the "Bulk Loading" instructions if you are loading large data sets.
### Basic data loading
<Tabs
- defaultValue="sql"
- values={[
- {label: 'SQL', value: 'sql'},
- {label: 'JavaScript', value: 'javascript'},
- {label: 'Dart', value: 'dart'},
- ]}>
-
-<TabItem value="sql">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="sql"
+>
+<TabPanel id="sql" label="SQL">
```sql
insert into movies
@@ -195,9 +186,8 @@ values
('Return of the Jedi', 'After a daring mission to rescue Han Solo from Jabba the Hutt, the Rebels dispatch to Endor to destroy the second Death Star.');
```
-</TabItem>
-
-<TabItem value="javascript">
+</TabPanel>
+<TabPanel id="js" label="JavaScript">
```sql
const { data, error } = await supabase
@@ -211,9 +201,8 @@ const { data, error } = await supabase
}])
```
-</TabItem>
-
-<TabItem value="dart">
+</TabPanel>
+<TabPanel id="dart" label="Dart">
```sql
final res = await supabase
@@ -227,7 +216,7 @@ final res = await supabase
}]).execute();
```
-</TabItem>
+</TabPanel>
</Tabs>
### Bulk data loading
@@ -253,7 +242,7 @@ psql -h DATABASE_URL -p 5432 -d postgres -U postgres \
Tables can be "joined" together using Foreign Keys.
-![Foreign Keys](/img/guides/database/foreign-keys.png)
+![Foreign Keys](/docs/img/guides/database/foreign-keys.png)
This is where the "Relational" naming comes from, as data typically forms some sort of relationship.
@@ -278,14 +267,12 @@ For example if you had the following situations:
- An `actor` can perfom in several movies.
<Tabs
- groupId="dashboard-or-sql"
- defaultValue="dashboard"
- values={[
- {label: 'Dashboard', value: 'dashboard'},
- {label: 'SQL', value: 'sql'},
- ]}>
-
-<TabItem value="dashboard">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="dashboard"
+>
+<TabPanel id="dashboard" label="Dashboard">
<div class="video-container">
<iframe
@@ -296,9 +283,8 @@ For example if you had the following situations:
></iframe>
</div>
-</TabItem>
-
-<TabItem value="sql">
+</TabPanel>
+<TabPanel id="sql" label="SQL">
```sql
create table movies (
@@ -319,14 +305,14 @@ create table performances (
);
```
-</TabItem>
+</TabPanel>
</Tabs>
## Schemas
Tables belong to `schemas`. Schemas are a way of organizing your tables, often for security reasons.
-![Schemas and tables](/img/guides/database/schema-tables.png)
+![Schemas and tables](/docs/img/guides/database/schema-tables.png)
If you don't explicitly pass a schema when creating a table, Postgres will assume that you want to create the table in the `public` schema.
diff --git a/apps/temp-docs/docs/guides/platform/logs.mdx b/apps/temp-docs/docs/guides/platform/logs.mdx
index b8ccfd1e875..26a5d608201 100644
--- a/apps/temp-docs/docs/guides/platform/logs.mdx
+++ b/apps/temp-docs/docs/guides/platform/logs.mdx
@@ -23,15 +23,20 @@ Supabase provides a logging interface specific to each product. You can use simp
To update the screenshots, ensure that at least one log line is selected to display the metadata. Can use meme.town as an example.
-->
-<Tabs>
- <TabItem value="api" label="API" default>
+<Tabs
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="api"
+>
+<TabPanel id="api" label="API">
[API logs](https://app.supabase.com/project/_/database/api-logs) show all network requests and response for the REST and GraphQL [APIs](../../guides/api).
-![API Logs](/img/guides/platform/logs/logs-api.png)
+![API Logs](/docs/img/guides/platform/logs/logs-api.png)
- </TabItem>
- <TabItem value="postgres" label="Postgres">
+</TabPanel>
+<TabPanel id="postgres" label="Postgres">
[Postgres logs](https://app.supabase.com/project/_/database/postgres-logs) show queries and activity for your [database](../../guides/database).
@@ -60,31 +65,31 @@ To remove a system-wide setting, you can use (followed by a db reboot):
alter system reset pgaudit.log
```
-![Postgres Logs](/img/guides/platform/logs/logs-database.png)
+![Postgres Logs](/docs/img/guides/platform/logs/logs-database.png)
- </TabItem>
- <TabItem value="auth" label="Auth">
+</TabPanel>
+<TabPanel id="auth" label="Auth">
[Auth logs](https://app.supabase.com/project/_/auth/logs) show all server logs for your [Auth usage](../../guides/auth).
-![Auth Logs](/img/guides/platform/logs/logs-auth.png)
+![Auth Logs](/docs/img/guides/platform/logs/logs-auth.png)
- </TabItem>
- <TabItem value="storage" label="Storage">
+</TabPanel>
+<TabPanel id="storage" label="Storage">
[Storage logs](https://app.supabase.com/project/_/storage/logs) shows all server logs for your [Storage API](../../guides/storage).
-![Storage Logs](/img/guides/platform/logs/logs-storage.png)
+![Storage Logs](/docs/img/guides/platform/logs/logs-storage.png)
- </TabItem>
- <TabItem value="realtime" label="Realtime">
+</TabPanel>
+<TabPanel id="realtime" label="Realtime">
[Realtime logs](https://app.supabase.com/project/_/database/realtime-logs) show all server logs for your [Realtime API usage](../../guides/realtime).
-![Realtime Logs](/img/guides/platform/logs/logs-realtime.png)
+![Realtime Logs](/docs/img/guides/platform/logs/logs-realtime.png)
- </TabItem>
- <TabItem value="functions" label="Edge Functions">
+</TabPanel>
+<TabPanel id="functions" label="Edge Functions">
For each [Edge Function](https://app.supabase.com/project/_/functions), logs are available under the following tabs:
@@ -92,22 +97,22 @@ For each [Edge Function](https://app.supabase.com/project/_/functions), logs are
The Invocations tab displays the edge logs of function calls.
-![Function Edge Logs](/img/guides/platform/logs/logs-functions-edge.png)
+![Function Edge Logs](/docs/img/guides/platform/logs/logs-functions-edge.png)
**Logs**
The Logs tab displays logs emitted during function execution.
-![Function Logs](/img/guides/platform/logs/logs-functions.png)
+![Function Logs](/docs/img/guides/platform/logs/logs-functions.png)
- </TabItem>
+</TabPanel>
</Tabs>
## Logs Explorer
The [Logs Explorer](https://app.supabase.com/project/_/logs-explorer) exposes logs from each part of the Supabase stack as a separate table that can be queried and joined using SQL.
-![Logs Explorer](/img/guides/platform/logs/logs-explorer.png)
+![Logs Explorer](/docs/img/guides/platform/logs/logs-explorer.png)
You can access the following logs from the **Sources** drop-down:
diff --git a/apps/temp-docs/scripts/build-search.js b/apps/temp-docs/scripts/build-search.js
index 3aa357ff028..489354b56e5 100644
--- a/apps/temp-docs/scripts/build-search.js
+++ b/apps/temp-docs/scripts/build-search.js
@@ -16,7 +16,14 @@ const algoliasearch = require('algoliasearch/lite')
// Note that we'll need to do a general clean up of the files in the docs
// A lot of them are not even linked to within the docs site, so just need to
// double check if they can be removed or if we want them in the side bars.
-const ignoredFiles = ['docs/404.mdx', 'docs/support.mdx', 'docs/faqs.mdx', 'docs/guides.mdx']
+const ignoredFiles = [
+ 'docs/404.mdx',
+ 'docs/support.mdx',
+ 'docs/faqs.mdx',
+ 'docs/guides.mdx',
+ 'docs/guides/database/arrays.mdx',
+ 'docs/guides/database/json.mdx',
+]
const nameMap = {
api: 'Management API',