GDA3 SQLite and Blob type

View: New views
4 Messages — Rating Filter:   Alert me  

GDA3 SQLite and Blob type

by Piotr Pokora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I was wondering if it makes sense to submit a new bug.
Basically, there some inconsistency in the way how SQLite supports BLOBs.

First code which runs:

const gchar *sql = "SELECT binary_field FROM tbl";
command = gda_command_new (sql, GDA_COMMAND_TYPE_SQL, 0);
model = gda_connection_execute_select_command (mgd->priv->connection,
command, NULL, NULL);
gda_data_model_dump (model, stdout);

Data model is dumped and expected binary data are printed to stdout.

Code which doesn't work:

const gchar *sql = "SELECT binary_field FROM tbl WHERE guid=
##/*name:'binary' type:GdaBlob*/";
GdaQuery *query = gda_query_new_from_sql (dict, sql, NULL);

I would expect to initialize new GdaQuery but I get this warning instead:

WARNING **: While adding to a GdaQuery: Blobs are not supported by the
connection's provider and may be rendered incorrectly

How can I work around this?

Piotras
_______________________________________________
gnome-db-list mailing list
gnome-db-list@...
http://mail.gnome.org/mailman/listinfo/gnome-db-list

Re: GDA3 SQLite and Blob type

by Vivien Malerba :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



2009/7/29 Piotr Pokora <piotrek.pokora@...>
Hi!

I was wondering if it makes sense to submit a new bug.

I'm not making any corrections to V3 anymore as the V4 is there and I don't have time to support V3 (also, don't expect any V3 release anymore either).
 

Basically, there some inconsistency in the way how SQLite supports BLOBs.

First code which runs:

const gchar *sql = "SELECT binary_field FROM tbl";
command = gda_command_new (sql, GDA_COMMAND_TYPE_SQL, 0);
model = gda_connection_execute_select_command (mgd->priv->connection,
command, NULL, NULL);
gda_data_model_dump (model, stdout);

Data model is dumped and expected binary data are printed to stdout.

Code which doesn't work:

const gchar *sql = "SELECT binary_field FROM tbl WHERE guid=
##/*name:'binary' type:GdaBlob*/";
GdaQuery *query = gda_query_new_from_sql (dict, sql, NULL);

I would expect to initialize new GdaQuery but I get this warning instead:

WARNING **: While adding to a GdaQuery: Blobs are not supported by the
connection's provider and may be rendered incorrectly

In V3, SQLite did not support blobs, so you can try GdaBinary instead which will probably work. Both GdaBlob and GdaBinary handle the same kind of data (binary) but GdaBlob is meant to handle data using a specific API to directly read or write from the blob whereas GdaBinary will transfer the whole binary when the statement is run. GdaBlob is more for big blobs and GdaBinary is definitaly not for big blobs.

Note that in V3, there were 2 ways to create statements: GdaCommand and GdaQuery, each with their own set of advantages and limitations, and this is the reason in V4 there is only one object which represents a statement: the GdaStatement object, where most if not all of the V3 limitations have been removed.


Vivien


_______________________________________________
gnome-db-list mailing list
gnome-db-list@...
http://mail.gnome.org/mailman/listinfo/gnome-db-list

MySQL provider patch.

by Bas Driessen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Having everything working in my application with libgda postgresql, I am now moving on trying to get it to work with libgda mysql. Incomplete data types is the first issue. Please find a patch attached. Please review and apply to master or let me know the issues.

Thanks,
Bas.



_______________________________________________
gnome-db-list mailing list
gnome-db-list@...
http://mail.gnome.org/mailman/listinfo/gnome-db-list

mysql_dbms_type.patch.bz2 (934 bytes) Download Attachment

Re: MySQL provider patch.

by Vivien Malerba :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



2009/7/29 Bas Driessen <bas.driessen@...>
Hello,

Having everything working in my application with libgda postgresql, I am now moving on trying to get it to work with libgda mysql. Incomplete data types is the first issue. Please find a patch attached. Please review and apply to master or let me know the issues.

Patch applied to master and LIBGDA_4.0. Thanks a lot!

Vivien



_______________________________________________
gnome-db-list mailing list
gnome-db-list@...
http://mail.gnome.org/mailman/listinfo/gnome-db-list