Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

author
message
[Level:0]gabordemooij

Post subject: I wrote a RedBeanPHP driver for CUBRID

registered: 02/29/2012

IP: *.151.83.165

views: 6

Hi there,

Just for your information I wrote a RedBeanPHP driver for CUBRID, so this ORM is now compatible with CUBRID. While the installation was a bit challenging (fedora) I find the CUBRID database quite easy to use. The CUBRID Manager is also very nice. Great work. Here is the announcement of the CUBRID Driver:

http://www.redbeanphp.com/extra/roadmap

The driver works with PDO.

Yet another product that supports your database. If you like you may use this fact to promote the CUBRID database even more.

Cheers,

Gabor.

Quote
[Level:8]CUBRID

# Post subject:Re: I wrote a RedBeanPHP driver for CUBRID

profile

registered: 03/29/2010

IP: *.91.139.82

WOW! This is the great news! I will announce this news on CUBRID Blog and review ReadBeanPHP. Thanks! Let me know if there is anything you would like to know about CUBRID! I will be very glad to help you!

Quote
[Level:0]gabordemooij

# Post subject:Re: I wrote a RedBeanPHP driver for CUBRID

profile

registered: 02/29/2012

IP: *.151.83.165

Hi, thnx!

One of my unit tests checks whether keywords in a DB can be properly escaped.

From this test I learned that certain keywords in CUBRID cannot be escaped is this correct or should I file a bug report about this or am I missing something?



CREATE TABLE "int"(
"id" integer AUTO_INCREMENT,
"name" national character varying(4096),
CONSTRAINT pk_int_id PRIMARY KEY("id")
);
Error code: -233
            Cannot create class with basic type name "in


I was able to reproduce this issue in the CUBRID manager by trying to create a table with the name "int".

I know this is a crazy name for a table but I just want to confirm the exception in my unit tests.

If this is true than the RedBeanPHP driver will prefix tables with forbidden names with an underscore.

Also if this is true can you point me to a list of 'non-escapable' reserved words in CUBRID?


Quote
[Level:8]CUBRID

# Post subject:Re: I wrote a RedBeanPHP driver for CUBRID

profile

registered: 03/29/2010

IP: *.91.139.67

Hi Gabor,

This is in fact a bug. Well caught! First, like you said, it's very ridiculous to use int as a name of table, but still this is a bug. I've just registered a bug report. We'll fix it in the coming release.

Thank you for your report, Gabor.

By the way, notice that only int has this problem, all other reserved words work as expected and table can be created successfully.

I think you do not need to prefix such table names. This is not "forbidden name" case. It's just a bug, though very harmless bug. So, you can ignore it for now, unless other databases have this issue as well.

Let me know your decision.

Quote
[Level:0]gabordemooij

# Post subject:Re: I wrote a RedBeanPHP driver for CUBRID

profile

registered: 02/29/2012

IP: *.151.83.165

Ok well I will add a special case in my unit tests and pretend the bug does not exist ;)


Quote
[Level:8]CUBRID

# Post subject:Re: I wrote a RedBeanPHP driver for CUBRID

profile

registered: 03/29/2010

IP: *.91.139.66

Hello Gabor,

We are very glad you are releasing the new 3.2 version of your RedBeanPHP. Even more happy you officially support CUBRID in RedBeanPHP. To pay a tribute to your project, we would like to feature your RedBeanPHP as our Partner on CUBRID Blog, SNS, and other CUBRID Networking sites (eg. CUBRID Affiliates). What do you think about this?

Quote
[Level:0]gabordemooij

# Post subject:Re: I wrote a RedBeanPHP driver for CUBRID

profile

registered: 02/29/2012

IP: *.151.83.165


That would be very nice, thank you. Working with CUBRID has been a great experience so far.

Quote
[Level:8]CUBRID

# Post subject:Re: I wrote a RedBeanPHP driver for CUBRID

profile

registered: 03/29/2010

IP: *.91.139.84

Hello Gabor,

We have found out the real reason behind this issue when tables cannot have "int" as a name. It occurs that it is not a bug but a limitation by design. The reason lies behind CUBRID's architecture. As you know CUBRID is a relational database with support for objects. This allows users to create tables where columns' data type can be another table. See the following example:

create table t1 (a int);
create table t2 (b t1);

Here t1 table can be a column type of column b in table t2. So considering this feature, look at this example below:

create table "int" (a int);
create table "t2 (b int);

If we allow a table to have a name like "int", then we have a problem: what is the type of column b in t2? Is it table "int", or just basic type INT?

This creates an ambiguity. This is why in CUBRID data type names are not allowed to be table names. Thus, it is not just "int", but all other data types. So in your application you need to include them all to a list of "non-escapable reserved words".

Thank you again for bringing up this issue.

Quote




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: