Yii Framework Forum: Add optional statements to SQL builder like COLLATE - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Add optional statements to SQL builder like COLLATE

#1 User is offline   zekus 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 09-March 10
  • Location:London

Posted 08 December 2011 - 06:26 AM

Sometimes you need to use a different COLLATE, to do a select for example, and be case sensitive or accent sensitive.
At the moment this is not possible using the query builder unless you write you own plain sql query.
I think it would be a good idea to add a method like collate() or something generic like additional() (or something like that) that allow to attach non standard statements like COLLATE to the generated query.
I hope I have been clear enough explaining the case.
1

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,616
  • Joined: 17-January 09
  • Location:Russia

Posted 08 December 2011 - 11:27 AM

Can you check how to achieve that for MySQL, SQLite, PostgreSQL, MSSQL and Oracle?
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   zekus 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 09-March 10
  • Location:London

Posted 09 December 2011 - 05:19 AM

View Postsamdark, on 08 December 2011 - 11:27 AM, said:

Can you check how to achieve that for MySQL, SQLite, PostgreSQL, MSSQL and Oracle?


From a simple google search, this is what I have found:

MySQL http://dev.mysql.com...et-collate.html
MSSQL http://msdn.microsof...y/ms184391.aspx
SQLite http://www.sqlite.or....html#collation
PgSQL http://www.postgresq.../collation.html
Oracle http://docs.oracle.c...v.htm#sthref362 :(
1

#4 User is offline   klammeraffe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 07-September 12
  • Location:Berlin, Germany

Posted 28 December 2012 - 10:59 AM

View Postzekus, on 08 December 2011 - 06:26 AM, said:

or something generic like additional() (or something like that) that allow to attach non standard statements like COLLATE to the generated query

Or different sorting options like
SORT BY row DESC NULLS LAST
for example.

I think that would be quite useful.
0

#5 User is offline   yJeroen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 94
  • Joined: 06-September 11
  • Location:The Netherlands

Posted 01 January 2013 - 02:39 PM

Can't you already add these things with CDbCriteria methods? And the sort by nulls last using a CSort?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users