Replies: 12 comments 23 replies
-
|
Put this here as well #688 : use identity column by default for postgres |
Beta Was this translation helpful? Give feedback.
-
|
@Expurple feel free to start opening PRs for the breaking changes wanted now. |
Beta Was this translation helpful? Give feedback.
-
|
List of Into*
|
Beta Was this translation helpful? Give feedback.
-
|
Implemented unification of |
Beta Was this translation helpful? Give feedback.
-
|
I noticed that |
Beta Was this translation helpful? Give feedback.
-
|
I don't understand why assert_ne!(
ColumnRef::Column(Character::Id.into_iden()),
ColumnRef::Column("id".into_iden())
);
assert_ne!(
ColumnRef::Column(Character::Id.into_iden()),
ColumnRef::Column(Font::Id.into_iden())
);
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Merge Func/Function and PgFunc/PgFunction.The former is just a static method namespace for function construction |
Beta Was this translation helpful? Give feedback.
-
|
Should we wrap enums (like I assume no one is actually using the internal variants of Value, right? Most people just pass them as parameters to SQL statements. |
Beta Was this translation helpful? Give feedback.
-
|
How about make |
Beta Was this translation helpful? Give feedback.
-
|
Maybe it's too late to discuss this, but I’ve noticed the issue of ColumnSpec. It’s an enum, but its variants aren’t exclusive—they can coexist in the same Vec. This makes it easy to generate invalid SQL during serialization, which can lead to the following issues: SeaQL/sea-orm#2652 pub enum ColumnSpec {
Null,
NotNull,
Default(Expr),
AutoIncrement,
UniqueKey,
PrimaryKey,
Check(Check),
Generated { expr: Expr, stored: bool },
Extra(String),
Comment(String),
Using(Expr),
}
pub struct ColumnDef {
pub(crate) table: Option<TableRef>,
pub(crate) name: DynIden,
pub(crate) types: Option<ColumnType>,
pub(crate) spec: Vec<ColumnSpec>,
}
fn prepare_column_spec(&self, column_spec: &ColumnSpec, sql: &mut dyn SqlWriter) {
match column_spec {
ColumnSpec::Null => write!(sql, "NULL").unwrap(),
ColumnSpec::NotNull => write!(sql, "NOT NULL").unwrap(),
ColumnSpec::Default(value) => {
write!(sql, "DEFAULT ").unwrap();
QueryBuilder::prepare_simple_expr(self, value, sql);
}
ColumnSpec::AutoIncrement => {
write!(sql, "{}", self.column_spec_auto_increment_keyword()).unwrap()
}
ColumnSpec::UniqueKey => write!(sql, "UNIQUE").unwrap(),
ColumnSpec::PrimaryKey => write!(sql, "PRIMARY KEY").unwrap(),
ColumnSpec::Check(check) => self.prepare_check_constraint(check, sql),
ColumnSpec::Generated { expr, stored } => {
self.prepare_generated_column(expr, *stored, sql)
}
ColumnSpec::Extra(string) => write!(sql, "{string}").unwrap(),
ColumnSpec::Comment(comment) => self.column_comment(comment, sql),
ColumnSpec::Using(_) => {}
}
} |
Beta Was this translation helpful? Give feedback.
-
|
Only mysql support comment in create table statement. |
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.
-
As discussed here, I won't be able to release everything I want in SeaORM 1.0. So, I need to track my wishlist somewhere. I also need a URL to include in the TODOs in the code. This is the place.
Cleanups around
ExprTraitBackground
ExprTrait(#771) #791My plans
ExprandSimpleExprwhich have been copied toExprTraitand now just call the implementation from the trait.SimpleExprmethods that duplicateExprTrait#890use sea_query::ExprTrait.impl SqliteExprblocks with a single widerimpl<T> SqliteExpr for T where T: ExprTrait {}.impl PgExprblocks with a single widerimpl<T> PgExpr for T where T: ExprTrait {}.ExprandSimpleExprinto one type.So far it seems to me that
Exprshouldn't be a type. It's mostly just a namespace for staticSimpleExprconsructors. The type only confuses everyone. It's not meant for passing around, but I still have such instances in my codebase, with confusing conversions betweenSimpleExprandExpr, etc.I imagine moving these constructors into
SimpleExpr, and then we canpub type Expr = SimpleExprfor compatibility. But it's still a breaking change, because implementing the same trait forExprandSimpleExprbecomes illegal (two implementations for one type).DONE: Unify
ExprandSimpleExpras one type #889Perhaps, the same reasoning also applies to
Func,PgFunc,TypeandTable, and we should remove these types too. Although, in practice, these haven't been a problem in my codebase. And unlikeExpr, these are unit types with obviously no data attached. That's probably why I don't pass these around and there's no confusion.Allow schema-qualified enums in
cast_as_quotedcast_as_quoted#827DONE: #922
Into*traitsInto*traits in favor ofFrom/Into.impl IntoFoo for T where T: Into<Foo>instead of removing these traits outright.DONE:
IntoTableRefinto a sub trait ofInto<TableRef>#958IntoColumnRefinto a sub trait ofInto<ColumnRef>#959IntoValueTupleinto a sub trait ofInto<ValueTuple>#960TypeRefandTypeName, updateIntoTypeRef#969IntoIdeninto a sub trait ofInto<Iden>#973IntoLikeExprinto a sub trait ofInto<LikeExpr>#974IntoColumnDefinto a sub trait ofInto<ColumnDef>#975IntoIndexColumninto a sub trait ofInto<IndexColumn>#976Related: #905
Mark more enums as
#[non_exhaustive]#[non_exhaustive]. Specifically, enums that correspond to SQL features / types / functions.It's impossible to exhaustively list these, because databases always keep gaining new features. Adding a new variant shouldn't be a breaking change. See #828 (comment) for an example of an SQL feature that can't be merged without a major release.
DONE: #891
Stop using deprecated
SERIALcolumn typeReconsider boxing the variants of
ValueExperiment with deleting
ConditionHolder(Contents)See this thread: #795 (reply in thread)
ConditionHolderandConditionHolderContentsinto one type (ConditionHolder).Condition.Experiment with deleting / hiding
ConditionExpressionIt seems like some weird implementation detail for conversions, that shouldn't be public. Maybe it was created as a workaround when
Conditionwasn'tInto<SimpleExpr>. But now it is: Conversions fromConditionandConditionExpressionintoSimpleExpr#886. So, now we can try to deleteConditionExpression, or make it private, or at least make it#[doc(hidden)](if we can make only macros use it). If we won't be able to, then at least we'll learn and document why this type is needed.DONE: Make
ConditionExpressionprivate #915Experiment with turning
Identrait into a structUpgrade the public dependencies
sqlxandipnetwork. Something likecratesVSCode extension can be used to quickly see new major versions of dependencies.Related plans in
sea_ormBeta Was this translation helpful? Give feedback.
All reactions