Generate plain domain models without SeaORM-specific code (Hexagonal Architecture Context) #2533
Unanswered
spacecodeur
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am currently working on a personal project to learn Rust. In this project, I am building a web application backend using SeaORM. I am trying to implement a hexagonal architecture, with two main folders: domain and infrastructure.
I’m not an expert in hexagonal architecture, but here is how I understand the responsibilities of these two parts:
The reason for my question is the following:
When I run sea-orm-cli generate entity, I get entities that are tightly coupled with SeaORM (with traits like DeriveEntityModel, ActiveModelBehavior, and annotations like #[sea_orm(...)]).
For example, the generated code looks like this:
What I would like is to automatically generate a corresponding domain file, without any SeaORM-specific code, looking something like this:
n other words: I’d like to generate plain Rust structures and enums matching the entities, but without SeaORM attributes or traits.
I’ve checked the documentation and couldn’t find any option or flag to achieve this.
Is there already a way to do this with SeaORM, or is there any tool/feature planned that could help with this use case?
Thank you very much for your help!
Beta Was this translation helpful? Give feedback.
All reactions