A high-level Clojure library for defining application models and retrieving them from a database with ORM-like conveniences.
Toucan is a high-level Clojure library for defining application models and interacting with relational databases. It simplifies database queries, enables custom type conversions for model fields, and provides easy hydration of related objects, reducing boilerplate code while maintaining flexibility.
Clojure developers building applications that need structured database interactions, especially those transitioning from libraries like Korma or seeking ORM-like conveniences without full ORM overhead.
Developers choose Toucan for its balance of simplicity and power—it streamlines common database operations with a clean API, integrates seamlessly with HoneySQL for complex queries, and offers unique features like automatic hydration and model customizations.
A classy high-level Clojure library for defining application models and retrieving them from a DB
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Drastically reduces boilerplate for common operations like selecting fields or single records, as shown with db/select-one-field versus verbose jdbc and HoneySQL code.
Enables automatic type conversions and custom logic on insert/retrieve via model definitions, such as handling keyword-to-string conversion for status fields without manual intervention.
Efficiently fetches and nests related objects with minimal database calls, simplifying API response construction as demonstrated with venue and category hydration.
Provides macros like with-temp for creating temporary test objects that clean up automatically, ensuring test isolation without polluting the database state.
Builds on HoneySQL for expressive SQL generation, allowing complex queries while maintaining Clojure's functional style, without limiting flexibility.
Toucan 1 is officially deprecated in favor of Toucan 2, meaning no new features, limited bug fixes, and necessitating migration for long-term viability.
Tied exclusively to the Clojure ecosystem, making it unsuitable for projects that require database access from multiple languages or frameworks.
Adds a layer on top of jdbc and HoneySQL, which can introduce unnecessary complexity for very simple use cases or teams that prefer direct SQL control.
Toucan is an open-source alternative to the following products: