Re: [gnome-db] Per-table meta-data with capital letters in the table name?

On Tue, 2009-06-30 at 09:08 +0200, Vivien Malerba wrote:
> So we need to add quotes around the table_name (and escape the text),
> > when setting the table name in GdaMetaContext, as in the libgdamm
> code
> > below? If so, that's definitely something that should be mentioned
> in
> > the gda_connection_update_meta_store() and/or GdaMetaContext
> > documentation.
> Yes, and I'll correct that documentation point.
> >
> > Is there a function we can use to quote and escape the table name?

> Yes:  gda_sql_identifier_add_quotes(); not that there is also a
> gda_sql_identifier_remove_quotes() function.

And we must also us gda_server_provider_escape_string(), and
gda_server_provider_unescape_string(), right?

This complicates things greatly and makes it very likely that many
libgda-based applications will have bugs because developers will forget
to do this. I think libgda should just accept normal strings and do the
right thing internally.

At the least, libgda should warn if things are not quoted when they
should be quoted.

We also noticed that the GDA_CONNECTION_META_TABLES meta data has table
names that are sometimes quoted, but sometimes not. That's horribly
inconsistent. Surely libgda should remove any quotes for us before it
gets to the application.

I guess we are lucky that " must be escaped in table names, or there
would be no way to know what was a quote and what was a quote character
that's part of the name. Yes, I know that " is unusual in a table name,
but not impossible.

murrayc murrayc com

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