Database-driver specific default alias

Oracle OCI behaves very strange when it comes to quoted names of tables and columns:

  • if you type it using CAPITAL letters, eg. "TABLE"."COLUMN" it will be matched also with tables and columns with different case, eg. Table.CoLUmn

  • when you type mixed/lower case letters in quote, eg. "Table"."Column" it will match only EXACTLY same names with letter case - only Table and Column will be matched, and not table/column

  • when you do not use quotes at all - case doesn’t matter - you can type: tABle.CoLUmn, just do not use quotes…

Currently all AR classes use default alias "t", which in case of OCI connection will force you to write conditions like:

‘condition’=>’ “t”.column’ or ‘condition’=>’ T.column’ which makes your code hard to migrate to other db type. It would be nice if you would have default alias configured by DbConnection object, so it could be T for oracle, and t for other databases. Or maybe you could configure DbConnection whether to quote table/column names or not.

If I am sure my tables and columns have proper names I can disable default quoting and "t" alias will work in Oracle too.

It is not just "nice to have" for me, as I am developing CMS system on Yii, which I would like to be flexible when it comes to db engine.