[Dbix-class] How to deal with right joins while under test/sqlite

Trevor Leffler tleffler at uw.edu
Tue Nov 7 19:28:30 GMT 2017


Well... nevermind this. A little searching reminding me that I can replace right join queries with left join queries (and vice versa). I've replaced my handful of right join queries and have things working.

Cheers, --Trevor

From: dbix-class-bounces at lists.scsys.co.uk [mailto:dbix-class-bounces at lists.scsys.co.uk] On Behalf Of Trevor Leffler
Sent: Friday, November 3, 2017 12:56 PM
To: dbix-class at lists.scsys.co.uk
Subject: [Dbix-class] How to deal with right joins while under test/sqlite

Up until recently I've been exclusively using a mysql database. I've started writing tests using Test::DBIx::Class, which loads my schema into an in-memory sqlite database. I got it working after making a few minor code changes to my Result/ResultSet classes. For example, I had to replace the use of the mysql-specific utc_timestamp() function in a couple queries with a DateTime string.

Now I'm getting a "RIGHT and FULL OUTER JOINs are not currently supported" error while running under test (sqlite). A Result class has a has_many relationship with a {join_type => 'right'}.

I'm curious what are folks doing here. Are you... avoiding right join relationships and using alternate SQL to achieve the same queries? Doing db feature detection to "do the right thing"? Not using sqlite for unit testing?

Thanks,
--Trevor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20171107/02106383/attachment.htm>


More information about the DBIx-Class mailing list