Skip to content

Make generated db:generate use PGlite by default#46

Open
CyrusAuyeung wants to merge 1 commit into
seveibar:mainfrom
CyrusAuyeung:fix-db-generate-pglite-default
Open

Make generated db:generate use PGlite by default#46
CyrusAuyeung wants to merge 1 commit into
seveibar:mainfrom
CyrusAuyeung:fix-db-generate-pglite-default

Conversation

@CyrusAuyeung

Copy link
Copy Markdown

Summary

  • Make pgstrap init scaffold db:generate as pgstrap generate --pglite, so generated projects can run bun run db:generate without a local Postgres server.
  • Add db:generate:postgres as an explicit script for the original real-Postgres generation path.
  • Update the init test and README script docs.

Why this shape

@seveibar I noticed a few existing attempts for this issue. This keeps the CLI default unchanged to avoid surprising existing pgstrap generate users, while making newly initialized projects satisfy #2 out of the box. It also preserves the Postgres path with a named script instead of changing global generate semantics.

If this smaller approach is the direction you prefer and it gets merged, could this be considered for the Algora bounty on #2?

Verification

  • npm exec --yes bun -- test
    • 3 pass, 0 fail
    • Windows emitted repeated The system cannot find the path specified. messages from the migration tooling, but the test process exited successfully.
  • npm exec --yes bun -- run build
  • npm exec --yes bun -- x biome format README.md src/init.ts tests/init.test.ts
  • git diff --check

Fixes #2

@algora-pbc /claim #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