[web-devel] Yesod, Sqlite, Enabling Foreign Key Support
acheshkov at gmail.com
Tue Apr 26 17:47:38 CEST 2011
I recompiled persistent with new changes. All works how i want and expect.
But now *insertBy* function are not so safe as earlier.
*The insertBy function* checks only unique constrains defined on yesod
framework level via Unique... constructions .
Now *insertBy* function throws exception if we try to insert 'bad' value to
column with foreign constraint.
Please show me how to catch exception.
I think it would something like:
*import qualified Control.Exception.Control as E*
* res <- runDB $ E.catch (insertBy offer) (\_ -> return Left ())*
But my exception handler is wrong.
2011/4/26 Greg Weber <greg at gregweber.info>
> Please send a pull request to Michael.
> On Tue, Apr 26, 2011 at 5:58 AM, Anton Cheshkov <acheshkov at gmail.com>wrote:
>> I have pushed branch to fix it. probably it should be helpful.
>> 2011/4/26 Anton Cheshkov <acheshkov at gmail.com>
>>> Hi Michael.
>>> Please show the way to enable foreign key support from sqlite connection.
>>> Now foreign key constrints does not work for sqlite from Yesod.
>>> Best regards,
>>> Cheshkov Anton
>>> Phone: +7 909 005 18 82
>>> Skype: cheshkov_anton
>> Best regards,
>> Cheshkov Anton
>> Phone: +7 909 005 18 82
>> Skype: cheshkov_anton
>> web-devel mailing list
>> web-devel at haskell.org
Phone: +7 909 005 18 82
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the web-devel