CUBRID support for Yii

I suppose you meant issue in CUBRID PDO 3.0 has been fixed in CUBRID PDO 3.1. Please clarify.

I also think so. What I think is that it is possible to implement the named placeholders support without the native support in CUBRID engine (until the engine developers implement it). One way is to match the placeholders in the CUBRID DB layer for Yii. The second is in the CUBRID PDO Driver. This way Yii users will not notice any difference. The DB layer or the PDO driver will do that job.

If you have any roadmap for developing the CUBRID DB layer, please share with me. I will join and help you.

Yes, the fk issue has been fixed in CUBRID PDO 3.1. About the solution for named placeholders, I will think it over.

Hi kadishmal,

The named parameter issue has been solved. I find out that PDO has given its own solution for named parameter, but I didn’t know that until I run test cases in PDO :P

In 62 test cases, 2 of them are failed:

pdo_022.phpt: This test case tests the method getColumnMeta. The comment in this test says, “meta information is a nightmare to handle portably. it’s not really PDOs job.” So CUBRID doesn’t implement this method, but give a method cubrid_schema which can be used to get schema info.

bug_43130.phpt: This test case tests that Bound parameters cannot have - in their name. The CUBRID output don’t match the desired output. But if the named parameters don’t have -, then all will be OK.

Hi kadishmal,

I have developed the cubrid schema adapter for Yii 1.1.6, and tested it using yii blog demo. It seems it works correctly.

Just decompress it and put the directory cubrid in framework/db/schema, then add the following line in the $_coreClasses in framework/YiiBase.php:

Thanks thorny-road! This is really awesome! I will check it soon. What do you think if we call all CUBRID Community members who use Yii to test it out? Do you think it is stable enough to publicly try?

It is not a stable version, but may be a alpha or beta version. :) It needs carefully testing. And I believe the final solution for Yii CUBRID support is that we can contact Yii developer, suggest adding CUBRID support into Yii.

I will test this weekend and let you know the results.

OK. Thanks :)

There are two methods in parent class CDbSchema which I haven’t implemented, because I don’t know how to implement them correctly now:

1: public function checkIntegrity($check=true,$schema=’’)

This method is used to check referential integrity.

2: public function resetSequence($table,$value=null)

This method is used to resets the sequence value of a table’s primary key.

I have completed CUBRID Driver development based on your code. Since CUBRID 8.4.0 there are many new SQL syntaxes compatible with MySQL, so I changed old code with the new more compact ones.

I’ve already started testing. Everything works perfectly but one issue I have explained in this post. In short, at this moment Yii does not escape column names which Yii generates for WHERE condition based on some $criteria. This raises reserved words conflict in CUBRID which in response generates an SQL Syntax Error message. What can we do to handle this?

It would be great to have Cubrid drivers in the Yii-core :)

[size="7"][font="Arial Black"]+1[/font][/size]

Sorry guys for disappearing for quite a while from this thread and not keeping you updated regarding the work I’ve done to add CUBRID database support to Yii.

Here is the status: last time I managed to make everything work except for one bug (bug for Yii, but it’s just a feature in CUBRID). That time I’d reported this issue to CUBRID developers and they’d promised to fix it in the new CUBRID 9.0 release, which they did for what I’m very thankful.

So, right now there is nothing that stops me to release the code. That time I’d worked on Yii 1.1.8. Since then 1.1.12 has been released. So I’ve just forked it at kadishmal/yii. This week I will apply my last patch, will run tests and if everything goes well, I will push to Gihub. Later we’ll see what we can do to have it applied to the upstream.

I’ve created an issue at Yii Github. Refer to it for more information about the working code.

Great, thanks for your support… hopefully Yii core team will accept the pull request.

the PR works just fine for me.

the changes in 9.0.0 combined with this addition to yii are super important. thanks so much.

anyone worried about the future of mysql under oracle has surely been looking at alternatives. CUBRID is more than an alternative. it’s an exceptionally well designed RDBMS that has a great deal to offer.