Replies: 8 comments 15 replies
-
|
Thank you. I've decided - let's do it! We can start promoting sea-query to 1.0 rc and then merge in all the breaking changes, |
Beta Was this translation helpful? Give feedback.
-
|
https://docs.rs/sea-orm/latest/sea_orm/query/trait.QuerySelect.html#method.join_as We should also make such methods as generic as possible. |
Beta Was this translation helpful? Give feedback.
-
|
As mentioned in #2615, I think it would be better if these methods returned a Result instead of panic. |
Beta Was this translation helpful? Give feedback.
-
|
As mentioned in #2614, I suggest removing the delete method on ModelTrait and instead adding the following implementation: impl<T> ModelTrait for &T
where
T: ModelTraitThis helped to reduce a lot of redundant code and simplified the features I planned to add next. For example, instead of having to implement: impl LoaderTrait for &[Option<ModelTrait>];
impl LoaderTrait for Vec<Option<ModelTrait>>;
impl LoaderTrait for Vec<Option<&ModelTrait>>;
impl LoaderTrait for [&Option<ModelTrait>];We can just write: impl LoaderTrait for Vec<Option<ModelTrait>>;
impl LoaderTrait for &[Option<ModelTrait>]; |
Beta Was this translation helpful? Give feedback.
-
|
@Expurple shall we use |
Beta Was this translation helpful? Give feedback.
-
|
I think the current Model, ActionModal and Entity are a little bit confusing.
I seggest
|
Beta Was this translation helpful? Give feedback.
-
|
One breaking change that I would like to see is to use a separate newtype(i32) (created by the DeriveEntityModel) for each table's PK. In this way, an id for a table can only be used as the PK for that table (or appropriate FK in another table), to further reduce the chance for bugs. |
Beta Was this translation helpful? Give feedback.
-
|
Any thoughts on removing with-prelude from the CLI? I found it unintuitive and inconsistent from the moment I first started using it, and it made the learning curve steeper: In other languages, entity classes typically include the functionality of our Entity, Model, and ActiveModel, and I’ve seen several users get confused when the Entity couldn’t do what they expected. Also, regardless of how things are generated, you still have to use table::{Model, ActiveModel} when working with other structs. |
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.
-
Breaking changes that I want to see in SeaORM 2.0.
Reuse
ExprTraitwhere it makes senseBackground and motivation
Make
ActiveEnum: Into<SimpleExpr>ExprTrait#2606 (comment)Delete "operator" methods from
ColumnTrait, makeColumnTrait: Into<SimpleExpr>We won't be able to write a blanket
Because there's already a very meaningful blanket
So, we'll have to use supertraits to achieve a similar effect. I think, we should have
ColumnTrait: Into<SimpleExpr>. This makes sense on its own, and also makesColumnTraitautomatically implementExprTrait(via the existing blanket impl above).Method signatures and compatibility
The current "operator" methods on
ColumnTraitaccept(&Self, Into<Value>), butExprTraitmethods accept(Self, Into<SimpleExpr>). I think, the latter is correct (see #771 as to why). But these differences may cause implementation trouble for us and migration trouble for the users. I need to experiment and see how it goes.Automatically qualify columns
We should try to implement these methods such that
foo::Column::Bar.equals(foo::Column::Baz)automatically includes the table name in the generated SQL:foo.bar = foo.baz. See SeaQL/sea-query#681.Remove
Into*traits in favor ofFrom/IntoTryIntoModelthat should be replaced withTryFrom/TryInto.To keep some backwards-compatibility, we can make
IntoFoo: Into<Foo>and blanketimpl IntoFoo for T where T: Into<Foo>, instead of removing these traits outright. However, I'd still replace allIntoFoouses in our APIs withInto<Foo>. And we need to document on everyIntoFoothat it's a legacy trait kept for compatibility. We can deprecate these sometime later in 2.x., to make the 2.0 upgrade less annoying.on_empty_do_nothing()by defaulton_empty_do_nothing() should be enabled by default #2528
DONE: Insert many #2628
Handle bulk inserts above the SQLx parameter limit
Move
oneandallinto a traitMark some enums an
#[non_exhaustive]The motivation is described in SeaQL/sea-query#795.
Which enums:
sea_orm:DatabaseBackend,DatabaseConnection, errors. Adding new variants of these shouldn't be a breaking change.sea_orm_cli. Adding new CLI options shouldn't be a breaking change.sea_orm_codegen. Adding new options or errors shouldn't be a breaking change.Experiment with new
asyncfeaturesasync_trait???Upgrade the public dependencies
sqlx0.9.0 is not released yet, but see Upcoming SQLx Breakage:TransactionManagertrait reexport is being deleted in 0.9.0 #2600 and branch0.9.0-devinsqlx.ipnetwork. Something likecratesVSCode extension can be used to quickly see new major versions of dependencies.Related plans in
sea_queryBeta Was this translation helpful? Give feedback.
All reactions