![]() ![]() These tests and linters also run on CircleCI for all commits and PRs. | TOUCAN_TEST_DB_PASS | | Optional when running Postgres locally | | TOUCAN_TEST_DB_USER | | Optional when running Postgres locally | To configure access to this database, set the following env vars as needed: Note the script is a Bash script and won't work on Windows unless you're using the Windows Subsystem for Linux. Use lein start-db to start the database and lein stop-db to stop it. If you don't have Postgres running locally, you can instead the provided shell script to run Postgres via docker. Toucan will populate this database with appropriate test data. Tests assume you have Postgres running locally and have a test DB set up with read/write permissions. You can run tests and linters as follows: lein test & lein lint Tests & Lintingīefore submitting a PR, you should also make sure tests and the linters pass. There's lots of ways Toucan can be improved and we need people like you to make it even better. If you're interested in contributing, be sure to check out issues tagged "help wanted". So take a moment to familiarize yourself with the style guidelines before submitting a PR. Toucan code is written to the strict standards of the Metabase Clojure Style Guide, Pull requests for bugfixes, improvements, more documentaton, and other enhancements are always welcome. Read more about Toucan test utilities here. Toucan makes it easy to define custom behavior for inserting, retrieving, updating, and deleting objects on a model-by-model basis.įor example, suppose you want to convert the :status of a User to a keyword whenever it comes out of the database, and back intoĪ string when it goes back in: + HoneySQL insert new-user into the DB, converting the value of :status to a String first Flexible custom behavior when inserting and retrieving objects: Read more about Toucan's database functions here. Toucan select the :name of the User with ID 100 Relatively simple can take quite a lot of code to accomplish in HoneySQL: + HoneySQL select the :name of the User with ID 100 Toucan greatly simplifies the most common queries without limiting your ability to express more complicated ones. View the complete documentation here, or continue below for a brief tour. Making it simpler, more powerful, and more flexible, all while maintaining the function-based approach of HoneySQL. Over the last few years, I've continued to build upon and refine the interface of Toucan, Sorely missed conveniences of Korma to HoneySQL when we transitioned from the former to the latterĪt Metabase. The code that inspired this library was originally written to bring some of the Toucan builds on top of and the excellent When inserting or retrieving objects, and easy hydration of related objects, all in a powerful and classy way. Toucan provides the better parts of an ORM for Clojure, like simple DB queries, flexible custom behavior There are no SQL/Relational DB ORMs for Clojure for obvious reasons.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |