Skip to content

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

Ignore Prettier for SQL code blocks

dannykng305c62a83e8f
diff --git a/apps/docs/pages/guides/database/extensions/hypopg.mdx b/apps/docs/pages/guides/database/extensions/hypopg.mdx
index cfedd145e07..c493f9f89cd 100644
--- a/apps/docs/pages/guides/database/extensions/hypopg.mdx
+++ b/apps/docs/pages/guides/database/extensions/hypopg.mdx
@@ -28,6 +28,7 @@ That allows users to quickly search for an index to improve a slow query without
</TabPanel>
<TabPanel id="sql" label="SQL">
+{/* prettier-ignore */}
```sql
-- Enable the "hypopg" extension
create extension hypopg with schema extensions;
@@ -48,6 +49,7 @@ It's good practice to create the extension within a separate schema (like `exten
Given the following table and a simple query to select from the table by id:
+{/* prettier-ignore */}
```sql
create table account (
id int,
@@ -65,6 +67,7 @@ from
We can generate an explain plan for a description of how the PostgreSQL query planner
intends to execute the query.
+{/* prettier-ignore */}
```sql
explain select * from account where id=1;
@@ -79,6 +82,7 @@ Using HypoPG, we can create a hypothetical index on the `account(id)` column to
Note that the virtual indexes created by HypoPG are only visible in the PostgreSQL connection that they were created in. Supabase connects to PostgreSQL through a connection pooler so the `hypopg_create_index` statement and the `explain` statement should be executed in a single query.
+{/* prettier-ignore */}
```sql
select * from hypopg_create_index('create index on account(id)');
@@ -93,6 +97,7 @@ explain select * from account where id=1;
The query plan has changed from a `Seq Scan` to an `Index Scan` using the newly created virtual index, so we may choose to create a real version of the index to improve performance on the target query:
+{/* prettier-ignore */}
```sql
create index on account(id);
```
diff --git a/apps/docs/pages/guides/database/extensions/pg_jsonschema.mdx b/apps/docs/pages/guides/database/extensions/pg_jsonschema.mdx
index 2f4776afea2..c51a4c3783e 100644
--- a/apps/docs/pages/guides/database/extensions/pg_jsonschema.mdx
+++ b/apps/docs/pages/guides/database/extensions/pg_jsonschema.mdx
@@ -27,6 +27,7 @@ export const meta = {
</TabPanel>
<TabPanel id="sql" label="SQL">
+{/* prettier-ignore */}
```sql
-- Enable the "pg_jsonschema" extension
create extension pg_jsonschema with schema extensions;
@@ -52,6 +53,7 @@ It's good practice to create the extension within a separate schema (like `exten
Since `pg_jsonschema` exposes its utilities as functions, we can test it with a simple select statement:
+{/* prettier-ignore */}
```sql
select
extensions.json_matches_schema(
@@ -62,6 +64,7 @@ select
`pg_jsonschema` is generally used in tandem with a [check constraint](https://www.postgresql.org/docs/current/ddl-constraints.html) as a way to constrain the contents of a json/b field to match a JSON Schema.
+{/* prettier-ignore */}
```sql
create table customer(
id serial primary key,
diff --git a/apps/docs/pages/guides/database/extensions/pg_stat_statements.mdx b/apps/docs/pages/guides/database/extensions/pg_stat_statements.mdx
index 48e9e757f28..711878d78c0 100644
--- a/apps/docs/pages/guides/database/extensions/pg_stat_statements.mdx
+++ b/apps/docs/pages/guides/database/extensions/pg_stat_statements.mdx
@@ -41,6 +41,7 @@ A full list of statistics is available in the [pg_stat_statements docs](https://
</TabPanel>
<TabPanel id="sql" label="SQL">
+{/* prettier-ignore */}
```sql
-- Enable the "pg_stat_statements" extension
create extension pg_stat_statements with schema extensions;
@@ -61,6 +62,7 @@ It's good practice to create the extension within a separate schema (like `exten
A common use for `pg_stat_statements` is to track down expensive or slow queries. The `pg_stat_statements` view contains a row for each executed query with statistics inlined. For example, you can leverage the statistics to identify frequently executed and slow queries against a given table.
+{/* prettier-ignore */}
```sql
select
calls,
diff --git a/apps/docs/pages/guides/database/extensions/pgroonga.mdx b/apps/docs/pages/guides/database/extensions/pgroonga.mdx
index 858101ef2b7..f006857303c 100644
--- a/apps/docs/pages/guides/database/extensions/pgroonga.mdx
+++ b/apps/docs/pages/guides/database/extensions/pgroonga.mdx
@@ -27,6 +27,7 @@ export const meta = {
</TabPanel>
<TabPanel id="sql" label="SQL">
+{/* prettier-ignore */}
```sql
-- Enable the "pgroonga" extension
create extension pgroonga with schema extensions;
@@ -47,6 +48,7 @@ It's good practice to create the extension within a separate schema (like `exten
Given a table with a `text` column:
+{/* prettier-ignore */}
```sql
create table memos (
id serial primary key,
@@ -56,12 +58,14 @@ create table memos (
We can index the column for full text search with a `pgroonga` index:
+{/* prettier-ignore */}
```sql
create index ix_memos_content ON memos USING pgroonga(content);
```
To test the full text index, we'll add some data.
+{/* prettier-ignore */}
```sql
insert into memos(content)
values
@@ -73,6 +77,7 @@ values
The PostgreSQL query planner is smart enough to know that, for extremely small tables, it's faster to scan the whole table rather than loading an index. To force the index to be used, we can disable sequential scans:
+{/* prettier-ignore */}
```sql
-- For testing only. Don't do this in production
set enable_seqscan = off;
@@ -80,6 +85,7 @@ set enable_seqscan = off;
Now if we run an explain plan on a query filtering on `memos.content`:
+{/* prettier-ignore */}
```sql
explain select * from memos where content like '%engine%';