On Oct 5, 2011, at 12:23 PM, Benedikt Müller wrote:
> Hi
> I want to use constraints, but dm-constraints seems to not support SQLite, 
> which I'm using.

SQLite introduced constraint support in 3.6.19 (IIRC), and DM has not yet added 
support for enforcing constraints in SQLite. You are not alone in wanting DM to 
support constraints in SQLite (I want this feature too), but it doesn't yet 
exist.

That's the bad news. The good news is that it doesn't look too difficult to add 
constraint support on a conditional basis (DM's SQLite adapter should only 
apply constraints when supported, eg., SQLite versions >= 3.6.19), and it's a 
feature I also would like, so I'm hoping to add it in the near future 
(hopefully this week).

> Can somebody tell me how I do :dependent => :destroy without dm-constraints?

I don't think it will be very easy to do so, although there is some support for 
pure-Ruby constraints in dm-constraints. Unfortunately, I do not recall the 
details of how it works at the moment. Please have a look at the source of 
dm-constraints for more details (it is not terribly large, although it is a bit 
convoluted).

Good luck, and I'll let you know if I succeed in adding constraint support for 
SQLite.

—Emmanuel

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to