A Short Serde Deserialize example
In my previous post, I described taking a simple enum and creating a custom type in diesel. This post will take that same enum and implement deserialize.
I often get tripped up by the mechanics of deserializing so this simple enum makes for a good example. Again, this is to benefit anyone looking for more examples of Serde's Deserialize as well as for myself, so I can remember next time I need to do this.
Read MoreI've been working with diesel and serde. I use diesel for my postgres datastore, and serde for serializing/deserializing data to the web. Recently I came across a situation where I needed to define my type in diesel as well as implement deserialize in serde. The example below is a fairly simple so it makes for a good example to share so others can learn (and so I can remember how all this works next time I need it).
Read MoreAuto builds with Diesel using GitLab’s CI
The folks over at GitLab give away some free compute power to allow users to have CI builds of their project. It is very straightforward to get Rust projects to build within a CI environment. This post is going to take that build process one small step further, we’re going to build a Rust project that uses the Diesel ORM. This adds a step of complexity since to compile a Diesel project you need to have a postgresql database accessible if you’re using the infer_schema!()
macro.
Note: diesel has instructions for using diesel print-schema
instead of using infer_schema!()
in version 1.3.x. It has been proposed to move away from . A redditor commented that infer_schema!()
, but that issues was closed because infer_schema!()
is still usefulinfer_schema!()
has been deprecated in diesel 1.3.
Search