

I don't normally use sqlite but I was able to set up a sqlite database and query stuff from it with diesel, so it seems like it. = help: the following other types implement trait `FromSqlRow`:įor more information about this error, try `rustc -explain E0277`.Įrror: could not compile `masters-dashboard-service` due to 2 previous errorsĭiesel claims it supports MySQL, Postgres and Sqlite.

| - ^^^^^^^^^^ the trait `FromSqlRow` is not implemented for `foo::models::Host` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::load`Įrror: the trait bound `foo::models::Host: FromSqlRow` is not satisfied Note: required by a bound in `diesel::RunQueryDsl::load` = note: required for `table` to implement `LoadQuery` = help: the following other types implement trait `load_dsl::private::CompatibleType`: | required by a bound introduced by this call | - ^^^^^^^^^^ the trait `load_dsl::private::CompatibleType` is not implemented for `(diesel::sql_types::Text, diesel::sql_types::Text, diesel::sql_types::Text, diesel::sql_types::Text, Nullable)` ②: error: the trait bound `(diesel::sql_types::Text, diesel::sql_types::Text, diesel::sql_types::Text, diesel::sql_types::Text, Nullable): load_dsl::private::CompatibleType` is not satisfiedġ3 | let results = hosts.load::(connection).expect("Error loading hosts") Would appreciate pointers toĬ) learning material that make all these things click or turn the diesel error messages² into something helpful What am I missing, what can I do to improve the situation? I must be overlooking something huge to get stuck this hard or Sqlite support is seriously broken. But I could've done this a few minutes in most other stacks.

TL/DR: 6-8 hours in I'm unable to use Diesel with a single, simple, trivial table in Sqlite. I'm at the verge of adding my own custom serialization similar to the UUID workaround. The error messages are again completely opaque and not helping. For reasons I cannot understand Timestamp (and Date/DateTime) maps to TEXT for Sqlite (why?) and I've tried gazillion combinations of mapping my schema with a simple TEXT NOT NULL to. Fast forward and another couple hours later I'm unsure what the solution is to get basic "serialize timestamps" to work. Let's uncomment the next fields in my table. read and write uuids after just a few hours. The workarounds mentioned in that ticket don't work anymore since diesel reached 2.x, but with a bit of patience and browsing the docs some more (it seems Sqlite is really a step child here) I am able to. Okay, that's unfortunate and really not great UX (especially because the error messages don't contain anything of value). that only works for one of the "supported" databases¹. In the table above? After hours of frustration I found the "wontfix" bug saying that Diesel does have a uuid feature flag, but. The error messages make zero sense and don't explain what the problem is. My table structure over in the other ecosystem translates toĪctually created_at is an INTEGER and a unix timestamp, but. Diesel claims it supports MySQL, Postgres and Sqlite. I am using Sqlite, because it's a tiny container and I don't want another service. haven't solved the most basic "Read data from a single table" use case yet. How hard could it be? Well, I got stuck for hours with the worst error messages I've seen in rust land so far and. I thought I'd write a quick silly web app today, a rewrite of a thing I did in another language. I've built a bunch of pet projects with it. Disclaimer: I am an experienced dev, but new to Rust.
