Replies: 1 comment
-
Did you find a way? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I try use newtype pattern, as described below:
I have this postgres table script:
And receive this error on compilation:
clinic-schedules/src/models.rs:30:9
|
30 | query_as!(Resource, "select id, kind, external_id, description from resources")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct
ResourceId
, found structUuid
|
= note: this error originates in the macro
$crate::sqlx_macros::expand_query
which comes from the expansion of the macroquery_as
(in Nightly builds, run with -Z macro-backtrace for more info)help: try wrapping the expression in
models::ResourceId
--> /home/ijsgaus/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-0.6.2/src/macros/mod.rs:558:9
|
558| models::ResourceId($crate::sqlx_macros::expand_query!(record = $out_struct, source = $query))
| +++++++++++++++++++
What is my mistake please?
Beta Was this translation helpful? Give feedback.
All reactions