Multiple Tables - One Class

Innomin8

Multiple Tables - One Class

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Hi All,

 

Has anyone seen a  modification to DBIC which will handle multiple tables per class?

 

A requirement has just come up out of the blue for the project I’m working on which requires the data to be segmented into daily tables.  Since this started as a personal project, and not officially company sponsored, I was able to do what I wanted, so ended up with DBIC + Catalyst, but this new requirement looks to through a bit of a spanner in the works.

 

Any ideas?

 

Thanks

 

 


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Len Jaffe

Re: Multiple Tables - One Class

Reply Threaded More More options
Print post
Permalink
On Mon, May 11, 2009 at 10:39 PM, Lee Standen <[hidden email]> wrote:

> A requirement has just come up out of the blue for the project I’m working
> on which requires the data to be segmented into daily tables.

What DBMS are you using?

--
[hidden email]
614-404-4214

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
James R. Leu

Re: Multiple Tables - One Class

Reply Threaded More More options
Print post
Permalink
In reply to this post by Innomin8
Hello Lee,

On Tue, May 12, 2009 at 10:39:16AM +0800, Lee Standen wrote:
> Hi All,
>
> Has anyone seen a  modification to DBIC which will handle multiple tables
> per class?

You may need to provide a little more info about what your trying to
accomplish.  Simply trying to span multiple tables that have the same
schema can sometimes be handled with some DB foo (views etc).  Having
different tables queried based on the request is a completely different
issue.

> A requirement has just come up out of the blue for the project I'm working
> on which requires the data to be segmented into daily tables.  Since this
> started as a personal project, and not officially company sponsored, I was
> able to do what I wanted, so ended up with DBIC + Catalyst, but this new
> requirement looks to through a bit of a spanner in the works.

My gut response to data being segmented by days is that you could
potential use a table that is partitioned by day of the year
(again a DB approach to your problem).

Either way, there are a lot a smart people on this list that have
solved many problems using catalyst/dbic.  So if you provide a little
more info, I'm sure someone will have already implemented something
similar.

--
James R. Leu
[hidden email]


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...

attachment0 (204 bytes) Download Attachment
Matt S Trout

Re: Multiple Tables - One Class

Reply Threaded More More options
Print post
Permalink
In reply to this post by Innomin8
On Tue, May 12, 2009 at 10:39:16AM +0800, Lee Standen wrote:
> Hi All,
>
>  
>
> Has anyone seen a  modification to DBIC which will handle multiple tables
> per class?
 
You don't need a modification. Just create a result source object per table
on the fly and register them as using the same class.
 
> A requirement has just come up out of the blue for the project I'm working
> on which requires the data to be segmented into daily tables.

The extra thing to do would be to create one source that unions all the
tables together - given 08100 you can do this as a virtual view on the
DBIC side if you have to, but your database can probably do something better
for you.

Of course, you haven't explained -why- you have this requirement or what
it's supposed to achieve, so it's rather difficult to provide concrete
answers ...

--
        Matt S Trout         Catalyst and DBIx::Class consultancy with a clue
     Technical Director      and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.uk        http://shadowcat.co.uk/blog/matt-s-trout/

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...