|
|
|
|
|
by aguzubiaga
666 days ago
|
|
The README examples showcase the low-level API, but I've also made an experimental query builder that lets you write type-safe queries without the boilerplate. There’s a CLI that generates a Roc library from your database schema, that you can use through a DSL to build up a parametrized SQL query and decoder at once. See an example [1]. You’d be surprised at how nice you can make a DSL in Roc without any metaprogramming! As for Squirrel, I think it’s a great approach and definitely something I might explore in the future. Right now, I'm leaning towards a DSL for better reusability, though I must admit, that actual SQL is hard to beat! [1] https://github.com/agu-z/roc-pg/blob/62725fe3a1d92144a8408ae... |
|