How to realize lower() (postresql) in dbix:class

103 Views Asked by At

I need the postgresql query: select * from document where lower(app_period) = '2019-08-01 00:00:00+03';

How it will look in dbix::class?

2

There are 2 best solutions below

0
Alexander Hartmaier On BEST ANSWER

The DBIx::Class::Manual::Cookbook contains an example for that.

0
muhana On

In DBIx::Class it looks like:

$rs->search(
  \[ 'lower(app_period) = ?', $start ]
);

With some params:

$rs->search({ -and => [
  agreement_id => $id,
  \[ 'lower(app_period) = ?', $start ]
]});