metabase / toucan

A classy high-level Clojure library for defining application models and retrieving them from a DB
Eclipse Public License 1.0
570 stars 49 forks source link

Should atoms in toucan.hydrate flushed after defmodel? #34

Open DogLooksGood opened 6 years ago

DogLooksGood commented 6 years ago

When we change models, we may change hydration-keys, this change will not work unless we reload toucan.hydrate namespace. This looks inconvenient in development.

Since automagic-batched-hydration-key->model and automagic-batched-hydration-keys are delays, why not reload them after each time we call defmodel? maybe there's a better way for this?

camsaul commented 6 years ago

PR #27 is close to what you want.

I'm hoping to get some tests in that PR so we can merge it in the near future

camsaul commented 6 years ago

It is inconvenient but I think maybe doing (require 'toucan.hydrate :reload) in the REPL will at least let you continue working