mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
feat: add pg_trgm extension in PGlite constructor
This commit is contained in:
parent
8bc8712cf3
commit
b5aefdd93e
1 changed files with 2 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import { PGlite } from '@electric-sql/pglite';
|
import { PGlite } from '@electric-sql/pglite';
|
||||||
|
import { pg_trgm } from '@electric-sql/pglite/contrib/pg_trgm';
|
||||||
import { PgliteDialect } from '@soapbox/kysely-pglite';
|
import { PgliteDialect } from '@soapbox/kysely-pglite';
|
||||||
import { Kysely } from 'kysely';
|
import { Kysely } from 'kysely';
|
||||||
|
|
||||||
|
|
@ -10,7 +11,7 @@ export class DittoPglite {
|
||||||
static create(databaseUrl: string): DittoDatabase {
|
static create(databaseUrl: string): DittoDatabase {
|
||||||
const kysely = new Kysely<DittoTables>({
|
const kysely = new Kysely<DittoTables>({
|
||||||
dialect: new PgliteDialect({
|
dialect: new PgliteDialect({
|
||||||
database: new PGlite(databaseUrl),
|
database: new PGlite(databaseUrl, { extensions: { pg_trgm } }),
|
||||||
}),
|
}),
|
||||||
log: KyselyLogger,
|
log: KyselyLogger,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue