Rocky the Flying Squirrel, a port of Gleam's Squirrel, generates the code needed to run Postgres SQL queries easily within Roc applications :tada:
Note that it's at the embarrassingly early stage, but expect improvements soon. Feedback and PRs appreciated!
https://github.com/stuarth/rocky-the-flying-squirrel
Woah, super cool! This is yet another tool leaning into the benefits of codegen for filling the hole that macros want to fill (but probably shouldn't).
I've never used Gleam's Squirrel myself, my main experience similar to this is Rust's sqlx, which usually does this with procedural macros, but works pretty similarly if you squint a little
Do you have experience using this kind of tool in a project? It looks like the right idea, but you never know how good a tool is until you use it.
Also, very relatable comment haha
Yep, definitely closely related to sqlx as well!
Do you have experience using this kind of tool in a project? It looks like the right idea, but you never know how good a tool is until you use it.
Limited to sqlx actually, which I enjoy. Fingers crossed it'll carry over well to Roc, but we'll see!
Woah! This is so cool. I think this direction makes a lot of sense, it's hard to beat raw SQL and getting type safety is awesome :heart_eyes:
As soon as I'm done with purity inference, I'm going to update roc-pg to the newer stuff. (I know you must be getting quite a few backpassing warnings right now :upside_down:)
That is awesome! I am a big fan of writing sql by hand so very glad to see this :big_smile:
SUPER COOL!
I have always wanted to do this, but couldn't find the time to sit down and do it!
I have another idea of maintaining declarative structure of DB that would diff existing db and generate a diff that could be executed in order to catch up with the declared schema.
Great job, I will start playing with it on Monday!
Last updated: Jul 06 2025 at 12:14 UTC