[gnome-db] V4: How to represent a string type in a CREATE TABLE operation



There seems to be no db-independent way to represent a string in a db, and I think this is a flaw in the API.

Looking at the gda-mysql-ddl.c code shows me that the mysql provider takes the string value set for /FIELDS_A/@COLUMN_TYPE/%i as the text to use in the CREATE TABLE ddl statement.  However, different providers have different strings to use, and within mysql, for example, there are string limitations.  CHAR has a max length of 255 and VARCHAR has a max length of 255 before rev 5.0.3 and 65535 after rev 5.0.3.  Calling gda_server_provider_get_default_dbms_type() doesn't help because you only pass the GType, not the string length.  I have some 2048-length strings (even longer would be better).

I am working on a libgda-based backend for the gnucash finance program, and as requirements, I need to support sqlite, mysql and postgresql backends.  I would prefer to be db-independent and and leave all dependencies to libgda.  Can we come up with a mechanism in libgda to return the correct string column type?

Phil


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]