Idea/proposal for idempotent rust-defined database structure #1663
Replies: 3 comments 3 replies
-
|
I agree with your points, and I am aware of the difference between "Entity first" sv "Schema first" approaches. I am keen to support the "entity first" approach. What needs to be done are:
If you are interested in working on any part of it, we can have more discussions on the design and implementation. |
Beta Was this translation helpful? Give feedback.
-
|
Note to self: we have had some disscussions in Discord https://discord.com/channels/873880840487206962/901137465916657714/1110189907550408815 and what's outstanding is how'd we integrate that into the current cli / migration infrastructure. |
Beta Was this translation helpful? Give feedback.
-
|
Schema sync has been implemented in 2.0. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This may be out of scope for this ORM, but I had an idea:
Some problems with the current architecture
derive, andserde(skip)columns, but what about other column attributes?What if instead of writing migrations, and generating
.rsfiles based on the database schema we instead defined the structure of tables in rust (generatingTableDefs)Taking inspiration from sqldef's idempotent schema management:
DROPandCREATEoperationsTake this use case
Using sea-schema, we could generate a TableDef from this struct, and then use the
discoverymodule of sea-schema to get the current database'sTableDef, generate a diff and apply the individual changes to get the database to the desired rust-defined state with thewritermoduleBenefits
Beta Was this translation helpful? Give feedback.
All reactions