Hey Jeremy, On Jan 15, 8:28 am, jrmy <[EMAIL PROTECTED]> wrote: > I would see the sequel-model class having a base set of validations > that are all performed on the code side. Then each database plugin can
I agree. There are certain validations that can only be performed client side. However, there are also validations that can only be performed database side. This is the problem we face. > somehow override this base set to provide validation from the > database. This would allow people to switch between databases without > any changes to their code. As for if that is even possible with I don't think we should have the database_validates_xxx overwrite validates_xxx because the behavior and the expectations are different. The database_validates_xxx validations, for one, are guaranteed validations. > sequels current design I have no idea, I have yet to look very far > into the code base. Not to mention some may not want to use the DB > constraints so how would you deal with them? We would want to keep the database_validates_xxx separate from validates_xxx precisely because some users prefer one over the other. > > You also bring up something I was not thinking about, how do you > specify DB based constraints without causing problems when moving from > one DB to another. Not to mention keeping you migrations straight with > your current model. It seems to me that the constraints need to be > somehow defined model side to keep all that model logic in one place. > Meh, I don't have a good idea on how to solve that one. I agree with what Chris suggested on this one: separate the constraint code into each database adapter. > > -Jeremy Perhaps the term "validations" is not very fitting, although I like it. Maybe "constraints" are just better terms for the database side things. Maybe instead of "database_validates_xxx" we should say "database_constrains_xxx." We could be more precise and call it "depends_on_database_to_constrain_rows_based_on," but that would be silly. :) --David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" 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/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
