Grokbase
x

Jason Thaxter (th...@gomoos.org)

Profile | Posts (2)

User Information

Display Name:Jason Thaxter
Partial Email Address:th...@gomoos.org
Posts:
2 total
2 in DBIx::Class

2 Most Recent

1) Jason Thaxter [Dbix-class] overlaps
| +1 vote
Any suggestions on how to use the overlaps operator? Using Postgresql.. I read the SQL::Abstract...
DBIx::Class
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Any suggestions on how to use the overlaps operator? Using Postgresql..

I read the SQL::Abstract page after bottoming out on:
Cannot mix placeholder styles ":foo" and "?"

I found this in the docs:

    my %where  = (
        user   => 'nwiger',
        completion_date => {
           -not_between => ['2002-10-01', '2003-02-06']
        }
    );

    Would give you:

    WHERE user = ? AND completion_date NOT BETWEEN ( ? AND ? )


But it doesn't seem to recognize OVERLAPS the same way as BETWEEN:

    (start_time,end_time)" => { -overlaps => [$pg_alpha, $pg_omega] }

generates:

    WHERE ( ( ( (start_time,end_time) OVERLAPS $1 ) OR ( ...

Of course what I want is
    WHERE ( ( ( ( start_time,end_time) OVERLAPS (?, ?)

I could simulate overlaps with some OR clauses, but I made a mistake with that
before, so I'd rather use the proper SQL function.


--
----------------------------------------------
Jason Thaxter                           GoMOOS
        350 Commercial Street, Suite 308
              Portland, ME 0410
            Office: 207.773.0423
             Tel: 207.228.1665
          Email: [email protected: th...@gomoos.org]
----------------www.gomoos.org----------------

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/dbix-class@lists.rawmode.org/
2) Jason Thaxter [Dbix-class] Combining link tables
| +1 vote
That cookbook example is cool. I have two databases for two applications. One takes the schema from...
DBIx::Class
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
That cookbook example is cool.

I have two databases for two applications. One takes the schema from the
first, then uses table inheritance to add some columns. I'd like to inherit
everything, into a full second set of proxy classes, e.g. App2::Schema
inherits from App1::Schema, then just add extra ->add_column bits for my
extra inherited table.

I thought that the reliance on __PACKAGE__ should make this a snap, but I'm
having some issues. I'm going to start by checking out the cookbook example
and seeing where I differ from it.

Any tips on this - ? Methods in particular I'd need to override? new?
inflate_result?



On Tuesday 31 October 2006 06:53, Ash Berlin wrote:
> > 2) If not, can it be implemented with relationships, or would I need to
> > write custom accessors or use a custom resultset class to get the
> > desired behaviour?
>
> Tho just to show how great DBIx::Class is, I'll tell you how to do it
> anyway: See "Dynamic Sub-classing DBIx::Class proxy classes" in
> DBIx::Class::Manual::Cookbook
>
> Ash
>
> _______________________________________________

spacer
Profile | Posts (2)
Home > People > Jason Thaxter