Sqlx , prost timestamp

I have some models that are in protobuf. for example user. fields like created_at which are time need to be converted to time stamp. but I get error in retriving data.

= help: the trait sqlx::Type<_> is not implemented for prost_types::Timestamp
= help: the following other types implement trait sqlx::Type<DB>:
&T implements sqlx::Type<DB>
Box<[u8]> implements sqlx::Type<MySql>
Box<str> implements sqlx::Type<MySql>
Cow<'_, str> implements sqlx::Type<MySql>
DateTime<Utc> implements sqlx::Type<MySql>
DateTime<chrono::Local> implements sqlx::Type<MySql>
Hyphenated implements sqlx::Type<MySql>
IpAddr implements sqlx::Type<MySql>
and 48 others
= note: required for Option<Timestamp> to implement sqlx::Type<_>

I don't have any clue even where should I begin to fix this error.

to my knowledge, sqlx does not support protobuf out-of-the-box. the supported, tier #1, DBs are listed here.

the error message tells you that it needs some "decoding" logic to interpret a column data as db specific type. an example of how sqlx allows you to do that for your own types is here.

there's however a crate (sqlx-prost that claims to do the job.

may be using it can solve your problem. i never used it though, so i cannot vouch for it.

good luck.