prisma-pglite - v1.0.1
    Preparing search index...

    Function createPgliteAdapter

    • Creates a PGlite adapter than can be used with the PrismaClient constructor. This will create a new PGlite database on your file system, if one does not already exist, and push your schema to it (similar to prisma db push). This cannot, however, push new migrations to an existing PGlite database (as prisma db push does with a normal Postgres database).

      Ensure that you have the "driverAdapters" preview feature enabled in your Prisma schema.

      Parameters

      Returns Promise<PrismaPgliteAdapter>

      Usage in TypeScript:

      import {PrismaClient} from '@prisma/client';
      import {createPgliteAdapter} from 'prisma-pglite';

      const prismaClient = new PrismaClient({
      adapter: await createPgliteAdapter({
      schemaFilePath,
      }),
      });

      Requirement in schema.prisma:

      generator jsClient {
      provider = "prisma-client-js"
      previewFeatures = ["strictUndefinedChecks", "driverAdapters"]
      }