Skip to content

feat(cca): Neon Postgres#1503

Merged
Tobbe merged 6 commits intomainfrom
tobbe-feat-db-neon
Apr 2, 2026
Merged

feat(cca): Neon Postgres#1503
Tobbe merged 6 commits intomainfrom
tobbe-feat-db-neon

Conversation

@Tobbe
Copy link
Copy Markdown
Member

@Tobbe Tobbe commented Apr 1, 2026

Optionally give the user a Neon database as part of creating a Cedar app

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 1, 2026

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 0513b75
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/69ce1a930ae1990008859c08

@github-actions github-actions Bot added this to the next-release milestone Apr 1, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 1, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 0513b75

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 2s View ↗
nx run-many -t build ✅ Succeeded 8s View ↗
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 4s View ↗
nx run-many -t test:types ✅ Succeeded 11s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-02 07:52:10 UTC

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 1, 2026

Greptile Summary

This PR adds an optional Neon Postgres database to create-cedar-app via a new --db neon-postgres flag (requires --esm). The previous blocking issues — missing ESM guard, broken path resolution, silent {{DATABASE_URL}} placeholder, and invalid CLI validation — are all resolved in this revision.

Confidence Score: 5/5

  • Safe to merge; all previously blocking issues are resolved and only minor P2 suggestions remain.
  • All P0/P1 concerns from prior review rounds are addressed: the CLI validation now correctly accepts neon-postgres, the ESM guard is in place, the fetch error path now throws on non-2xx responses, and the broken prismaVersion() path is replaced with a hardcoded constant. The two remaining findings are P2 style suggestions (hardcoded ref and pinned version without caret).
  • No files require special attention.

Important Files Changed

Filename Overview
packages/create-cedar-app/src/project-files.ts Core logic for neon-postgres overlay: fetches a Neon DB, writes connection string into .env.defaults via placeholder replacement; error path leaves DATABASE_URL empty (user is warned); ref is hardcoded to 'cedarjs'.
packages/create-cedar-app/src/handle-args.ts Adds handleDatabasePreference() with validation and ESM guard for neon-postgres; addresses the previously flagged missing ESM guard.
packages/create-cedar-app/database-overlays/neon-postgres/api/src/lib/db.ts New db.ts using PrismaPg adapter; guards against missing DATABASE_URL at startup and re-exports from the generated client.
packages/create-cedar-app/database-overlays/pglite/api/package.json Switches @prisma/adapter-pg from hardcoded ^7.5.0 to the {{PRISMA_VERSION}} placeholder, which resolves to 7.6.0 (no caret) at scaffolding time — removing patch-version flexibility for new pglite projects.

Reviews (5): Last reviewed commit: "improve messaging and error handling" | Re-trigger Greptile

Comment thread packages/create-cedar-app/src/handle-args.ts Outdated
Comment thread packages/create-cedar-app/src/project-files.ts Outdated
Comment thread packages/create-cedar-app/src/project-files.ts
Comment thread packages/create-cedar-app/src/project-files.ts Outdated
Comment thread packages/create-cedar-app/src/handle-args.ts
@Tobbe Tobbe enabled auto-merge (squash) April 2, 2026 07:40
@Tobbe Tobbe merged commit 6f3f13d into main Apr 2, 2026
44 checks passed
@Tobbe Tobbe deleted the tobbe-feat-db-neon branch April 2, 2026 07:51
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

The changes in this PR are now available on npm.

Try them out by running yarn cedar upgrade -t 4.0.0-canary.13719

Or try it in a new app with yarn dlx create-cedar-app@4.0.0-canary.13719

Tobbe added a commit that referenced this pull request Apr 10, 2026
@Tobbe Tobbe modified the milestones: next-release, v4.0.0 Apr 12, 2026
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.

1 participant