The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
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.mdxindex 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" extensioncreate extension hypopg with schema extensions;@@ -48,6 +49,7 @@ It's good practice to create the extension within a separate schema (like `extenGiven the following table and a simple query to select from the table by id:+{/* prettier-ignore */}```sqlcreate table account (id int,@@ -65,6 +67,7 @@ fromWe can generate an explain plan for a description of how the PostgreSQL query plannerintends to execute the query.+{/* prettier-ignore */}```sqlexplain select * from account where id=1;@@ -79,6 +82,7 @@ Using HypoPG, we can create a hypothetical index on the `account(id)` column toNote 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 */}```sqlselect * 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 */}```sqlcreate 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.mdxindex 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" extensioncreate extension pg_jsonschema with schema extensions;@@ -52,6 +53,7 @@ It's good practice to create the extension within a separate schema (like `extenSince `pg_jsonschema` exposes its utilities as functions, we can test it with a simple select statement:+{/* prettier-ignore */}```sqlselectextensions.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 */}```sqlcreate 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.mdxindex 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" extensioncreate extension pg_stat_statements with schema extensions;@@ -61,6 +62,7 @@ It's good practice to create the extension within a separate schema (like `extenA 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 */}```sqlselectcalls,diff --git a/apps/docs/pages/guides/database/extensions/pgroonga.mdx b/apps/docs/pages/guides/database/extensions/pgroonga.mdxindex 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" extensioncreate extension pgroonga with schema extensions;@@ -47,6 +48,7 @@ It's good practice to create the extension within a separate schema (like `extenGiven a table with a `text` column:+{/* prettier-ignore */}```sqlcreate 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 */}```sqlcreate index ix_memos_content ON memos USING pgroonga(content);```To test the full text index, we'll add some data.+{/* prettier-ignore */}```sqlinsert into memos(content)values@@ -73,6 +77,7 @@ valuesThe 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 productionset 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 */}```sqlexplain select * from memos where content like '%engine%';