Skip to content

Add support for Neon database in db-setup and update dependencies #339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 25, 2025

Conversation

bibblebabl
Copy link
Contributor

@bibblebabl bibblebabl commented Jun 21, 2025

Summary by CodeRabbit

  • New Features

    • Added support for Neon database integration in the database setup process, including conditional dependency installation and configuration.
    • Enhanced template files to enable Neon-specific setup for both Node/Bun and Cloudflare Workers environments.
  • Chores

    • Updated dependency mappings to include the Neon database package.

Copy link

changeset-bot bot commented Jun 21, 2025

🦋 Changeset detected

Latest commit: 2444ad6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-better-t-stack Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

coderabbitai bot commented Jun 21, 2025

Walkthrough

This change adds support for the Neon database in the CLI's database setup process. It updates dependency management, modifies the setup logic for the "drizzle" ORM to handle Neon-specific dependencies, and adapts the Drizzle Postgres template to conditionally initialize connections using the Neon client when appropriate.

Changes

File(s) Change Summary
apps/cli/src/constants.ts Added @neondatabase/serverless to the dependencyVersionMap.
apps/cli/src/helpers/setup/db-setup.ts Updated dependency installation logic to handle Neon-specific setup for Drizzle/Postgres projects.
apps/cli/templates/db/drizzle/postgres/src/db/index.ts.hbs Modified template to conditionally initialize Drizzle ORM with Neon client when dbSetup is "neon".
.changeset/large-lizards-write.md Added a changeset describing Neon database support integration.

Sequence Diagram(s)

Loading
sequenceDiagram
    participant User
    participant CLI
    participant Template
    participant NPM

    User->>CLI: Initiate database setup (Drizzle/Postgres)
    CLI->>CLI: Check dbSetup value
    alt dbSetup is "neon"
        CLI->>NPM: Install drizzle-orm, @neondatabase/serverless, drizzle-kit
        CLI->>Template: Generate index.ts.hbs with Neon client logic
    else dbSetup is default
        CLI->>NPM: Install drizzle-orm, pg, drizzle-kit, @types/pg
        CLI->>Template: Generate index.ts.hbs with pg client logic
    end
    CLI->>User: Setup complete

Possibly related PRs

Poem

In the land of code where databases grow,
Neon lights now join the show!
Drizzle adapts, dependencies align,
Templates check the setup sign.
With every hop, the CLI is keen—
Now Postgres and Neon, both fit the scene!
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

pkg-pr-new bot commented Jun 21, 2025

Open in StackBlitz

npx https://pkg.pr.new/AmanVarshney01/create-better-t-stack@339

commit: 2444ad6

@AmanVarshney01
Copy link
Owner

AmanVarshney01 commented Jun 24, 2025

i have already updated the deps @bibblebabl

sync it

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.changeset/large-lizards-write.md (1)

5-5: Consider elaborating the summary for clearer release notes

A one-line description is OK, but adding one or two extra sentences detailing what “Add support for Neon database in db-setup” entails (e.g., new dependencies, conditional logic, template changes) will make the generated changelog more informative for consumers.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 721a16a and 2444ad6.

📒 Files selected for processing (1)
  • .changeset/large-lizards-write.md (1 hunks)
🔇 Additional comments (1)
.changeset/large-lizards-write.md (1)

1-3: Validate that the correct package(s) are targeted in the changeset header

Only "create-better-t-stack" is listed. If the Neon-support work touched other publishable packages (e.g. the CLI, shared utilities, or any internal libs), they must be enumerated here as well; otherwise those packages will not receive a version bump when the changeset is applied.
Please confirm that no additional packages require inclusion.

@AmanVarshney01 AmanVarshney01 merged commit 32275d3 into AmanVarshney01:main Jun 25, 2025
3 checks passed
@AmanVarshney01
Copy link
Owner

AmanVarshney01 commented Jun 25, 2025

Thanks @bibblebabl

I have removed the database healthcheck I'll add it a bit differently later

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.

2 participants