[web-devel] Persistent Feature Request

Michael Snoyman michael at snoyman.com
Sun Oct 10 14:34:40 CEST 2010

On Sun, Oct 10, 2010 at 11:21 AM, Max Cantor <mxcantor at gmail.com> wrote:
> Just a thought, but the it would be nice if the $persist QQ could also generate some sort of generic migrate function which will migrate all of your tables instead of having to do that manually as in the examples.  If you forget a migrate statement, it unfortunately wont raise an error until runtime.  As haskellers, we live and die by compile time errors..

Yes, I agree that something like that would be nice. Unfortunately,
there are a few complications:

* There could easily be multiple $persist blocks; in that case, what
do you name the migrate function without causing a conflict?
* You have to make sure to migrate in the correct order. For example,
if the Entry table has an AuthorId field, the Author entity needs to
be migrated first. This isn't insurmountable, just something to

I really would love to implement something like this, we're completely
violating DRY right now, but I haven't come up with a good solution
yet. Any ideas?


More information about the web-devel mailing list