Closed dragonnn closed 3 years ago
No problem, I appreciate every issue you open, I'm sure there are a lot of edge-cases I missed. That's strange, I will have to investigate what's going on here. I don't see why it shouldn't work.
Thanks! If you need any addition info or a small test case I can create one.
Seems like sqlx does a poor job of parsing attributes. It seems like sqlx tries to pase #[ormx(..)]
.
Yeah, they parse every field attribute as meta: https://github.com/launchbadge/sqlx/blob/5f793c6e957d2b21ac3e1fe055f7c78274619b66/sqlx-macros/src/derives/attributes.rs#L128 While most macros only have meta attributes, I purposefully differentiated between #[ormx(key = "string")] and #[ormx(key = some::path)]. I'll open an issue on sqlx.
sqlx 0.4.1 is out :). Should have a fix for that included. Not sure if this is a problem in versions when I have in my project 0.4.1 and ormx tries to use beta version but I got this
58 | Self::$fi(x) => x.fetch(executor)
| ^^^^^ method not found in `sqlx::query::Map<'_, DB, F31, A31>`
When my project. Maybe just a version bump will fix that?
Sorry for the late reply, was pretty busy. Yes, sqlx::query::Map seems to have been changed. Just fixed it, 0.2 depends on sqlx 0.4 and should hopefully work.
If there are still problems, feel free to open another issue!
Works fine now :), thank you!
Sorry for opening another issue :/ When I try add FromRow derive to my struct at the same time as Table from ormx I got:
And when I try add Encode I got:
Can sqlx and ormx coexist at the same time on the same struct?