Conversation
|
I'm investigating the build failure, it builds successfully in current Rust beta and nightly... Wondering if rust-lang/rust#130654 might be the reason it's fixed. If I won't get anywhere, I would consider waiting two more days for Rust 1.84 to hit stable and just merge this as-is. We don't really care about this project working on old stable compiler versions anyways... (yet!) |
|
Ah yes, seems like indeed what I've linked is the fix for the issue. There's a blogpost about this: https://blog.rust-lang.org/inside-rust/2023/12/22/trait-system-refactor-initiative.html I think these trait impls are problematic: impl<T: DatabaseField> ToDbFieldValue for Auto<T> {}
impl<T: DatabaseField> ToDbFieldValue for Option<Auto<T>> {}
impl<T: Model + Send + Sync> ToDbFieldValue for ForeignKey<T> {}
impl<T: Model + Send + Sync> ToDbFieldValue for Option<ForeignKey<T>> {}(or some subset of them) I don't really want to remove them though, since they make implementing new DatabaseField types much easier (and it's nice to have shiny new features if we're writing a shiny new framework anyway — modern codebase will be one of our advantages over other similar projects). Like I said in my previous comment, I'd just wait for Rust 1.84 to hit stable (9 Jan, so we're almost there) and just run CI on beta until then. @seqre what do you think? |
c19c3c1 to
4f30fbe
Compare
d082bb1 to
a6cdd82
Compare
1.84 has been released today, so we're back on stable. |
I agree, since this is a new framework with no existing users, I see no point in supporting older compiler versions. Once it gains popularity, we can think about supporting N-X versions. |
seqre
left a comment
There was a problem hiding this comment.
LGTM overall, some notes for possible improvements and nitpicks
This also contains a general ORM refactor:
Autoenum was introduced instead of implying if a field is autoincrement based on its namesave()now actually modifies the saved model with newly assigned autoincrement primary keys (if any)SELECTquery is performed afterINSERTfor MySQL to obtain the auto-generated values because MySQL doesn't support theRETURNINGclause.