Builder's DayOctober 26 · SFGet tickets

Prisma 8 extension

ParadeDB

BM25 full-text search indexes.

By PrismaExperimentalPostgreSQL

What it does

Registers the bm25 index type so a contract can declare ParadeDB full-text search indexes through the standard index surface, and emits CREATE INDEX ... USING bm25 DDL. Supports the key_field index option only so far.

Register it in the config

prisma.config.ts
import { definePrismaConfig } from 'prisma/config';
import paradedb from '@prisma/orm-extension-paradedb/control';
import { defineConfig as ormConfig } from '@prisma/orm-postgres/config';

export default definePrismaConfig({
  orm: ormConfig({
    contract: './src/prisma/contract.prisma',
    extensions: [paradedb],
    db: {
      connection: process.env['DATABASE_URL']!,
    },
  }),
});

Register it on the client

src/prisma/db.ts
import paradedb from '@prisma/orm-extension-paradedb/runtime';
import postgres from '@prisma/orm-postgres/runtime';
import type { Contract } from './contract.d';
import contractJson from './contract.json' with { type: 'json' };

export const db = postgres<Contract>({
  contractJson,
  url: process.env['DATABASE_URL']!,
  extensions: [paradedb],
});

Then run npx prisma@latest db init, or db update on an existing database. The extension ships its own migration for anything the database needs installed. Full walkthrough in the extensions docs.