From 9e74f11cda2832c1d59d30938648788b5ec037e1 Mon Sep 17 00:00:00 2001 From: joaogscardoso82-max Date: Thu, 19 Mar 2026 19:12:01 +0000 Subject: [PATCH] feat: default to PGlite for type generation `pgstrap generate` now uses PGlite by default, so a running Postgres instance is no longer required for type generation. Users who need a real Postgres connection can pass `--no-pglite`. Closes #2 Co-Authored-By: Claude Opus 4.6 --- README.md | 2 +- src/cli.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 20e3127..da1e6bd 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ npm install pgstrap --save-dev - `npm run db:migrate` - Run pending migrations - `npm run db:reset` - Drop and recreate the database, then run all migrations -- `npm run db:generate` - Generate types and structure dumps. Use `pgstrap generate --pglite` to run migrations against an in-memory PGlite instance. +- `npm run db:generate` - Generate types and structure dumps. Uses an in-memory PGlite instance by default — no running Postgres required. Use `pgstrap generate --no-pglite` to use a real Postgres connection instead. - `npm run db:create-migration` - Create a new migration file ### Configuration diff --git a/src/cli.ts b/src/cli.ts index 9a9bdec..68f5baf 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -35,7 +35,7 @@ import { getProjectContext } from "./get-project-context" "generate", "generate types and sql documentation from database", (yargs) => { - yargs.option("pglite", { type: "boolean", default: false }) + yargs.option("pglite", { type: "boolean", default: true }) }, async (argv) => { generate({ ...(await getProjectContext()), pglite: !!argv.pglite })