finds.dev← search

// the find

metabase/toucan

★ 573 · Clojure · EPL-1.0 · updated Oct 2023

A classy high-level Clojure library for defining application models and retrieving them from a DB

Toucan is a thin ORM-flavored layer over clojure.java.jdbc and HoneySQL, built by Metabase for their own internal use and eventually open-sourced. It handles model definitions, type coercions, and smart hydration of related entities. If you're maintaining a legacy Clojure service with relational data, this is the kind of thing that cuts boilerplate — but the README's own banner tells you to use Toucan 2 instead.

The hydration system is genuinely useful: it auto-resolves FK relationships, batches the queries, and handles nested hydration without you wiring it up manually. Type coercion hooks (keyword↔string, JSON serialization, etc.) attach at the model level so you don't scatter casts across your callsites. The API surface is small and honest — it's not trying to be Hibernate, just a few sharp functions on top of HoneySQL. Test utilities like `with-temp` are a real convenience for keeping test state isolated.

This library is deprecated and the README says so loudly — Toucan 2 is the maintained successor, so starting anything new here is a mistake you'll regret at migration time. It's built on clojure.java.jdbc, which itself has been superseded by next.jdbc; the dependency chain is aging fast. Global mutable state via `set-default-db-connection!` is a design smell that makes testing and multi-tenancy awkward. The codebase is tiny (four source files) and last touched in 2023, so don't expect bug fixes.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →