diff --git a/apps/reference/_supabase_js/installing.mdx b/apps/reference/_supabase_js/installing.mdx
index 960bac4e30f..96b254beca2 100644
--- a/apps/reference/_supabase_js/installing.mdx
+++ b/apps/reference/_supabase_js/installing.mdx
@@ -31,7 +31,7 @@ Find the source code on [GitHub](https://github.com/supabase/supabase-js).
Or via CDN
```js
-
+
//or
-
+
```
diff --git a/apps/reference/_supabase_js/working-with-types.md b/apps/reference/_supabase_js/working-with-types.md
index 90314b8fa92..519650ed995 100644
--- a/apps/reference/_supabase_js/working-with-types.md
+++ b/apps/reference/_supabase_js/working-with-types.md
@@ -76,9 +76,9 @@ async function getMovies() {
return await supabase.from('movies').select('id, title, actors(*)')
}
-type actors = Database['public']['Tables']['actors']['Row']
+type Actors = Database['public']['Tables']['actors']['Row']
type MoviesResponse = Awaited>
type MoviesResponseSuccess = MoviesResponse['data'] & {
- actors: actors[]
+ actors: Actors[]
}
```
diff --git a/apps/reference/_supabase_js_versioned_docs/version-v1/installing.mdx b/apps/reference/_supabase_js_versioned_docs/version-v1/installing.mdx
index 18d83d1fe6f..4441c7253d7 100644
--- a/apps/reference/_supabase_js_versioned_docs/version-v1/installing.mdx
+++ b/apps/reference/_supabase_js_versioned_docs/version-v1/installing.mdx
@@ -31,7 +31,7 @@ Find the source code on [GitHub](https://github.com/supabase/supabase-js).
Or via CDN
```js
-
+
//or
-
+
```
diff --git a/apps/reference/docs/guides/auth/auth-helpers/sveltekit.mdx b/apps/reference/docs/guides/auth/auth-helpers/sveltekit.mdx
index 67b655863dc..5ba0d72572a 100644
--- a/apps/reference/docs/guides/auth/auth-helpers/sveltekit.mdx
+++ b/apps/reference/docs/guides/auth/auth-helpers/sveltekit.mdx
@@ -104,7 +104,7 @@ Edit your `+layout.svelte` file and set up the client-side.
### Set up hooks
-The `hooks.ts` file is where the heavy lifting of this library happens:
+The `hooks.server.ts` file is where the heavy lifting of this library happens:
```ts title="src/hooks.server.ts"
// make sure the supabase instance is initialized on the server
diff --git a/apps/reference/docs/guides/cli/cicd-workflow.mdx b/apps/reference/docs/guides/cli/cicd-workflow.mdx
index 875d240c300..07afed16df8 100644
--- a/apps/reference/docs/guides/cli/cicd-workflow.mdx
+++ b/apps/reference/docs/guides/cli/cicd-workflow.mdx
@@ -348,6 +348,24 @@ Once pushed, check that the migration version is up to date for both local and r
supabase migration list
```
+### Permission denied on db remote commit
+
+If you have been using Supabase hosted projects for a long time, you might encounter the following permission error when executing `db remote commit`.
+
+```bash
+Error: Error running pg_dump on remote database: pg_dump: error: query failed: ERROR: permission denied for table _type
+
+pg_dump: error: query was: LOCK TABLE "graphql"."_type" IN ACCESS SHARE MODE
+```
+
+To resolve this error, you need to grant `postgres` role permissions to `graphql` schema. You can do that by running the following query from Supabase dashboard's SQL Editor.
+
+```sql
+grant all on all tables in schema graphql to postgres, anon, authenticated, service_role;
+grant all on all functions in schema graphql to postgres, anon, authenticated, service_role;
+grant all on all sequences in schema graphql to postgres, anon, authenticated, service_role;
+```
+
### Permission denied on db push
If you created a table through Supabase dashboard, and your new migration script contains `ALTER TABLE` statements, you might run into permission error when applying them on staging or production databases.
@@ -358,12 +376,14 @@ ERROR: must be owner of table employees (SQLSTATE 42501); while executing migrat
This is because tables created through Supabase dashboard are owned by `supabase_admin` role while the migration scripts executed through CLI are under `postgres` role.
-One way to solve this is to grant `postgres` role additional privileges through the SQL Editor available on Supabase dashboard. For example, the following command grants postgres permissions to alter any table in the public schema.
+One way to solve this is to reassign the owner of those tables to `postgres` role. For example, if your table is named `users` in the public schema, you can run the following command to reassign owner.
```sql
-GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO postgres;
+ALTER TABLE users OWNER TO postgres;
```
+Apart from tables, you also need to reassign owner of other entities using their respective commands, including [types](https://www.postgresql.org/docs/current/sql-alterschema.html), [functions](https://www.postgresql.org/docs/current/sql-alterroutine.html), and [schemas](https://www.postgresql.org/docs/current/sql-altertype.html).
+
### Rebasing new migrations
Sometimes your teammate may merge a new migration file to git main branch, and now you need to rebase your local schema changes on top.
diff --git a/apps/reference/docs/guides/integrations/prisma.mdx b/apps/reference/docs/guides/integrations/prisma.mdx
index 1915b3a8b9f..e7f8d517ccc 100644
--- a/apps/reference/docs/guides/integrations/prisma.mdx
+++ b/apps/reference/docs/guides/integrations/prisma.mdx
@@ -62,7 +62,7 @@ This project comes with TypeScript configured and has the following structure.
### Configuring the project to use PostgreSQL
Go ahead and delete the `prisma/dev.db` file because we will be switching to PostgreSQL.
-Next, inside the `prisma/.env` file, update the value of the `DATABASE_URL` variable to the connection string you got in **step 3**. The URL might look as follows:
+Next, inside the `prisma/.env` file, update the value of the `DATABASE_URL` variable to the connection string you got in **step 1**. The URL might look as follows:
```env
# prisma/.env
@@ -122,7 +122,7 @@ This will create a `prisma/migrations` folder inside your `prisma` directory and
If you’re working in a serverless environment (for example Node.js functions hosted on AWS Lambda, Vercel or Netlify Functions), you need to set up [connection pooling](https://www.prisma.io/docs/guides/performance-and-optimization/connection-management#serverless-environments-faas) using a tool like [PgBouncer](https://www.pgbouncer.org/). That’s because every function invocation may result in a [new connection to the database](https://www.prisma.io/docs/guides/performance-and-optimization/connection-management#the-serverless-challenge). Supabase [supports connection management using PgBouncer](https://supabase.io/blog/2021/04/02/supabase-pgbouncer#what-is-connection-pooling) and are enabled by default.
Go to the **Database** page from the sidebar in the Supabase dashboard and navigate to **connection pool** settings

-When running migrations you need to use the non pooled connection URL (like the one we used in **step 4**). However, when deploying your app, you’ll use the pooled connection URL and add the `?pgbouncer=true` flag to the PostgreSQL connection URL. To minimize the number of concurrent connections, setting the `connection_limit` to `1` is also recommended. So the URL might look as follows:
+When running migrations you need to use the non pooled connection URL (like the one we used in **step 1**). However, when deploying your app, you’ll use the pooled connection URL and add the `?pgbouncer=true` flag to the PostgreSQL connection URL. To minimize the number of concurrent connections, setting the `connection_limit` to `1` is also recommended. So the URL might look as follows:
```env
# prisma/.env
diff --git a/apps/reference/docs/guides/with-angular.mdx b/apps/reference/docs/guides/with-angular.mdx
index 93389bfc2df..2d4dc88df31 100644
--- a/apps/reference/docs/guides/with-angular.mdx
+++ b/apps/reference/docs/guides/with-angular.mdx
@@ -33,7 +33,7 @@ If you want to do it yourself, let's get started!
### GitHub
-Whenever you get stuck at any point, take a look at [this repo](https://github.com/angular-supa/supabase-angular-user-management).
+Whenever you get stuck at any point, take a look at [this repo](https://github.com/supabase/examples/tree/main/supabase-js-v2/user-management/angular-user-management).
## Project set up
@@ -180,281 +180,365 @@ export const environment = {
Now that we have the API credentials in place, let's create a **SupabaseService** with `ng g s supabase` to initialize the Supabase client and implement functions to communicate with the Supabase API.
```ts title="src/app/supabase.service.ts"
-import { Injectable } from '@angular/core'
+import { Injectable } from '@angular/core';
import {
AuthChangeEvent,
+ AuthSession,
createClient,
Session,
SupabaseClient,
-} from '@supabase/supabase-js'
-import { environment } from '../environments/environment'
+ User,
+} from '@supabase/supabase-js';
+import { environment } from 'src/environments/environment';
+import { Database } from 'src/schema';
export interface Profile {
- username: string
- website: string
- avatar_url: string
+ id?: string;
+ username: string;
+ website: string;
+ avatar_url: string;
}
@Injectable({
providedIn: 'root',
})
export class SupabaseService {
- private supabase: SupabaseClient
+ private supabase: SupabaseClient;
+ _session: AuthSession | null = null;
constructor() {
this.supabase = createClient(
environment.supabaseUrl,
environment.supabaseKey
- )
- }
-
- get user() {
- return this.supabase.auth.user()
+ );
}
get session() {
- return this.supabase.auth.session()
+ this.supabase.auth.getSession().then(({ data }) => {
+ this._session = data.session;
+ })
+ return this._session;
}
- get profile() {
+ profile(user: User) {
return this.supabase
.from('profiles')
.select(`username, website, avatar_url`)
- .eq('id', this.user?.id)
- .single()
+ .eq('id', user.id)
+ .single();
}
authChanges(
callback: (event: AuthChangeEvent, session: Session | null) => void
) {
- return this.supabase.auth.onAuthStateChange(callback)
+ return this.supabase.auth.onAuthStateChange(callback);
}
signIn(email: string) {
- return this.supabase.auth.signIn({ email })
+ return this.supabase.auth.signInWithOtp({ email });
}
signOut() {
- return this.supabase.auth.signOut()
+ return this.supabase.auth.signOut();
}
updateProfile(profile: Profile) {
const update = {
...profile,
- id: this.user?.id,
updated_at: new Date(),
- }
+ };
- return this.supabase.from('profiles').upsert(update, {
- returning: 'minimal', // Don't return the value after inserting
- })
+ return this.supabase.from('profiles').upsert(update);
}
downLoadImage(path: string) {
- return this.supabase.storage.from('avatars').download(path)
+ return this.supabase.storage.from('avatars').download(path);
}
uploadAvatar(filePath: string, file: File) {
- return this.supabase.storage.from('avatars').upload(filePath, file)
+ return this.supabase.storage.from('avatars').upload(filePath, file);
}
}
```
-And one optional step is to update the CSS file `src/index.css` to make the app look nice.
-You can find the full contents of this file [here](https://raw.githubusercontent.com/angular-supa/supabase-angular-user-management/main/src/styles.css).
+Optionally, update [src/styles.css](https://raw.githubusercontent.com/supabase/examples/main/supabase-js-v2/user-management/angular-user-management/src/styles.css) to style the app.
### Set up a Login component
Let's set up an Angular component to manage logins and sign ups. We'll use Magic Links, so users can sign in with their email without using passwords.
Create an **AuthComponent** with `ng g c auth` Angular CLI command.
-```ts title="src/app/auth.component.ts"
-import { Component } from '@angular/core'
-import { SupabaseService } from './supabase.service'
+```ts title="src/app/auth/auth.component.ts"
+import { Component, OnInit } from '@angular/core';
+import { FormBuilder } from '@angular/forms';
+import { SupabaseService } from '../supabase.service';
@Component({
selector: 'app-auth',
- template: `
-
+```
+
+`app.module.ts` also needs to be modified to include the `ReactiveFormsModule` from the `@angular/forms` package.
+
+```ts title="src/app/app.module.ts"
+import { NgModule } from '@angular/core';
+import { BrowserModule } from '@angular/platform-browser';
+
+import { AppComponent } from './app.component';
+import { AuthComponent } from './auth/auth.component';
+import { AccountComponent } from './account/account.component';
+import { ReactiveFormsModule } from '@angular/forms';
+import { AvatarComponent } from './avatar/avatar.component';
+
+@NgModule({
+ declarations: [
+ AppComponent,
+ AuthComponent,
+ AccountComponent,
+ AvatarComponent,
+ ],
+ imports: [BrowserModule, ReactiveFormsModule],
+ providers: [],
+ bootstrap: [AppComponent],
+})
+export class AppModule {}
+```
+
Once that's done, run this in a terminal window:
```bash
@@ -474,110 +558,141 @@ Every Supabase project is configured with [Storage](/docs/guides/storage) for ma
Let's create an avatar for the user so that they can upload a profile photo.
Create an **AvatarComponent** with `ng g c avatar` Angular CLI command.
-```ts title="src/app/avatar.component.ts"
-import { Component, EventEmitter, Input, Output } from '@angular/core'
-import { SupabaseService } from './supabase.service'
-import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
+```ts title="src/app/avatar/avatar.component.ts"
+import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
+import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
+import { SupabaseService } from '../supabase.service';
@Component({
selector: 'app-avatar',
- template: `
-
+```
+
### Add the new widget
And then we can add the widget on top of the **AccountComponent** html template:
-```ts title="src/app/account.component.ts"
-template: `
-
-
+```html title="src/app/account.component.html"
+
+```
-
-`
+And add an `updateAvatar` function along with an `avatarUrl` getter to the **AccountComponent** typescript file:
+
+```ts title="src/app/account.component.ts"
+@Component({
+ selector: 'app-account',
+ templateUrl: './account.component.html',
+ styleUrls: ['./account.component.css'],
+})
+export class AccountComponent implements OnInit {
+ // ...
+ get avatarUrl() {
+ return this.updateProfileForm.value.avatar_url as string;
+ }
+
+ async updateAvatar(event: string): Promise {
+ this.updateProfileForm.patchValue({
+ avatar_url: event,
+ });
+ await this.updateProfile();
+ }
+ // ...
+}
```
## Next steps
diff --git a/apps/reference/generator/api.ts b/apps/reference/generator/api.ts
index b15086938e7..602842c4014 100644
--- a/apps/reference/generator/api.ts
+++ b/apps/reference/generator/api.ts
@@ -10,7 +10,7 @@ export default async function gen(
apiUrl: string
) {
const specRaw = fs.readFileSync(inputFileName, 'utf8')
- const spec = JSON.parse(specRaw)
+ const spec = JSON.parse(specRaw) as any
// console.log('spec', spec)
switch (spec.openapi || spec.swagger) {
diff --git a/apps/reference/generator/cli.ts b/apps/reference/generator/cli.ts
index d9708f0752d..9d554feb79f 100644
--- a/apps/reference/generator/cli.ts
+++ b/apps/reference/generator/cli.ts
@@ -6,8 +6,7 @@ import template from './templates/CliTemplate'
import type { CliSpec } from './types/CliSpec'
export default async function gen(inputFileName: string, outputDir: string) {
- const spec = yaml.load(fs.readFileSync(inputFileName, 'utf8'))
- // console.log('spec', spec)
+ const spec = yaml.load(fs.readFileSync(inputFileName, 'utf8')) as any
switch (spec.clispec) {
case '001':
diff --git a/apps/reference/generator/config.ts b/apps/reference/generator/config.ts
index 690a77dc833..378857b998c 100644
--- a/apps/reference/generator/config.ts
+++ b/apps/reference/generator/config.ts
@@ -12,7 +12,7 @@ type Section = {
}
export default async function gen(inputFileName: string, outputDir: string) {
- const spec = yaml.load(fs.readFileSync(inputFileName, 'utf8'))
+ const spec = yaml.load(fs.readFileSync(inputFileName, 'utf8')) as any
// console.log('spec', spec)
switch (spec.configspec) {
diff --git a/apps/reference/generator/sdk.ts b/apps/reference/generator/sdk.ts
index ee290d16d2f..2adb10c3898 100644
--- a/apps/reference/generator/sdk.ts
+++ b/apps/reference/generator/sdk.ts
@@ -6,7 +6,7 @@ import { writeToDisk } from './helpers'
import type { SdkSpec } from './types/SdkSpec'
export default async function gen(inputFileName: string, outputDir: string) {
- const spec = yaml.load(fs.readFileSync(inputFileName, 'utf8'))
+ const spec = yaml.load(fs.readFileSync(inputFileName, 'utf8')) as any
// console.log('spec', spec)
switch (spec.sdkspec) {
diff --git a/apps/temp-docs/docs/javascript/installing.mdx b/apps/temp-docs/docs/javascript/installing.mdx
index aeb6b0fff5a..80d1b5cf909 100644
--- a/apps/temp-docs/docs/javascript/installing.mdx
+++ b/apps/temp-docs/docs/javascript/installing.mdx
@@ -28,9 +28,9 @@ Find the source code on [GitHub](https://github.com/supabase/supabase-js).
Or via CDN
```js
-
+
//or
-
+
```
## Python
diff --git a/apps/temp-docs/docs/reference/javascript/installing.mdx b/apps/temp-docs/docs/reference/javascript/installing.mdx
index aeb6b0fff5a..80d1b5cf909 100644
--- a/apps/temp-docs/docs/reference/javascript/installing.mdx
+++ b/apps/temp-docs/docs/reference/javascript/installing.mdx
@@ -28,9 +28,9 @@ Find the source code on [GitHub](https://github.com/supabase/supabase-js).
Or via CDN
```js
-
+
//or
-
+
```
## Python
diff --git a/apps/www/_blog/2022-10-14-postgres-full-text-search-vs-the-rest.mdx b/apps/www/_blog/2022-10-14-postgres-full-text-search-vs-the-rest.mdx
new file mode 100644
index 00000000000..f96545c783a
--- /dev/null
+++ b/apps/www/_blog/2022-10-14-postgres-full-text-search-vs-the-rest.mdx
@@ -0,0 +1,369 @@
+---
+title: 'Postgres Full Text Search vs the rest'
+description: 'Comparing one of the most popular Postgres features against alternatives'
+author: victor
+image: postgres-fts-vs-the-rest/postgres-full-text-search.jpg
+thumb: postgres-fts-vs-the-rest/postgres-full-text-search.jpg
+tags:
+ - postgres
+date: '2022-10-14'
+toc_depth: 3
+---
+
+Postgres is one of the best F/OSS databases partly because of its immense feature-set.
+
+One of my favorite Postgres features is [Full Text Search](https://supabase.com/docs/guides/database/full-text-search) (FTS). Search is a common requirement of applications. Well-known search engines like [Solr](https://solr.apache.org/) and [ElasticSearch](https://www.elastic.co/elasticsearch) are often a first choice, but with Postgres in your stack you've got a great chance for [Pareto improvement](https://en.wikipedia.org/wiki/Pareto_principle) at low complexity cost.
+
+Many projects function just fine with Postgres Full Text Search and other [built-in](https://www.postgresql.org/docs/current/contrib.html) extensions like [trigram search (`pg_trgm`)](https://www.postgresql.org/docs/current/pgtrgm.html). [GitLab's blog has a great article](https://about.staging.gitlab.com/blog/2016/03/18/fast-search-using-postgresql-trigram-indexes/) on their use of Trigram indices to speed up search.
+
+## Search Engines: The Next Generation
+
+These days, the debate isn't _just_ Postgres versus Solr or ElasticSearch, a new generation of F/OSS search engines has arrived. To name a few:
+
+- [MeiliSearch](https://www.meilisearch.com/)
+- [OpenSearch](https://opensearch.org/)
+- [SQLite FTS](https://www.sqlite.org/fts5.html)
+- [Typesense](https://typesense.org/)
+
+Well OK, some of these engines aren't _quite_ new; SQLite is stable and has supported the search use-case for a while and OpenSearch is a fork of ElasticSearch. While not new, both are worth comparing as choices in front of engineers today (spoiler alert: we're going to compare them).
+
+These search engines are all impressive, but it's hard to evaluate these options in a `VACUUM`.
+
+If Postgres is already your main database, then it's probably easier to integrate than anything else. But would it be _better_ to take on more complexity by choosing a dedicated search engine?
+
+While search is an endlessly complicated problem and all of these tools are configurable, a comparison of minimal setup and tuning should yield some interesting insights.
+
+Before we get into it though, a _brief_ primer on what "Full Text Search" _means_, in Postgres land.
+
+## A whirlwind tour through FTS in Postgres
+
+If we want to compare other solutions to Postgres FTS, we'd better review how to set up and use [Postgres FTS](https://www.postgresql.org/docs/current/textsearch.html)!
+
+### Wrangling your existing data
+
+Imagine you have some information to search through, stored in your main database.
+
+Maybe a `movies` table with a structure like this:
+
+```sql
+ create table movies (
+ id bigint primary key generated by default as identity,
+ title text not null,
+ original_title text not null,
+ overview text not null,
+ created_at timestamptz not null default now()
+);
+```
+
+While you're inserting data you might perform `INSERTs` like this one:
+
+```sql
+insert into movies (
+ title,
+ original_title,
+ overview
+)
+values
+(
+ "Avengers: Age of Ultron",
+ "Avengers: Age of Ultron",
+ "When Tony Stark tries to jumpstart a dormant peacekeeping program, things go awry and Earth’s Mightiest Heroes are put to the ultimate test as the fate of the planet hangs in the balance. As the villainous Ultron emerges, it is up to The Avengers to stop him from enacting his terrible plans, and soon uneasy alliances and unexpected action pave the way for an epic and unique global adventure.",
+);
+```
+
+### Basic searching with select and like
+
+With nothing but the raw data in your database, we can actually do some _basic_ searching using `select` and comparison tools like `like`.
+
+```sql
+select
+ *
+from
+ movies
+where
+ title like '%Avengers%'
+ or
+ overview like '%Avengers%';
+```
+
+The `LIKE` [operator](https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-LIKE) as used in the query above will match _only_ the term "Avengers", but it will match it in any part of a given row's `title` or `overview`.
+
+We can hack around this basic functionality and make it a bit more robust:
+
+- Storing the text as [case insensitive text (`citext`)](https://www.postgresql.org/docs/current/citext.html)
+- Combining the text that will be searched into one column
+- Using a [GIN index](https://www.postgresql.org/docs/14/indexes-types.html#INDEXES-TYPES-GIN)
+
+Our "v0" would be better, but using `like` isn't quite what people mean when they ask for _robust_ full text search. **Not a bad first version, but Postgres can do much better.**
+
+### Robust Full Text Search with Postgres
+
+Postgres has built-in [Full Text Search](https://www.postgresql.org/docs/current/textsearch.html) which we can use instead of cobbling together our own with `like`.
+
+Luckily for us, [the Postgres FTS documentation](https://www.postgresql.org/docs/current/textsearch.html) is quite extensive, containing lots of information on the all-important [Postgres search data types: `tsvector` and `tsquery`](https://www.postgresql.org/docs/current/datatype-textsearch.html).
+
+State of the art search engines like [Solr](https://solr.apache.org/) do things to make searches work well:
+
+- [Stemming](https://en.wikipedia.org/wiki/Stemming) ("jumped", "jumper" -> "jump")
+- [Lemmatization](https://en.wikipedia.org/wiki/lemmatization) ("better" -> "good")
+- Result Ranking configuration
+- Search by [edit distance](https://en.wikipedia.org/wiki/Levenshtein_distance)
+- Vector based similarity (which you might use for a basic recommendation system)
+
+Postgres FTS does not do _all_ of the things a purpose-built search engine can do, but Postgres can produce very good results with decent performance.
+
+## A working Postgres FTS setup
+
+Integrating Full Text Search into our imaginary movies table is as simple as executing the following:
+
+```sql
+-- Add a generated column that contains the search document
+alter table movies
+ add column fts_doc_en
+ generated always as to_tsvector (
+ 'english', title || ' ' || original_title || ' ' || overview
+ )
+ stored;
+
+-- Create a GIN index to make our searches faster
+create index movies_fts_doc_en_idx
+ on movies
+ using gin (fts_doc_en);
+```
+
+Postgres supports even more features like [facilities for ranking search results](https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-RANKING) but for now we'll simply use `title`, `original_title`, and `overview` as they are.
+
+```sql
+select
+ * from movies
+where doc_en @@ websearch_to_tsquery('english', 'Avengers');
+```
+
+## Comparable FTS engines
+
+Now that we've got a grasp on what FTS is and how it's used in Postgres, let's discuss a few of the alternative solutions Postgres can be compared to.
+
+As you might expect, this isn't an exhaustive list of FTS engines, there are many more that we're not covering here (If you've got another search engine you'd like to see featured, [file an issue](https://github.com/VADOSWARE/fts-benchmark/issues)).
+
+### SQLite FTS
+
+[SQLite](https://www.sqlite.org/) is arguably the most widely deployed database in the world. SQLite is a library that produces and manages single file (or in-memory) databases that run on phones, planes, laptops, kiosks, Raspberry Pis, and everything in between.
+
+Much like Postgres, SQLite is an excellent F/OSS project that has adopted the ability to perform Full Text Search.
+
+The [SQLite FTS documentation](https://www.sqlite.org/fts5.html) is extensive, and the FTS subsystems have undergone a few version upgrades -- [FTS 3/4](https://www.sqlite.org/fts3.html) and [SQLite FTS 5](https://www.sqlite.org/fts5.html) are both options.
+
+For our experiments we'll use SQLite FTS5.
+
+### TypeSense
+
+[TypeSense](https://typesense.org/) is a relatively new project that focuses on _lightning fast_, typo-tolerant open source search. Typesense boasts a high performance C++ codebase, promising nearly instant search results.
+
+TypeSense provides many demos with example datasets available for query, which you can try out:
+
+- [32MM songs from MusicBrainz](https://songs-search.typesense.org/)
+- [28M books from OpenLibrary](https://books-search.typesense.org/)
+- [XKCD comic search by topic](https://xkcd-search.typesense.org/)
+
+Typesense quite ambitiously brands itself as the "Algolia" and "Elasticsearch" alternative, offering to solve your search problems without requiring a PhD.
+
+### MeiliSearch
+
+[MeiliSearch](https://www.meilisearch.com/) is a new search engine written from the ground up in [Rust](https://rust-lang.org/), which also promises _lightning fast_ searches, flexibility, and typo tolerance.
+
+MeiliSearch has [extensive documentation](https://docs.meilisearch.com/), boasts an easy to use yet extendable architecture, and is well supported by a large community and team.
+
+### OpenSearch
+
+AWS [OpenSearch](https://opensearch.org/) is AWS's answer to ElasticSearch's license changes. While opinions are varied, ElasticSearch built a great piece (formerly Apache 2.0 licensed) piece of software, and the AWS fork represents at least a _stale_ measure of ElasticSearch's capabilities.
+
+OpenSearch is the _same_ as ElasticSearch (since the fork) but as it's license is much more permissive, it's the easy choice as a comparison to Postgres.
+
+In production make sure to evaluate ElasticSearch versus OpenSearch (or other solutions) sufficiently for your use case.
+
+## Testing our FTS solutions
+
+Well, how do we test performance of these disparate complex systems on an infinitely redefinable, hard-to-solve problem? By sticking to the use cases.
+
+Any search engine has two jobs:
+
+- Ingest information (usually referred to as "documents")
+- Return documents that match user queries
+
+Ingesting information _can_ be important, but "search engine performance" usually refers to the second step - taking queries and outputting results.
+
+That is to say, the primary concern is assuming a cluster already has proper data loaded on to it, how fast can it deliver the relevant results for a user-submitted query?
+
+We'll focus on the end-user-centric meaning of performance here (query speed).
+
+### Getting a dataset
+
+[Hugging Face](https://huggingface.co/) has a [32MB movie data set](https://huggingface.co/spaces/Kamand/Movie_Recommendation/blob/main/movies_metadata.csv). We're interested in the follow columns in this data set:
+
+- `title`
+- `original_title`
+- `overview`
+
+Postgres is capable of loading CSVs, but since we'll be using other search engines as well, let's convert to format that's much easier to use and process - [Newline Delimited JSON](https://dataprotocols.org/ndjson/).
+
+After a few lines of code and one [`csv2ndjson.mjs` script](https://github.com/VADOSWARE/fts-benchmark/blob/main/src/util/csv2ndjson.mjs) later, we have a `movies.ndjson.json` full of JSON documents that we can easily ingest into any search engine (or other database for that matter!).
+
+### Inserting the data
+
+Each system ingests data slightly differently, but with a little scripting we can paper over the differences.
+
+[The code](https://github.com/VADOSWARE/fts-benchmark) contains a scheme of "drivers" which are minimal ES6 modules.
+
+Here's an example of the `ingest` function used for Postgres (with [`slonik`](https://github.com/gajus/slonik) as our DB driver):
+
+```js
+// Ingesting search documents
+async function ingest({ document, pool }) {
+ // Ignore rows without proper release dates
+ if (document.release_date.trim().length === 0) {
+ return
+ }
+
+ await pool.query(sql`
+insert into movies (
+ id,
+ title,
+ original_title,
+ overview,
+ released_at
+)
+values
+(
+ ${document.id},
+ ${document.title},
+ ${document.original_title},
+ ${document.overview},
+ ${new Date(document.release_date).toISOString()}::timestamptz
+)
+on conflict (id) do update set
+ title=${document.title},
+ original_title=${document.original_title},
+ overview=${document.overview},
+ released_at=${new Date(document.release_date).toISOString()}::timestamptz
+;
+`)
+}
+```
+
+The [repo](https://github.com/VADOSWARE/fts-benchmark/) contains the complete code for Postgres as well as the other search engines, written in much this same fashion.
+
+### Picking a set of queries
+
+This part is somewhat arbitrary - I've gotten a list of queries here that one might search for in terms of movies:
+
+```
+"super hero"
+"superhero"
+"superman"
+"suprman"
+"love"
+"world war"
+"spy"
+"romance"
+"comedy"
+"awakening"
+```
+
+Thanks to [boinboing.net's article from 2018](https://boingboing.net/2018/04/30/the-most-common-words-in-movie.html), there are some words that show up quite often in movie titles that we can search for.
+
+The data set isn't very big, but doing all these searches in quick succession should be enough to get a realistic performance baseline.
+
+### Running the queries
+
+Similar to ingesting data, all the search engines take slightly different input for queries, so we'll change our simple string queries into whatever the relevant search engine expects to receive.
+
+Here's what that script looks like for Postgres:
+
+```js
+// Querying search phrases
+async function query({ phrase, pool }) {
+ const results = await pool.query(sql`
+select id, title
+from movies
+where fts_doc_en @@ websearch_to_tsquery('english', ${phrase}::text)
+`)
+ const ids = results.rows.map((r) => r.id)
+ return ids
+}
+```
+
+No surprises there, just like the Postgres FTS example from earlier.
+
+## Automating our toil
+
+Once we've combined our scripting magic with some `Makefile` incantations, running the queries produces output like this:
+
+```
+TIMING=true FTS_ENGINE=pg make query
+[info] importing driver from [./pg.mjs]
+[info] finished initializing driver [pg]
+[info] processing lines in [/path/to/pg-fts-benchmark/search-phrases.ndjson.json]...
+[timing] phrase [super hero]: returned [34] results in 3.132471.ms
+[timing] phrase [superhero]: returned [86] results in 1.180798.ms
+[timing] phrase [superman]: returned [47] results in 0.912615.ms
+[timing] phrase [suprman]: returned [0] results in 0.781712.ms
+[timing] phrase [love]: returned [5417] results in 19.088668.ms
+[timing] phrase [world war]: returned [834] results in 2.902097.ms
+[timing] phrase [spy]: returned [349] results in 1.497892.ms
+[timing] phrase [romance]: returned [630] results in 1.91661.ms
+[timing] phrase [comedy]: returned [1213] results in 2.534538.ms
+[timing] phrase [awakening]: returned [210] results in 2.443748.ms
+[info] successfully processed [10] lines
+```
+
+Right off the bat we can see that Postgres is plenty quick! Some results are quite obvious - as you might expect, "love" is _quite_ a common search result.
+
+## Results
+
+With the `ingest` and `query` machinery defined for the search engines, it's easy to get some results.
+
+
+
+## What does the data tell us?
+
+There's a _lot_ of tuning left undone here, but a few points stand out right away:
+
+- Even when consuming similar content, engines can produce different results, but generally ratios between queries on the same engine should be consistent.
+- Postgres FTS is quite close performance-wise to many other solutions, at least in their default configuration.
+- Only Typesense and MeiliSearch properly handled mis-spellings (the "suprman" query).
+- Typesense was relatively strict with matches compared to other engines.
+- OpenSearch was _very_ fast with ingest, but the default configuration doesn't index misspellings.
+- In-memory SQLite is by far the fastest, and PG isn't too far behind for this small data set.
+
+## Feedback from the other products
+
+Since this is a benchmark, we felt it was fair to give the other products an opportunity to give their feedback.
+
+### Meilisearch
+
+> I agree that using PG in simple use cases is an excellent way to be pragmatic.
+> Unfortunately, PG will never be able to offer you a search experience like the one you could have with Meilisearch. Meilisearch has perfect management of typos and searches by prefix, allowing a search at each keystroke. Enhanced relevancy with rules such as the number of words present, the importance of the attribute, the proximity of the terms searched in the document, and custom parameters. The ability to mix textual, geographic, and facet searches. Meilisearch automatically understands almost all languages with the possibility of having synonyms and stop words. Meilisearch has an incredible performance even on large volumes of data, and no backend proxy is needed, thanks to complete API Key management.
+
+_Quentin de Quelen, Meilisearch CEO_
+
+### Typesense
+
+> Some more context around Typesense's behavior: how loose or exact matches are done are configurable in Typesense. For eg, you can configure the number of typos that are accounted for (num_typos), and when typo tolerance should kick-in, only if a configurable amount of results are not found (typo_tokens_treshold). For multi keyword searches, you can configure Typesense to expand the search by dropping some of the keywords, until at least a configurable number of search results are found (drop_tokens_threshold).
+> We've chosen specifically to keep the search tight because we received feedback from users that some results were confusing if we let the defaults be too loose.
+
+_Jason Bosco, Typesense CEO_
+
+## Wrap-up
+
+While this certainly isn't "big data", it looks like Postgres has very much held it's own, even without too much wrangling/tuning. Postgres is clearly more than capable of delivering _good enough_ search for this very basic case.
+
+Special purpose systems are expected to out-perform a more general system like Postgres, but clearly result quality and search speed provided Postgres is likely to be _good enough_ for many use cases, and is “complexity neutral” -- no new systems needed!
+
+## More Postgres resources
+
+- [Postgres WASM by Snaplet and Supabase](https://supabase.com/blog/postgres-wasm)
+- [Choosing a Postgres Primary Key](https://supabase.com/blog/choosing-a-postgres-primary-key)
+- [Implementing "seen by" functionality with Postgres](https://supabase.com/blog/seen-by-in-postgresql)
+- [Partial data dumps using Postgres Row Level Security](https://supabase.com/blog/partial-postgresql-data-dumps-with-rls)
+- [Postgres Views](https://supabase.com/blog/postgresql-views)
+- [Realtime Postgres RLS on Supabase](https://supabase.com/blog/realtime-row-level-security-in-postgresql)
diff --git a/apps/www/components/CaseStudies/benchmark.tsx b/apps/www/components/CaseStudies/benchmark.tsx
index 630e7b6e7cf..1e2a218bf1a 100644
--- a/apps/www/components/CaseStudies/benchmark.tsx
+++ b/apps/www/components/CaseStudies/benchmark.tsx
@@ -31,11 +31,6 @@ const Benchmark = () => {