On 13 December 2011 19:40, Jeremy Evans <[email protected]> wrote:

> On Dec 13, 9:31 am, Iain Barnett <[email protected]> wrote:
> > Hi,
> >
> > I'm wondering what ways other Sequel users have dealt with splitting
> tables
> > vertically and then using Sequel::Model? Either splitting for conceptual
> or
> > performance reasons.
> >
> > For example, right now I have a project where four different types of
> > entity all share a core table (and I would say they are subtypes, not
> just
> > sharing common data/behaviour) but each have fields that are unique to
> > themselves so they have their own table for those. If I modelled them in
> > Ruby first then I'd get them to inherit from the core class, but since
> > Sequel::Model already takes up the available superclass slot, I create a
> > composite object and stick the classes in there. As a simple example:
>
> This sounds like a good fit for the class_table_inheritance plugin
> (http://sequel.rubyforge.org/rdoc-plugins/classes/Sequel/Plugins/
> ClassTableInheritance.html). Your example is similar to the example in
> that plugin's documentation.
>
> If you are using PostgreSQL, you could also use table inheritance in
> the database.  There's no special Sequel support for that, and I don't
> have personal experience with it, but it should work.
>
> Jeremy
>

For the life of me, I can't work out how I missed that! Anyway, I'm trying
it now and I'll let you know how I get on with it.

Thanks very much.

Regards,
Iain

-- 
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