Is there a way to do cross-product joins in DBIx::Class i.e. joins
without a relationship and without the ON/USING clauses? e.g.
SELECT s.name, distance(s.location, p.centre)
FROM store s CROSS JOIN postcode p
WHERE p.postcode = '12345';
'join' doesn't seem like it will work since there's no db relationship
between these tables at all, and my 'from' fu is failing me - the
following:
$rs = $schema->resultset('Store')->search({
'p.postcode' => $postcode,
}, {
alias => 's',
from => [
{ s => 'store' },
[
{ p => 'postcode', -join_type => 'cross' },
[],
{}, # or undef, or omitted
],
],
});
generates a hanging ON clause:
ERROR: syntax error at or near "WHERE" at character 239 [for Statement
"SELECT [...] FROM store s JOIN postcode p ON WHERE ( p.postcode = ? )"
with ParamValues: 1='12345']
Am I doing something wrong here, or is this just not supported?
(DBIx::Class 0.08010, in case that matters)
Cheers,
Gavin
_______________________________________________
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/[email protected]