[Dbix-class] Dynamic/Flexible DBIC views

Christian Lackas lackas at lackas.net
Fri Nov 28 15:04:05 GMT 2014


* Darius Jokilehto <dariusjokilehto at yahoo.co.uk> [141122 07:43]:

Dear Darius,

thanks for your input (David as well).

> You can implement this by passing an identity instead of a value, i.e. me.customer_id = me.customer_id. So either pass (untested):
>  { -ident => 'me.customer_id' }
> or if that doesn't work a scalar ref:
>  \'me.customer_id'
> Granted, it's still not pretty, but it should work.

unfortunately, passing in literal parameters or even references to raw
SQL does not work with bind values. Which does make sense since the
whole point of bind values is that they are safely escaped values and
avoid having to check the input yourself.

Unfortunately, bind values seem the only way one can communicate with a
virtual views, which makes them a lot less flexible than they could be.

Will try to create views on the fly now, however, have not yet found out
how to do this (that is not having the Schema load them automatically
from pm files)...

Christian

-- 
Dr. Christian Lackas, Managing Partner
inviCRO, LLC -- In Imaging Yours
http://www.invicro.com/  http://www.spect-ct.com/



More information about the DBIx-Class mailing list