Skip to content

Conversation

@svetch
Copy link
Contributor

@svetch svetch commented Sep 23, 2025

Summary

This PR introduces db pull support to zenstack_v3, similar to Prisma’s db pull.
The command enables introspection of the database schema and generates corresponding models within the project.

Current Status

  • Initial implementation of db pull command
  • Relation resolving logic
  • Implement diff update on db pull
    • Multi-schema file update(handle schema imports and update model in their schema file)
    • Add/Remove fields on update
    • Add/Remove Models
    • Update field
    • Update model attributes
  • Make all generation option configurable from cli
    • Option to always add @map for fields/models
    • Name casing strategy
    • quote, indent
  • improve logging
  • Handle the database type mapping per database provider(@db.\<Raw databse type\>, ie: @db.Real)
  • Need to determine the best approach for testing

Notes

  • I appreciate any feedback, suggestions, or requests for changes 🙏

@coderabbitai
Copy link

coderabbitai bot commented Sep 23, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@svetch svetch force-pushed the main branch 2 times, most recently from 85bbb6e to 08006cf Compare October 22, 2025 20:13
@ymc9
Copy link
Member

ymc9 commented Oct 24, 2025

Just a heads up, I'm renaming "@zenstackhq/runtime" package to "@zenstackhq/orm".

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.

3 participants