From 0e4bbffaa3e5fbddf310983ce59b641ee34efd13 Mon Sep 17 00:00:00 2001 From: Huliiiii <134658521+Huliiiiii@users.noreply.github.com> Date: Sun, 25 May 2025 20:09:22 +0800 Subject: [PATCH 01/18] Fix --- Cargo.toml | 4 ++-- src/query/combine.rs | 2 ++ src/query/helper.rs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 02153ac62c..8ad62efd27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -107,5 +107,5 @@ tests-cfg = ["serde/derive"] seaography = ["sea-orm-macros/seaography"] # This allows us to develop using a local version of sea-query -# [patch.crates-io] -# sea-query = { path = "../sea-query" } +[patch.crates-io] +sea-query = { git = "https://github.com/Huliiiiii/sea-query.git", branch = "expr-3" } diff --git a/src/query/combine.rs b/src/query/combine.rs index 917ec24ebf..888896538f 100644 --- a/src/query/combine.rs +++ b/src/query/combine.rs @@ -49,6 +49,7 @@ where ColumnRef::Asterisk | ColumnRef::TableAsterisk(_) => { panic!("cannot apply alias for Column with asterisk") } + _ => unreachable!(), }, SimpleExpr::AsEnum(_, simple_expr) => match simple_expr.as_ref() { SimpleExpr::Column(col_ref) => match &col_ref { @@ -58,6 +59,7 @@ where ColumnRef::Asterisk | ColumnRef::TableAsterisk(_) => { panic!("cannot apply alias for AsEnum with asterisk") } + _ => unreachable!(), }, _ => { panic!("cannot apply alias for AsEnum with expr other than Column") diff --git a/src/query/helper.rs b/src/query/helper.rs index 0bba5461e2..ebbcb1f94d 100644 --- a/src/query/helper.rs +++ b/src/query/helper.rs @@ -886,6 +886,7 @@ pub(crate) fn unpack_table_ref(table_ref: &TableRef) -> DynIden { | TableRef::SubQuery(_, tbl) | TableRef::ValuesList(_, tbl) | TableRef::FunctionCall(_, tbl) => SeaRc::clone(tbl), + _ => unreachable!(), } } @@ -900,5 +901,6 @@ pub(crate) fn unpack_table_alias(table_ref: &TableRef) -> Option { | TableRef::SchemaTableAlias(_, _, alias) | TableRef::DatabaseSchemaTableAlias(_, _, _, alias) | TableRef::FunctionCall(_, alias) => Some(SeaRc::clone(alias)), + _ => unreachable!(), } } From 6e8a0600bb9b3a9dfebc1b8542a37166afb10580 Mon Sep 17 00:00:00 2001 From: Huliiiii <134658521+Huliiiiii@users.noreply.github.com> Date: Sun, 25 May 2025 21:27:55 +0800 Subject: [PATCH 02/18] Fix --- sea-orm-codegen/src/entity/relation.rs | 1 + sea-orm-codegen/src/util.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/sea-orm-codegen/src/entity/relation.rs b/sea-orm-codegen/src/entity/relation.rs index 8f3ef21702..1c30312a4b 100644 --- a/sea-orm-codegen/src/entity/relation.rs +++ b/sea-orm-codegen/src/entity/relation.rs @@ -181,6 +181,7 @@ impl Relation { ForeignKeyAction::SetNull => "SetNull", ForeignKeyAction::NoAction => "NoAction", ForeignKeyAction::SetDefault => "SetDefault", + _ => todo!(), } .to_owned() } diff --git a/sea-orm-codegen/src/util.rs b/sea-orm-codegen/src/util.rs index 7005b19d02..4fbfc5c99c 100644 --- a/sea-orm-codegen/src/util.rs +++ b/sea-orm-codegen/src/util.rs @@ -35,5 +35,6 @@ pub(crate) fn unpack_table_ref(table_ref: &TableRef) -> String { | TableRef::SubQuery(_, tbl) | TableRef::ValuesList(_, tbl) | TableRef::FunctionCall(_, tbl) => tbl.to_string(), + _ => todo!(), } } From 45f4c9757479badeedacfeca03dd749c859b1d30 Mon Sep 17 00:00:00 2001 From: Huliiiii <134658521+Huliiiiii@users.noreply.github.com> Date: Fri, 30 May 2025 04:44:14 +0800 Subject: [PATCH 03/18] Use sea-query's helpers --- sea-orm-codegen/src/entity/relation.rs | 13 ++------- sea-orm-codegen/src/entity/transformer.rs | 6 ++--- sea-orm-codegen/src/util.rs | 17 ------------ src/entity/link.rs | 6 ++--- src/entity/relation.rs | 23 ++++++++-------- src/query/combine.rs | 22 ++++++---------- src/query/helper.rs | 32 +---------------------- src/query/join.rs | 8 +++--- 8 files changed, 31 insertions(+), 96 deletions(-) diff --git a/sea-orm-codegen/src/entity/relation.rs b/sea-orm-codegen/src/entity/relation.rs index 1c30312a4b..b77a945595 100644 --- a/sea-orm-codegen/src/entity/relation.rs +++ b/sea-orm-codegen/src/entity/relation.rs @@ -1,4 +1,3 @@ -use crate::util::unpack_table_ref; use heck::{ToSnakeCase, ToUpperCamelCase}; use proc_macro2::{Ident, TokenStream}; use quote::{format_ident, quote}; @@ -175,15 +174,7 @@ impl Relation { } pub fn get_foreign_key_action(action: &ForeignKeyAction) -> String { - match action { - ForeignKeyAction::Restrict => "Restrict", - ForeignKeyAction::Cascade => "Cascade", - ForeignKeyAction::SetNull => "SetNull", - ForeignKeyAction::NoAction => "NoAction", - ForeignKeyAction::SetDefault => "SetDefault", - _ => todo!(), - } - .to_owned() + action.variant_name().to_owned() } pub fn get_src_ref_columns( @@ -220,7 +211,7 @@ impl Relation { impl From<&TableForeignKey> for Relation { fn from(tbl_fk: &TableForeignKey) -> Self { let ref_table = match tbl_fk.get_ref_table() { - Some(s) => unpack_table_ref(s), + Some(s) => s.table().to_string(), None => panic!("RefTable should not be empty"), }; let columns = tbl_fk.get_columns(); diff --git a/sea-orm-codegen/src/entity/transformer.rs b/sea-orm-codegen/src/entity/transformer.rs index 6f0654ed36..1775da0932 100644 --- a/sea-orm-codegen/src/entity/transformer.rs +++ b/sea-orm-codegen/src/entity/transformer.rs @@ -1,6 +1,6 @@ use crate::{ - util::unpack_table_ref, ActiveEnum, Column, ConjunctRelation, Entity, EntityWriter, Error, - PrimaryKey, Relation, RelationType, + ActiveEnum, Column, ConjunctRelation, Entity, EntityWriter, Error, PrimaryKey, Relation, + RelationType, }; use sea_query::{ColumnSpec, TableCreateStatement}; use std::collections::{BTreeMap, HashMap}; @@ -76,7 +76,7 @@ impl EntityTransformer { .iter() .map(|fk_create_stmt| fk_create_stmt.get_foreign_key()) .map(|tbl_fk| { - let ref_tbl = unpack_table_ref(tbl_fk.get_ref_table().unwrap()); + let ref_tbl = tbl_fk.get_ref_table().unwrap().table().to_string(); if let Some(count) = ref_table_counts.get_mut(&ref_tbl) { if *count == 0 { *count = 1; diff --git a/sea-orm-codegen/src/util.rs b/sea-orm-codegen/src/util.rs index 4fbfc5c99c..46e7b9853f 100644 --- a/sea-orm-codegen/src/util.rs +++ b/sea-orm-codegen/src/util.rs @@ -1,5 +1,3 @@ -use sea_query::TableRef; - pub(crate) fn escape_rust_keyword(string: T) -> String where T: ToString, @@ -23,18 +21,3 @@ pub(crate) const RUST_KEYWORDS: [&str; 49] = [ ]; pub(crate) const RUST_SPECIAL_KEYWORDS: [&str; 3] = ["crate", "Self", "self"]; - -pub(crate) fn unpack_table_ref(table_ref: &TableRef) -> String { - match table_ref { - TableRef::Table(tbl) - | TableRef::SchemaTable(_, tbl) - | TableRef::DatabaseSchemaTable(_, _, tbl) - | TableRef::TableAlias(tbl, _) - | TableRef::SchemaTableAlias(_, tbl, _) - | TableRef::DatabaseSchemaTableAlias(_, _, tbl, _) - | TableRef::SubQuery(_, tbl) - | TableRef::ValuesList(_, tbl) - | TableRef::FunctionCall(_, tbl) => tbl.to_string(), - _ => todo!(), - } -} diff --git a/src/entity/link.rs b/src/entity/link.rs index df30c82200..c1cbc2a628 100644 --- a/src/entity/link.rs +++ b/src/entity/link.rs @@ -1,6 +1,4 @@ -use crate::{ - join_tbl_on_condition, unpack_table_ref, EntityTrait, QuerySelect, RelationDef, Select, -}; +use crate::{join_tbl_on_condition, EntityTrait, QuerySelect, RelationDef, Select}; use sea_query::{Alias, Condition, IntoIden, JoinType, SeaRc}; /// Same as [RelationDef] @@ -25,7 +23,7 @@ pub trait Linked { let to_tbl = if i > 0 { Alias::new(format!("r{}", i - 1)).into_iden() } else { - unpack_table_ref(&rel.to_tbl) + rel.to_tbl.table().clone() }; let table_ref = rel.from_tbl; diff --git a/src/entity/relation.rs b/src/entity/relation.rs index 14160d0890..9c6a380a80 100644 --- a/src/entity/relation.rs +++ b/src/entity/relation.rs @@ -1,6 +1,5 @@ use crate::{ - join_tbl_on_condition, unpack_table_alias, unpack_table_ref, EntityTrait, Identity, IdentityOf, - Iterable, QuerySelect, Select, + join_tbl_on_condition, EntityTrait, Identity, IdentityOf, Iterable, QuerySelect, Select, }; use core::marker::PhantomData; use sea_query::{ @@ -140,13 +139,13 @@ fn debug_on_condition( impl IntoCondition for RelationDef { fn into_condition(mut self) -> Condition { // Use table alias (if any) to construct the join condition - let from_tbl = match unpack_table_alias(&self.from_tbl) { + let from_tbl = match self.from_tbl.table_alias() { Some(alias) => alias, - None => unpack_table_ref(&self.from_tbl), + None => &self.from_tbl.table(), }; - let to_tbl = match unpack_table_alias(&self.to_tbl) { + let to_tbl = match self.to_tbl.table_alias() { Some(alias) => alias, - None => unpack_table_ref(&self.to_tbl), + None => &self.to_tbl.table(), }; let owner_keys = self.from_col; let foreign_keys = self.to_col; @@ -163,7 +162,7 @@ impl IntoCondition for RelationDef { foreign_keys, )); if let Some(f) = self.on_condition.take() { - condition = condition.add(f(from_tbl, to_tbl)); + condition = condition.add(f(from_tbl.clone(), to_tbl.clone())); } condition @@ -498,7 +497,7 @@ macro_rules! set_foreign_key_stmt { let name = if let Some(name) = $relation.fk_name { name } else { - let from_tbl = unpack_table_ref(&$relation.from_tbl); + let from_tbl = &$relation.from_tbl.table().clone(); format!("fk-{}-{}", from_tbl.to_string(), from_cols.join("-")) }; $foreign_key.name(&name); @@ -510,8 +509,8 @@ impl From for ForeignKeyCreateStatement { let mut foreign_key_stmt = Self::new(); set_foreign_key_stmt!(relation, foreign_key_stmt); foreign_key_stmt - .from_tbl(unpack_table_ref(&relation.from_tbl)) - .to_tbl(unpack_table_ref(&relation.to_tbl)) + .from_tbl(relation.from_tbl.table().clone()) + .to_tbl(relation.to_tbl.table().clone()) .take() } } @@ -548,8 +547,8 @@ impl From for TableForeignKey { let mut foreign_key = Self::new(); set_foreign_key_stmt!(relation, foreign_key); foreign_key - .from_tbl(unpack_table_ref(&relation.from_tbl)) - .to_tbl(unpack_table_ref(&relation.to_tbl)) + .from_tbl(relation.from_tbl.table().clone()) + .to_tbl(relation.to_tbl.table().clone()) .take() } } diff --git a/src/query/combine.rs b/src/query/combine.rs index 888896538f..e1761ed0b5 100644 --- a/src/query/combine.rs +++ b/src/query/combine.rs @@ -3,7 +3,7 @@ use crate::{ SelectTwoMany, }; use core::marker::PhantomData; -use sea_query::{Alias, ColumnRef, Iden, Order, SeaRc, SelectExpr, SelectStatement, SimpleExpr}; +use sea_query::{Alias, Iden, Order, SeaRc, SelectExpr, SelectStatement, SimpleExpr}; macro_rules! select_def { ( $ident: ident, $str: expr ) => { @@ -42,24 +42,18 @@ where } None => { let col = match &sel.expr { - SimpleExpr::Column(col_ref) => match &col_ref { - ColumnRef::Column(col) - | ColumnRef::TableColumn(_, col) - | ColumnRef::SchemaTableColumn(_, _, col) => col, - ColumnRef::Asterisk | ColumnRef::TableAsterisk(_) => { - panic!("cannot apply alias for Column with asterisk") + SimpleExpr::Column(col_ref) => match col_ref.column() { + Some(col) => col, + None => { + panic!("cannot apply alias for Column with asterisk"); } - _ => unreachable!(), }, SimpleExpr::AsEnum(_, simple_expr) => match simple_expr.as_ref() { - SimpleExpr::Column(col_ref) => match &col_ref { - ColumnRef::Column(col) - | ColumnRef::TableColumn(_, col) - | ColumnRef::SchemaTableColumn(_, _, col) => col, - ColumnRef::Asterisk | ColumnRef::TableAsterisk(_) => { + SimpleExpr::Column(col_ref) => match col_ref.column() { + Some(col) => col, + None => { panic!("cannot apply alias for AsEnum with asterisk") } - _ => unreachable!(), }, _ => { panic!("cannot apply alias for AsEnum with expr other than Column") diff --git a/src/query/helper.rs b/src/query/helper.rs index ebbcb1f94d..b229a336cd 100644 --- a/src/query/helper.rs +++ b/src/query/helper.rs @@ -4,7 +4,7 @@ use crate::{ }; use sea_query::{ Alias, Expr, Iden, IntoCondition, IntoIden, LockBehavior, LockType, NullOrdering, SeaRc, - SelectExpr, SelectStatement, SimpleExpr, TableRef, + SelectExpr, SelectStatement, SimpleExpr, }; pub use sea_query::{Condition, ConditionalStatement, DynIden, JoinType, Order, OrderedStatement}; @@ -874,33 +874,3 @@ pub(crate) fn join_tbl_on_condition( } cond } - -pub(crate) fn unpack_table_ref(table_ref: &TableRef) -> DynIden { - match table_ref { - TableRef::Table(tbl) - | TableRef::SchemaTable(_, tbl) - | TableRef::DatabaseSchemaTable(_, _, tbl) - | TableRef::TableAlias(tbl, _) - | TableRef::SchemaTableAlias(_, tbl, _) - | TableRef::DatabaseSchemaTableAlias(_, _, tbl, _) - | TableRef::SubQuery(_, tbl) - | TableRef::ValuesList(_, tbl) - | TableRef::FunctionCall(_, tbl) => SeaRc::clone(tbl), - _ => unreachable!(), - } -} - -pub(crate) fn unpack_table_alias(table_ref: &TableRef) -> Option { - match table_ref { - TableRef::Table(_) - | TableRef::SchemaTable(_, _) - | TableRef::DatabaseSchemaTable(_, _, _) - | TableRef::SubQuery(_, _) - | TableRef::ValuesList(_, _) => None, - TableRef::TableAlias(_, alias) - | TableRef::SchemaTableAlias(_, _, alias) - | TableRef::DatabaseSchemaTableAlias(_, _, _, alias) - | TableRef::FunctionCall(_, alias) => Some(SeaRc::clone(alias)), - _ => unreachable!(), - } -} diff --git a/src/query/join.rs b/src/query/join.rs index ebccef162a..aaef06deb4 100644 --- a/src/query/join.rs +++ b/src/query/join.rs @@ -1,6 +1,6 @@ use crate::{ - join_tbl_on_condition, unpack_table_ref, ColumnTrait, EntityTrait, IdenStatic, Iterable, - Linked, QuerySelect, Related, Select, SelectA, SelectB, SelectThree, SelectTwo, SelectTwoMany, + join_tbl_on_condition, ColumnTrait, EntityTrait, IdenStatic, Iterable, Linked, QuerySelect, + Related, Select, SelectA, SelectB, SelectThree, SelectTwo, SelectTwoMany, }; pub use sea_query::JoinType; use sea_query::{Alias, Condition, Expr, IntoIden, SeaRc, SelectExpr}; @@ -74,7 +74,7 @@ where let from_tbl = if i > 0 { Alias::new(format!("r{}", i - 1)).into_iden() } else { - unpack_table_ref(&rel.from_tbl) + rel.from_tbl.table().clone() }; let table_ref = rel.to_tbl; @@ -120,7 +120,7 @@ where let from_tbl = if i > 0 { Alias::new(format!("r{}", i - 1)).into_iden() } else { - unpack_table_ref(&rel.from_tbl) + rel.from_tbl.table().clone() }; let table_ref = rel.to_tbl; From bbbab43c1cb30f32dc0b4b6e2620b52b1f15ff0a Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 8 Jun 2025 21:20:20 +0100 Subject: [PATCH 04/18] Fix build --- Cargo.toml | 1 + src/entity/active_enum.rs | 2 +- src/entity/column.rs | 4 ++-- src/executor/cursor.rs | 4 ++-- src/query/helper.rs | 4 ++-- src/query/join.rs | 2 +- src/query/loader.rs | 4 +++- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bf2500e79e..253eaefa71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -108,4 +108,5 @@ seaography = ["sea-orm-macros/seaography"] # This allows us to develop using a local version of sea-query [patch.crates-io] +# sea-query = { path = "../sea-query" } sea-query = { git = "https://github.com/SeaQL/sea-query.git", branch = "master" } diff --git a/src/entity/active_enum.rs b/src/entity/active_enum.rs index 9bad2d39bf..9dc3f5df8c 100644 --- a/src/entity/active_enum.rs +++ b/src/entity/active_enum.rs @@ -1,5 +1,5 @@ use crate::{ColIdx, ColumnDef, DbErr, Iterable, QueryResult, TryFromU64, TryGetError, TryGetable}; -use sea_query::{DynIden, Expr, Nullable, SimpleExpr, Value, ValueType}; +use sea_query::{DynIden, Expr, ExprTrait, Nullable, SimpleExpr, Value, ValueType}; /// A Rust representation of enum defined in database. /// diff --git a/src/entity/column.rs b/src/entity/column.rs index 4a36d384fa..7a1eb24a2e 100644 --- a/src/entity/column.rs +++ b/src/entity/column.rs @@ -1,7 +1,7 @@ use crate::{DbBackend, EntityName, Iden, IdenStatic, IntoSimpleExpr, Iterable}; use sea_query::{ - Alias, BinOper, DynIden, Expr, IntoIden, IntoLikeExpr, SeaRc, SelectStatement, SimpleExpr, - Value, + Alias, BinOper, DynIden, Expr, ExprTrait, IntoIden, IntoLikeExpr, SeaRc, SelectStatement, + SimpleExpr, Value, }; use std::str::FromStr; diff --git a/src/executor/cursor.rs b/src/executor/cursor.rs index ad6c22d841..bb0a000e39 100644 --- a/src/executor/cursor.rs +++ b/src/executor/cursor.rs @@ -4,8 +4,8 @@ use crate::{ SelectThree, SelectThreeModel, SelectTwo, SelectTwoModel, SelectorTrait, }; use sea_query::{ - Condition, DynIden, Expr, IntoValueTuple, Order, SeaRc, SelectStatement, SimpleExpr, Value, - ValueTuple, + Condition, DynIden, Expr, ExprTrait, IntoValueTuple, Order, SeaRc, SelectStatement, SimpleExpr, + Value, ValueTuple, }; use std::marker::PhantomData; use strum::IntoEnumIterator as Iterable; diff --git a/src/query/helper.rs b/src/query/helper.rs index 405ff1f197..a6e4282ee8 100644 --- a/src/query/helper.rs +++ b/src/query/helper.rs @@ -3,8 +3,8 @@ use crate::{ ModelTrait, PrimaryKeyToColumn, RelationDef, }; use sea_query::{ - Alias, Expr, Iden, IntoCondition, IntoIden, LockBehavior, LockType, NullOrdering, SeaRc, - SelectExpr, SelectStatement, SimpleExpr, + Alias, Expr, ExprTrait, Iden, IntoCondition, IntoIden, LockBehavior, LockType, NullOrdering, + SeaRc, SelectExpr, SelectStatement, SimpleExpr, }; pub use sea_query::{Condition, ConditionalStatement, DynIden, JoinType, Order, OrderedStatement}; diff --git a/src/query/join.rs b/src/query/join.rs index 001d05b24b..a97a9421aa 100644 --- a/src/query/join.rs +++ b/src/query/join.rs @@ -1,6 +1,6 @@ use crate::{ ColumnTrait, EntityTrait, IdenStatic, Iterable, Linked, QuerySelect, Related, Select, SelectA, - SelectB, SelectThree, SelectTwo, SelectTwoMany, + SelectB, SelectThree, SelectTwo, SelectTwoMany, join_tbl_on_condition, }; pub use sea_query::JoinType; use sea_query::{Alias, Condition, Expr, IntoIden, SeaRc, SelectExpr}; diff --git a/src/query/loader.rs b/src/query/loader.rs index 1a916aa396..90635c3aa5 100644 --- a/src/query/loader.rs +++ b/src/query/loader.rs @@ -3,7 +3,9 @@ use crate::{ RelationType, Select, error::*, }; use async_trait::async_trait; -use sea_query::{ColumnRef, DynIden, Expr, IntoColumnRef, SimpleExpr, TableRef, ValueTuple}; +use sea_query::{ + ColumnRef, DynIden, Expr, ExprTrait, IntoColumnRef, SimpleExpr, TableRef, ValueTuple, +}; use std::{ collections::{HashMap, HashSet}, str::FromStr, From 90e68fefca4c1a46abdc381f0685e3c44247d993 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 8 Jun 2025 21:31:10 +0100 Subject: [PATCH 05/18] Fix build --- src/entity/column.rs | 2 +- src/entity/prelude.rs | 2 +- src/query/join.rs | 2 +- src/tests_cfg/entity_linked.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/entity/column.rs b/src/entity/column.rs index 7a1eb24a2e..1b8fdad9bf 100644 --- a/src/entity/column.rs +++ b/src/entity/column.rs @@ -1028,7 +1028,7 @@ mod tests { mod hello_expanded { use crate as sea_orm; use crate::entity::prelude::*; - use crate::sea_query::{Expr, SimpleExpr}; + use crate::sea_query::{Expr, ExprTrait, SimpleExpr}; #[derive(Copy, Clone, Default, Debug, DeriveEntity)] pub struct Entity; diff --git a/src/entity/prelude.rs b/src/entity/prelude.rs index 19363948e7..d64f37ed41 100644 --- a/src/entity/prelude.rs +++ b/src/entity/prelude.rs @@ -5,7 +5,7 @@ pub use crate::{ PaginatorTrait, PrimaryKeyArity, PrimaryKeyToColumn, PrimaryKeyTrait, QueryFilter, QueryResult, Related, RelationDef, RelationTrait, Select, Value, error::*, - sea_query::{DynIden, Expr, RcOrArc, SeaRc, StringLen}, + sea_query::{DynIden, Expr, ExprTrait, RcOrArc, SeaRc, StringLen}, }; #[cfg(feature = "macros")] diff --git a/src/query/join.rs b/src/query/join.rs index a97a9421aa..5cc0ed8df6 100644 --- a/src/query/join.rs +++ b/src/query/join.rs @@ -189,7 +189,7 @@ mod tests { RelationTrait, }; use pretty_assertions::assert_eq; - use sea_query::{Alias, ConditionType, Expr, IntoCondition, JoinType}; + use sea_query::{Alias, ConditionType, Expr, ExprTrait, IntoCondition, JoinType}; #[test] fn join_1() { diff --git a/src/tests_cfg/entity_linked.rs b/src/tests_cfg/entity_linked.rs index 5100b3e2ba..ebe2cf8a39 100644 --- a/src/tests_cfg/entity_linked.rs +++ b/src/tests_cfg/entity_linked.rs @@ -1,5 +1,5 @@ use crate::entity::prelude::*; -use sea_query::{Expr, IntoCondition}; +use sea_query::{Expr, ExprTrait, IntoCondition}; #[derive(Debug)] pub struct CakeToFilling; From 8f7e253887301e3af77a3e8dbcbf5266bc04840c Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 8 Jun 2025 21:47:23 +0100 Subject: [PATCH 06/18] Fix build --- examples/loco_example/Cargo.toml | 1 + examples/loco_seaography/Cargo.toml | 1 + examples/loco_starter/Cargo.toml | 1 + tests/active_enum_tests.rs | 9 ++++----- tests/enum_primary_key_tests.rs | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/loco_example/Cargo.toml b/examples/loco_example/Cargo.toml index d10c7e96bf..154deb68fa 100644 --- a/examples/loco_example/Cargo.toml +++ b/examples/loco_example/Cargo.toml @@ -51,4 +51,5 @@ insta = { version = "1.34.0", features = ["redactions", "yaml", "filters"] } [patch.crates-io] sea-orm = { path = "../../" } sea-orm-migration = { path = "../../sea-orm-migration" } +sea-query = { git = "https://github.com/SeaQL/sea-query.git", branch = "master" } loco-rs = { git = "https://github.com/SeaQL/loco", branch = "master" } diff --git a/examples/loco_seaography/Cargo.toml b/examples/loco_seaography/Cargo.toml index 04526ffc1a..366effb544 100644 --- a/examples/loco_seaography/Cargo.toml +++ b/examples/loco_seaography/Cargo.toml @@ -58,4 +58,5 @@ insta = { version = "1.34.0", features = ["redactions", "yaml", "filters"] } [patch.crates-io] sea-orm = { path = "../../" } sea-orm-migration = { path = "../../sea-orm-migration" } +sea-query = { git = "https://github.com/SeaQL/sea-query.git", branch = "master" } loco-rs = { git = "https://github.com/SeaQL/loco", branch = "master" } diff --git a/examples/loco_starter/Cargo.toml b/examples/loco_starter/Cargo.toml index 586080e723..b0569a6f15 100644 --- a/examples/loco_starter/Cargo.toml +++ b/examples/loco_starter/Cargo.toml @@ -51,4 +51,5 @@ insta = { version = "1.34.0", features = ["redactions", "yaml", "filters"] } [patch.crates-io] sea-orm = { path = "../../" } sea-orm-migration = { path = "../../sea-orm-migration" } +sea-query = { git = "https://github.com/SeaQL/sea-query.git", branch = "master" } loco-rs = { git = "https://github.com/SeaQL/loco", branch = "master" } diff --git a/tests/active_enum_tests.rs b/tests/active_enum_tests.rs index 2183bf9c94..cca675acd6 100644 --- a/tests/active_enum_tests.rs +++ b/tests/active_enum_tests.rs @@ -9,9 +9,8 @@ use pretty_assertions::assert_eq; use sea_orm::QueryTrait; use sea_orm::{ ActiveEnum as ActiveEnumTrait, DatabaseConnection, FromQueryResult, QuerySelect, - entity::prelude::*, - entity::*, - sea_query::{BinOper, Expr}, + entity::*,QueryFilter, + sea_query::{BinOper, ExprTrait, Expr},DbErr, }; #[sea_orm_macros::test] @@ -143,7 +142,7 @@ pub async fn insert_active_enum(db: &DatabaseConnection) -> Result<(), DbErr> { Entity::find() .filter( Expr::col(Column::Tea) - .binary(BinOper::In, Expr::tuple([Tea::EverydayTea.as_enum()])) + .binary(BinOper::In, Expr::tuple([ActiveEnumTrait::as_enum(&Tea::EverydayTea)])) ) .one(db) .await? @@ -175,7 +174,7 @@ pub async fn insert_active_enum(db: &DatabaseConnection) -> Result<(), DbErr> { .filter(Column::Tea.is_not_null()) .filter( Expr::col(Column::Tea) - .binary(BinOper::NotIn, Expr::tuple([Tea::BreakfastTea.as_enum()])) + .binary(BinOper::NotIn, Expr::tuple([ActiveEnumTrait::as_enum(&Tea::BreakfastTea)])) ) .one(db) .await? diff --git a/tests/enum_primary_key_tests.rs b/tests/enum_primary_key_tests.rs index 3eab892940..0e6bbcbbd8 100644 --- a/tests/enum_primary_key_tests.rs +++ b/tests/enum_primary_key_tests.rs @@ -108,7 +108,7 @@ pub async fn insert_teas(db: &DatabaseConnection) -> Result<(), DbErr> { Entity::find() .filter( Expr::col(Column::Id) - .binary(BinOper::In, Expr::tuple([Tea::EverydayTea.as_enum()])) + .binary(BinOper::In, Expr::tuple([ActiveEnumTrait::as_enum(&Tea::EverydayTea)])) ) .one(db) .await? From f179fff40fd4319355307e75c7cefdd83eb86362 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 8 Jun 2025 21:48:29 +0100 Subject: [PATCH 07/18] clippy --- src/entity/relation.rs | 8 ++++---- tests/active_enum_tests.rs | 23 ++++++++++++----------- tests/enum_primary_key_tests.rs | 8 ++++---- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/entity/relation.rs b/src/entity/relation.rs index bd1c9fbd09..62116a372a 100644 --- a/src/entity/relation.rs +++ b/src/entity/relation.rs @@ -141,11 +141,11 @@ impl IntoCondition for RelationDef { // Use table alias (if any) to construct the join condition let from_tbl = match self.from_tbl.table_alias() { Some(alias) => alias, - None => &self.from_tbl.table(), + None => self.from_tbl.table(), }; let to_tbl = match self.to_tbl.table_alias() { Some(alias) => alias, - None => &self.to_tbl.table(), + None => self.to_tbl.table(), }; let owner_keys = self.from_col; let foreign_keys = self.to_col; @@ -156,8 +156,8 @@ impl IntoCondition for RelationDef { }; condition = condition.add(join_tbl_on_condition( - SeaRc::clone(&from_tbl), - SeaRc::clone(&to_tbl), + SeaRc::clone(from_tbl), + SeaRc::clone(to_tbl), owner_keys, foreign_keys, )); diff --git a/tests/active_enum_tests.rs b/tests/active_enum_tests.rs index cca675acd6..0920dcf549 100644 --- a/tests/active_enum_tests.rs +++ b/tests/active_enum_tests.rs @@ -8,9 +8,10 @@ use pretty_assertions::assert_eq; #[cfg(feature = "sqlx-postgres")] use sea_orm::QueryTrait; use sea_orm::{ - ActiveEnum as ActiveEnumTrait, DatabaseConnection, FromQueryResult, QuerySelect, - entity::*,QueryFilter, - sea_query::{BinOper, ExprTrait, Expr},DbErr, + ActiveEnum as ActiveEnumTrait, DatabaseConnection, DbErr, FromQueryResult, QueryFilter, + QuerySelect, + entity::*, + sea_query::{BinOper, Expr, ExprTrait}, }; #[sea_orm_macros::test] @@ -140,10 +141,10 @@ pub async fn insert_active_enum(db: &DatabaseConnection) -> Result<(), DbErr> { assert_eq!( model, Entity::find() - .filter( - Expr::col(Column::Tea) - .binary(BinOper::In, Expr::tuple([ActiveEnumTrait::as_enum(&Tea::EverydayTea)])) - ) + .filter(Expr::col(Column::Tea).binary( + BinOper::In, + Expr::tuple([ActiveEnumTrait::as_enum(&Tea::EverydayTea)]) + )) .one(db) .await? .unwrap() @@ -172,10 +173,10 @@ pub async fn insert_active_enum(db: &DatabaseConnection) -> Result<(), DbErr> { model, Entity::find() .filter(Column::Tea.is_not_null()) - .filter( - Expr::col(Column::Tea) - .binary(BinOper::NotIn, Expr::tuple([ActiveEnumTrait::as_enum(&Tea::BreakfastTea)])) - ) + .filter(Expr::col(Column::Tea).binary( + BinOper::NotIn, + Expr::tuple([ActiveEnumTrait::as_enum(&Tea::BreakfastTea)]) + )) .one(db) .await? .unwrap() diff --git a/tests/enum_primary_key_tests.rs b/tests/enum_primary_key_tests.rs index 0e6bbcbbd8..0c02fb9594 100644 --- a/tests/enum_primary_key_tests.rs +++ b/tests/enum_primary_key_tests.rs @@ -106,10 +106,10 @@ pub async fn insert_teas(db: &DatabaseConnection) -> Result<(), DbErr> { assert_eq!( model, Entity::find() - .filter( - Expr::col(Column::Id) - .binary(BinOper::In, Expr::tuple([ActiveEnumTrait::as_enum(&Tea::EverydayTea)])) - ) + .filter(Expr::col(Column::Id).binary( + BinOper::In, + Expr::tuple([ActiveEnumTrait::as_enum(&Tea::EverydayTea)]) + )) .one(db) .await? .unwrap() From 90348db5dbf7600976288544dd603944535cadb3 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 8 Jun 2025 22:02:03 +0100 Subject: [PATCH 08/18] Fix tests --- src/query/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/query/mod.rs b/src/query/mod.rs index bb429764f6..398dec2b4c 100644 --- a/src/query/mod.rs +++ b/src/query/mod.rs @@ -27,3 +27,4 @@ pub use crate::{ ConnectionTrait, CursorTrait, InsertResult, PaginatorTrait, Statement, StreamTrait, TransactionTrait, UpdateResult, Value, Values, }; +pub use sea_query::ExprTrait; From b3b7d066d5718359e4a2c0445ce3c7010782de9a Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 8 Jun 2025 22:29:23 +0100 Subject: [PATCH 09/18] Bump --- examples/loco_example/Cargo.toml | 1 - examples/loco_seaography/Cargo.toml | 1 - examples/loco_starter/Cargo.toml | 1 - src/database/stream/query.rs | 1 + 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/loco_example/Cargo.toml b/examples/loco_example/Cargo.toml index 154deb68fa..d10c7e96bf 100644 --- a/examples/loco_example/Cargo.toml +++ b/examples/loco_example/Cargo.toml @@ -51,5 +51,4 @@ insta = { version = "1.34.0", features = ["redactions", "yaml", "filters"] } [patch.crates-io] sea-orm = { path = "../../" } sea-orm-migration = { path = "../../sea-orm-migration" } -sea-query = { git = "https://github.com/SeaQL/sea-query.git", branch = "master" } loco-rs = { git = "https://github.com/SeaQL/loco", branch = "master" } diff --git a/examples/loco_seaography/Cargo.toml b/examples/loco_seaography/Cargo.toml index 366effb544..04526ffc1a 100644 --- a/examples/loco_seaography/Cargo.toml +++ b/examples/loco_seaography/Cargo.toml @@ -58,5 +58,4 @@ insta = { version = "1.34.0", features = ["redactions", "yaml", "filters"] } [patch.crates-io] sea-orm = { path = "../../" } sea-orm-migration = { path = "../../sea-orm-migration" } -sea-query = { git = "https://github.com/SeaQL/sea-query.git", branch = "master" } loco-rs = { git = "https://github.com/SeaQL/loco", branch = "master" } diff --git a/examples/loco_starter/Cargo.toml b/examples/loco_starter/Cargo.toml index b0569a6f15..586080e723 100644 --- a/examples/loco_starter/Cargo.toml +++ b/examples/loco_starter/Cargo.toml @@ -51,5 +51,4 @@ insta = { version = "1.34.0", features = ["redactions", "yaml", "filters"] } [patch.crates-io] sea-orm = { path = "../../" } sea-orm-migration = { path = "../../sea-orm-migration" } -sea-query = { git = "https://github.com/SeaQL/sea-query.git", branch = "master" } loco-rs = { git = "https://github.com/SeaQL/loco", branch = "master" } diff --git a/src/database/stream/query.rs b/src/database/stream/query.rs index 2b37e5a189..afdd05db32 100644 --- a/src/database/stream/query.rs +++ b/src/database/stream/query.rs @@ -33,6 +33,7 @@ impl std::fmt::Debug for QueryStream { } impl QueryStream { + #[allow(dead_code)] #[instrument(level = "trace", skip(metric_callback))] pub(crate) fn build( stmt: Statement, From 1f8244190b8ea50e632602d19c129ca9dca6e3a0 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 8 Jun 2025 22:36:56 +0100 Subject: [PATCH 10/18] Bump --- sea-orm-cli/Cargo.toml | 3 +++ sea-orm-migration/Cargo.toml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sea-orm-cli/Cargo.toml b/sea-orm-cli/Cargo.toml index c95edcbcc5..d72689ff32 100644 --- a/sea-orm-cli/Cargo.toml +++ b/sea-orm-cli/Cargo.toml @@ -67,3 +67,6 @@ runtime-tokio-native-tls = ["sqlx?/runtime-tokio-native-tls", "sea-schema?/runti runtime-actix-rustls = ["sqlx?/runtime-tokio-rustls", "sea-schema?/runtime-actix-rustls"] runtime-async-std-rustls = ["sqlx?/runtime-async-std-rustls", "sea-schema?/runtime-async-std-rustls"] runtime-tokio-rustls = ["sqlx?/runtime-tokio-rustls", "sea-schema?/runtime-tokio-rustls"] + +[patch.crates-io] +sea-orm = { path = ".." } diff --git a/sea-orm-migration/Cargo.toml b/sea-orm-migration/Cargo.toml index b3ae1b203b..05602173a8 100644 --- a/sea-orm-migration/Cargo.toml +++ b/sea-orm-migration/Cargo.toml @@ -55,3 +55,6 @@ with-bigdecimal = ["sea-orm/with-bigdecimal"] with-uuid = ["sea-orm/with-uuid"] with-time = ["sea-orm/with-time"] with-ipnetwork = ["sea-orm/with-ipnetwork"] + +[patch.crates-io] +sea-orm = { path = ".." } From e767fdee088be800b3b642b3bf3a161adab4ad9f Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 8 Jun 2025 22:42:00 +0100 Subject: [PATCH 11/18] Bump --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 253eaefa71..aec60e038d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -109,4 +109,4 @@ seaography = ["sea-orm-macros/seaography"] # This allows us to develop using a local version of sea-query [patch.crates-io] # sea-query = { path = "../sea-query" } -sea-query = { git = "https://github.com/SeaQL/sea-query.git", branch = "master" } +# sea-query = { git = "https://github.com/SeaQL/sea-query.git", branch = "master" } From 4ee28a6b6f4dd7e8d0511f828ce64afbb3c8e2f5 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 8 Jun 2025 22:42:43 +0100 Subject: [PATCH 12/18] Bump --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index aec60e038d..65a4cf1be3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ tracing = { version = "0.1", default-features = false, features = ["attributes", rust_decimal = { version = "1", default-features = false, optional = true } bigdecimal = { version = "0.4", default-features = false, optional = true } sea-orm-macros = { version = "~1.2.0-rc.1", path = "sea-orm-macros", default-features = false, features = ["strum"] } -sea-query = { version = "1.0.0-rc.1", default-features = false, features = ["thread-safe", "hashable-value", "backend-mysql", "backend-postgres", "backend-sqlite"] } +sea-query = { version = "1.0.0-rc.2", default-features = false, features = ["thread-safe", "hashable-value", "backend-mysql", "backend-postgres", "backend-sqlite"] } sea-query-binder = { version = "0.8.0-rc.1", default-features = false, optional = true } strum = { version = "0.26", default-features = false } serde = { version = "1.0", default-features = false } From 5a15b401907bbdbc94635c43f80d98fbee6e3879 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 8 Jun 2025 23:06:40 +0100 Subject: [PATCH 13/18] Bump --- sea-orm-migration/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sea-orm-migration/Cargo.toml b/sea-orm-migration/Cargo.toml index 05602173a8..a3a0bc9372 100644 --- a/sea-orm-migration/Cargo.toml +++ b/sea-orm-migration/Cargo.toml @@ -25,7 +25,7 @@ clap = { version = "4.3", features = ["env", "derive"], optional = true } dotenvy = { version = "0.15", default-features = false, optional = true } sea-orm = { version = "~1.2.0-rc.1", path = "../", default-features = false, features = ["macros"] } sea-orm-cli = { version = "~1.2.0-rc.1", path = "../sea-orm-cli", default-features = false, optional = true } -sea-schema = { version = "0.17.0-rc.1", default-features = false, features = ["discovery", "writer", "probe"] } +sea-schema = { version = "0.17.0-rc.2", default-features = false, features = ["discovery", "writer", "probe"] } tracing = { version = "0.1", default-features = false, features = ["log"] } tracing-subscriber = { version = "0.3.17", default-features = false, features = ["env-filter", "fmt"] } From 46e9d28f3ed11e83aa6b1ae023319a519ae1dbea Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sun, 8 Jun 2025 23:18:32 +0100 Subject: [PATCH 14/18] Fix build --- sea-orm-migration/src/migrator.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sea-orm-migration/src/migrator.rs b/sea-orm-migration/src/migrator.rs index 3780411b7e..67a2be3d8d 100644 --- a/sea-orm-migration/src/migrator.rs +++ b/sea-orm-migration/src/migrator.rs @@ -6,8 +6,8 @@ use std::time::SystemTime; use tracing::info; use sea_orm::sea_query::{ - self, Alias, Expr, ForeignKey, IntoIden, JoinType, Order, Query, SelectStatement, SimpleExpr, - Table, extension::postgres::Type, + self, Alias, Expr, ExprTrait, ForeignKey, IntoIden, JoinType, Order, Query, SelectStatement, + SimpleExpr, Table, extension::postgres::Type, }; use sea_orm::{ ActiveModelTrait, ActiveValue, Condition, ConnectionTrait, DbBackend, DbErr, DeriveIden, From 47d386704e615a74cd54fcfc19648905169c715d Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Mon, 9 Jun 2025 10:29:04 +0100 Subject: [PATCH 15/18] Fix build --- src/entity/column.rs | 4 +--- tests/active_enum_tests.rs | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/entity/column.rs b/src/entity/column.rs index 899b47501c..87ecc3fbbc 100644 --- a/src/entity/column.rs +++ b/src/entity/column.rs @@ -1026,11 +1026,9 @@ mod tests { use crate::{ActiveModelTrait, ActiveValue, Update}; mod hello_expanded { - use sea_query::ExprTrait; - use crate as sea_orm; use crate::entity::prelude::*; - use crate::sea_query::{Expr, ExprTrait, SimpleExpr}; + use crate::sea_query::{Expr, SimpleExpr}; #[derive(Copy, Clone, Default, Debug, DeriveEntity)] pub struct Entity; diff --git a/tests/active_enum_tests.rs b/tests/active_enum_tests.rs index 3cb617c99b..0920dcf549 100644 --- a/tests/active_enum_tests.rs +++ b/tests/active_enum_tests.rs @@ -13,7 +13,6 @@ use sea_orm::{ entity::*, sea_query::{BinOper, Expr, ExprTrait}, }; -use sea_query::ExprTrait; #[sea_orm_macros::test] async fn main() -> Result<(), DbErr> { From 0d8cf2e870363442f549b785d3ca2fc7b5e9bb5f Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Mon, 9 Jun 2025 12:31:12 +0100 Subject: [PATCH 16/18] Remove unnecessary imports --- src/entity/column.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/entity/column.rs b/src/entity/column.rs index 87ecc3fbbc..63121f8e12 100644 --- a/src/entity/column.rs +++ b/src/entity/column.rs @@ -1157,8 +1157,6 @@ mod tests { use crate::{ActiveModelTrait, ActiveValue, Update}; mod hello_expanded { - use sea_query::ExprTrait; - use crate as sea_orm; use crate::entity::prelude::*; use crate::sea_query::{Expr, SimpleExpr}; @@ -1290,8 +1288,6 @@ mod tests { use crate::{ActiveModelTrait, ActiveValue, Update}; mod hello_expanded { - use sea_query::ExprTrait; - use crate as sea_orm; use crate::entity::prelude::*; use crate::sea_query::{Expr, SimpleExpr}; From 03e4c9f17187a6488fc3f680409a8606352c1f99 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Mon, 9 Jun 2025 13:51:22 +0100 Subject: [PATCH 17/18] Revert cargo patch --- sea-orm-cli/Cargo.toml | 3 --- sea-orm-migration/Cargo.toml | 7 ++----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/sea-orm-cli/Cargo.toml b/sea-orm-cli/Cargo.toml index d72689ff32..c95edcbcc5 100644 --- a/sea-orm-cli/Cargo.toml +++ b/sea-orm-cli/Cargo.toml @@ -67,6 +67,3 @@ runtime-tokio-native-tls = ["sqlx?/runtime-tokio-native-tls", "sea-schema?/runti runtime-actix-rustls = ["sqlx?/runtime-tokio-rustls", "sea-schema?/runtime-actix-rustls"] runtime-async-std-rustls = ["sqlx?/runtime-async-std-rustls", "sea-schema?/runtime-async-std-rustls"] runtime-tokio-rustls = ["sqlx?/runtime-tokio-rustls", "sea-schema?/runtime-tokio-rustls"] - -[patch.crates-io] -sea-orm = { path = ".." } diff --git a/sea-orm-migration/Cargo.toml b/sea-orm-migration/Cargo.toml index a3a0bc9372..bc7d54ae28 100644 --- a/sea-orm-migration/Cargo.toml +++ b/sea-orm-migration/Cargo.toml @@ -23,8 +23,8 @@ path = "src/lib.rs" async-trait = { version = "0.1", default-features = false } clap = { version = "4.3", features = ["env", "derive"], optional = true } dotenvy = { version = "0.15", default-features = false, optional = true } -sea-orm = { version = "~1.2.0-rc.1", path = "../", default-features = false, features = ["macros"] } -sea-orm-cli = { version = "~1.2.0-rc.1", path = "../sea-orm-cli", default-features = false, optional = true } +sea-orm = { version = "~1.2.0-rc", path = "../", default-features = false, features = ["macros"] } +sea-orm-cli = { version = "~1.2.0-rc", path = "../sea-orm-cli", default-features = false, optional = true } sea-schema = { version = "0.17.0-rc.2", default-features = false, features = ["discovery", "writer", "probe"] } tracing = { version = "0.1", default-features = false, features = ["log"] } tracing-subscriber = { version = "0.3.17", default-features = false, features = ["env-filter", "fmt"] } @@ -55,6 +55,3 @@ with-bigdecimal = ["sea-orm/with-bigdecimal"] with-uuid = ["sea-orm/with-uuid"] with-time = ["sea-orm/with-time"] with-ipnetwork = ["sea-orm/with-ipnetwork"] - -[patch.crates-io] -sea-orm = { path = ".." } From e549a16c99acbf3ec5b45f42e5067c4df1b02e12 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Mon, 9 Jun 2025 14:26:44 +0100 Subject: [PATCH 18/18] Remove ExprTrait from entity prelude --- src/entity/column.rs | 6 +++--- src/entity/prelude.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/entity/column.rs b/src/entity/column.rs index 63121f8e12..cbc70632d6 100644 --- a/src/entity/column.rs +++ b/src/entity/column.rs @@ -1028,7 +1028,7 @@ mod tests { mod hello_expanded { use crate as sea_orm; use crate::entity::prelude::*; - use crate::sea_query::{Expr, SimpleExpr}; + use crate::sea_query::{Expr, ExprTrait, SimpleExpr}; #[derive(Copy, Clone, Default, Debug, DeriveEntity)] pub struct Entity; @@ -1159,7 +1159,7 @@ mod tests { mod hello_expanded { use crate as sea_orm; use crate::entity::prelude::*; - use crate::sea_query::{Expr, SimpleExpr}; + use crate::sea_query::{Expr, ExprTrait, SimpleExpr}; #[derive(Copy, Clone, Default, Debug, DeriveEntity)] pub struct Entity; @@ -1290,7 +1290,7 @@ mod tests { mod hello_expanded { use crate as sea_orm; use crate::entity::prelude::*; - use crate::sea_query::{Expr, SimpleExpr}; + use crate::sea_query::{Expr, ExprTrait, SimpleExpr}; #[derive(Copy, Clone, Default, Debug, DeriveEntity)] pub struct Entity; diff --git a/src/entity/prelude.rs b/src/entity/prelude.rs index d64f37ed41..19363948e7 100644 --- a/src/entity/prelude.rs +++ b/src/entity/prelude.rs @@ -5,7 +5,7 @@ pub use crate::{ PaginatorTrait, PrimaryKeyArity, PrimaryKeyToColumn, PrimaryKeyTrait, QueryFilter, QueryResult, Related, RelationDef, RelationTrait, Select, Value, error::*, - sea_query::{DynIden, Expr, ExprTrait, RcOrArc, SeaRc, StringLen}, + sea_query::{DynIden, Expr, RcOrArc, SeaRc, StringLen}, }; #[cfg(feature = "macros")]