How to write extension for database support in active record?

Hi all,

I need support for Oracle database in active record for my project. So I want to write Oracle extension for active record.

My question is how to write extension to support oracle database in active record?

I see that MSSQL support have written by Christophe Boulain and he extends some of Yii classes. PDO also have support for oracle database with OCI. Can I write same extension to support oracle in active record by extend CDbColumnSchema, CDbCommandBuilder,CDbSchema, and CDbSchema classes?

The beauty of using PDO is that problems like this are basically avoided, because it abstracts the database access layer. So if you have PDO with the appropriate drivers (in your case Oracle), you shouldn't even have to make any code changes at all for your application to work.

Why don't you give it a quick go and see if it works for you out of the box?

@tyohan: If you could write an Oracle driver for Yii AR, that will be wonderful. You can reference the implementation of mssql and also the oracle support in Prado: http://code.google.c…a/Common/Oracle

@WilsonC: If only Yii DAO is used, nothing new is needed. To use AR, additional support is needed (currently we only have support for sqlite, mysql, pgsql and mssql).

Thanks Qiang, I will take a look into Prado implementation for Oracle support and try to write Yii extension for support Oracle database in Active Record.

Hi tyohan!

I have already done an Oracle extension for Yii, and it's currently being analysed by Qiang

(I sent it to him yesterday, so he didn't know it when he posted the answer here).

It is working to me, so I suggest you to wait the beta release (when Qiang aprove it).

Thanks so much rickgrana…

If it's approved by Qiang and can use it with Active Record, its will save my time. I love this community, they have big contribution to Yii features and make Yii grow up faster…