Skip to content

the trait FromStaticSqlRow<(...), Mysql> is not implemented for (...) #3601

Answered by weiznich
mcronce asked this question in Q&A
Discussion options

You must be logged in to vote

It seems like diesel misses a few trait implementations to support this kind of impl. I've opened #3603 to address that.

In the mean time you could use the following code to workaround that limitation and avoid allocations (although that shouldn't matter that much compared to the network calls necessary to execute your query 😉):

use compact_str::CompactString;
use diesel::mysql::Mysql;
use diesel::prelude::*;
use diesel::sql_types::Binary;
use diesel::sql_types::Text;

#[derive(Debug, Clone, Selectable, Queryable)]
#[diesel(table_name = users)]
pub struct User {
    id: u16,
    #[diesel(deserialize_as = CompactStringWrapper)]
    username: CompactString,
    #[diesel(deserialize_as = Arr…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mcronce
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants