Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
2 changes: 2 additions & 0 deletions src/query/combine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions src/query/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(),
}
}

Expand All @@ -900,5 +901,6 @@ pub(crate) fn unpack_table_alias(table_ref: &TableRef) -> Option<DynIden> {
| TableRef::SchemaTableAlias(_, _, alias)
| TableRef::DatabaseSchemaTableAlias(_, _, _, alias)
| TableRef::FunctionCall(_, alias) => Some(SeaRc::clone(alias)),
_ => unreachable!(),
}
}