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

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