Skip Menu |
 

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 79139
Status: rejected
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: dcantrell [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Arbitrary SQL through a custom ResultSource is hard to pass bind params to
Download (untitled) / with headers
text/plain 559b
I've followed the recipe in the Cookbook at "Arbitrary SQL through a custom ResultSource", and it's Hard to pass the right bind params. It would be helpful if they could be named parameters instead of having to be an ordered list when I make a query. Right now I have to do this: bind => [ $customer_id, $service_id, ... ] but it would be more convenient, and easier to maintain, if I could do this: bind => { customer_id => $customer_id, service_id => $service_id, ... }
Download (untitled) / with headers
text/plain 1.1k
On Wed Aug 22 13:01:03 2012, DCANTRELL wrote: Show quoted text
> I've followed the recipe in the Cookbook at "Arbitrary SQL through a > custom ResultSource", and it's Hard to pass the right bind params. It > would be helpful if they could be named parameters instead of having to > be an ordered list when I make a query. > > Right now I have to do this: > bind => [ $customer_id, $service_id, ... ] > > but it would be more convenient, and easier to maintain, if I could do > this: > bind => { > customer_id => $customer_id, > service_id => $service_id, > ... > }
I am sceptical this can be done. Consider that DBIC resultsets are designed to be composable. There is no guarantee that there is only one 'customer_id' in existence. Where would we apply the bind value then? Or furthwrmore, if your arbitrary SQL contains ... WHERE customer_id > ? AND customer_id < ?... what happens then? Furthermore given this is *arbitrary* SQL, how can we even tell what each placeholder corresponds to in the black-boxy SQL string the user supplied? Please elaborate what you have in mind.
Stalling ticket for a bit due to lack of replies from the reporter.
Download (untitled) / with headers
text/plain 105b
Rejecting ticket as no reply from original requestor. Feel free to reopen if more discussion is in order.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.