Is there anyone actually using diesel in production?

Months later this is my second attempt using diesel on another project however it feels like so many things are lacking.
The most basic example is inserting something to a table which has a serial as primary key which is auto-incremented by the db.
Since it is primary key schema is not nullable therefor the struct cannot contain an Option for an id so to be able to insert that i need to invent an id which is used instead of the auto incremented value.
I also cant find any examples except for very basic stuff. So is diesel a toy project or is there someone out there actually able to use it and if so what is the way to actually learn it since theres no proper examples or roadmap?

Have you seen the docs at Getting Started? This exact case with a SERIAL primary key is handled there.

1 Like

Hi i assumed insertable works out of box for anything that is queryable which is not the case apparently using tuples solve my issue

It does, as long as you want to insert with the same columns that you want to query with. In this case you want to query the id but don't want to (explicitly) insert it, so you shouldn't use the same struct for both.

4 Likes

As for examples: crates.io is running on diesel.

See GitHub - rust-lang/crates.io: The Rust package registry

3 Likes

i hope noone gets me wrong i am just starting with diesel and certain things are so frustrating at first

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.