spadefoot / kohana-orm-leap

An ORM module for the Kohana PHP framework that is designed to work with all major databases.
http://spadefoot.github.io/kohana-orm-leap/
100 stars 25 forks source link

Add support for case insensitive searching #19

Closed ekarlso closed 12 years ago

ekarlso commented 12 years ago

Is there a possibility to add support for case insensitive searching in the ORM ?

Oracle uses SELECT * FROM

WHERE UPPER() LIKE ;

Or you can do WHERE LOWER() ....

spadefoot commented 12 years ago

I believe you are looking for the following:

$results = DB_SQL::select('default')->from('table')->where(DB_SQL::expr("UPPER('value')"), '=', 'text')->query();

or

$results = DB_ORM::select('model')->where(DB_ORM::expr("UPPER('value')"), '=', 'text')->query();