This is excellent!

However is there a way to have this work in an alter_table block? or
is there another way to add constraints to an existing table?

Also is there any formal documentation for check? or a wiki page?

Thanks
Jim

On Jan 16, 7:59 am, Sharon Rosner <[EMAIL PROTECTED]> wrote:
> sequel_core in the trunk now contains code for defining constraints.
> here's an example:
>
>   create_table(:items) do
>     ...
>     check {:price < 100}
>   end
>
> you can also define named constraints:
>
>   create_table(:items) do
>     ...
>     constraint(:valid_price) {:price < 100}
>   end
>
> you can also pass a hash or string instead of a block:
>
>   check :price => 0..100
>   check 'price < 100'
>   check 'price < ?', 100
>
> etc.
>
> your comments please. Next step is to add code for adding and dropping
> constraints (for databases that support these operations).
>
> best
> Sharon
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to