Skip to content

fix: default db:generate scaffold to --pglite#29

Open
zigzag-dev26 wants to merge 1 commit into
seveibar:mainfrom
zigzag-dev26:feat/db-generate-default-pglite
Open

fix: default db:generate scaffold to --pglite#29
zigzag-dev26 wants to merge 1 commit into
seveibar:mainfrom
zigzag-dev26:feat/db-generate-default-pglite

Conversation

@zigzag-dev26
Copy link
Copy Markdown

Closes #2

Summary

The pgstrap init scaffold currently writes db:generate -> "pgstrap generate" to package.json, which requires a running Postgres to succeed. That makes the very first bun run db:generate after init fail unless the user already has Postgres set up — defeating the purpose of the scaffold.

Flipping the default to pgstrap generate --pglite lets new projects run bun run db:generate immediately after init with zero external dependencies. The --pglite flag is already supported by the CLI (src/cli.ts:38) and runs against an in-memory PGlite instance, which is already a project dependency. README.md line 58 already documents this exact invocation.

Diff

Net change: +2 / -2, two files.

  • src/init.ts — switch the scaffolded script from pgstrap generate to pgstrap generate --pglite
  • tests/init.test.ts — update the assertion to match

No new dependencies, no behavior change for existing projects (only affects the scaffold output of pgstrap init).

Verification

bun test
bun run format:check
bun run build

@algora-pbc /claim #2

Closes seveibar#2

The `pgstrap init` scaffold currently writes
`db:generate -> "pgstrap generate"`, which requires a running Postgres
to succeed. Flipping the default to `pgstrap generate --pglite` lets
new projects run `bun run db:generate` straight after init with zero
external dependencies (the `--pglite` flag is already supported by the
CLI and runs against an in-memory PGlite instance, as documented in
README.md).

Net change: +2 / -2 across `src/init.ts` and `tests/init.test.ts`.

@algora-pbc /claim seveibar#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use pglite so that postgres isn't required when generating types

1 participant