Fork me on GitHub
#clojure-nl
<
2019-12-21
>
gklijs10:12:47

In the light of last meetup Clojure/Orm discussion, just stumbled upon https://github.com/metabase/toucan seems like a nice library to give a little bit convenience over HoneySql.

Kevin10:12:22

I’ve looked into it, but it didn’t really feel like it make it easier to write queries. Just a bit shorter. It also introduces a lot of complexity with little gain IMHO. It also doesn’t support relations / joins, which is the biggest hurdle. You’d have to fall back to honeysql anyway if you’re making any type of real world app.

borkdude10:12:19

That's my impression as well.

Kevin10:12:03

My ideal DB library would be one based around spec, which also handles relations (has-many, belongs-to). And compiles down to honeysql for you to query. With spec you could have changesets like Elixir’s ecto: https://hexdocs.pm/ecto/Ecto.Changeset.html

Kevin10:12:41

Basically Ecto, but with a little less macro magic, preferably.

Kevin10:12:13

I honestly don’t know why we don’t steal (back) from Elixir, they have a lot of cool ideas imho

Kevin10:12:57

But then again. If I’m saying “Why doesn’t anyone build it?“, one can reply with: “So when are you going to start?”

borkdude10:12:00

Maybe #malli would even be a better fit, since the schemas are serializable and could be stored inside the db 🙂

Kevin11:12:30

Haven’t heard of malli before, will check it out

Kevin11:12:48

Does spec have custom error messages?

Kevin11:12:46

Quite cool

gklijs12:12:24

Going to start a project to eventually tests several databases. Basic idea is to start with an abstraction of graph-like functions, that could have several implementations depending on db used. A bit like spring-data. Idea for now is to keep it very simple, but to set it up in a way it might become a library at some point.