Stream: ideas

Topic: A database for Roc values


view this post on Zulip Jasper Woudenberg (Jul 19 2024 at 19:15):

I'd love there to exist a database that works well with Roc values. In that hypothetical database it'd be easy to store a Roc value to a table, without having to decompose it into many parts. Algebreic data types in particular I've found tricky to persist in relational databases.

One thing you can do is serialize the value and then put it in a key-value store. That meets the ease-of-persistence requirement, but also means there's no guarantees about the shape of the data stored.

I've an initial design for an API that aims to combine the best of both worlds, and think it should be possible to build on top of sqlite. I'd love your thoughts!
https://github.com/jwoudenberg/crow/blob/main/README.md

view this post on Zulip Johan Lövgren (Jul 21 2024 at 10:08):

I am excited by this!

view this post on Zulip Bryce Miller (Aug 21 2024 at 17:18):

I've been thinking that it would be really nice to be able to define a database schema using Roc types. We have some degree of type safety in building queries with existing tools in basic-webserver and roc-pg, but it would be really nice to be able to make changes to the schema and see exactly what code needs to change to support the new schema. Turns out you had the same idea.


Last updated: Jun 16 2026 at 16:19 UTC