Replies: 1 comment 1 reply
-
Okay, seems like I should do this: let article = sqlx::query_as!(Article, "SELECT id, text as "text: _" FROM articles WHERE id = $1", id).fetch_one(pool).await?; Which is really verbose in my actual use case, so I wonder if something like this is considered. However, now I don't understand how to let article = sqlx::query_as!(Article, "INSERT into articles (text) VALUES ($1)", text).fetch_one(pool).await?; Results in errors like this:
Although this particular case could be fixed by replacing |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hi! I'm trying to use this library with struct wrappers (also known as newtypes), but have no luck.
For example, consider this code:
Which connects to a postgres database with this scheme:
When I try to query an article like this:
I get this compile error:
What am I doing wrong? Basically I want the returned
String
to be just wrapped with myText
type.Beta Was this translation helpful? Give feedback.
All reactions