Re: [gnome-db] Alternative to "gda_prepare_create_table" not using variable arguments ?



I can write a new function as follow:

gda_connection_prepare_create_table_from_list (GdaConnection *cnn, const gchar *table_name, GSList *fields, GError **error)

GSList *list - could hold a new data structure like:

typedef {
     gchar  *field_name, // Filed's name
    GType  field_type,  // Field's type
    GdaEasyCreateTableFlag flag, // a tag
    GSList tag_arguments // Tag's arguments like for                 
GDA_EASY_CREATE_TABLE_FKEY_FLAG
} GdaCreateTable

What do you think?

And May deprecate gda_prepare_create_table for a new gda_connection_prepare_create_table




2010/6/30 Vivien Malerba <vmalerba gmail com>
On 29 June 2010 22:12, Thomas Bollmeier <TBollmeier web de> wrote:
> Hi,
>
> I currently work on a small application that has defined its own interface
> for data accesses. To make use of the gnome-db functionality I have written
> an adapter to the libgda API.
> One of the interface methods creates a table from some meta data. Actually I
> would like to delegate the call to the convenience function
> "gda_prepare_create_table". However the variable arguments mechanism makes
> this impossible since the column names, types and attributes are only known
> at runtime. Though I was able to work around this by using the
> "gda_server_operation_set_value_at" function this is quite a tedeous
> approach. So my question is: Is there any convenience function similar to
> "gda_prepare_create_table" which could be called without using varargs?

No, there is not: the gda_prepare_create_table() and associated
similar functions are for a quick and easy usage of Libgda's basic
tasks, but for a better control, you'll have to use the
GdaServerOperation objects direclty. To simplify this, you can use the
actual implementation of gda_prepare_create_table() as a starting
point.

Regards,

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



--
Trabajar, la mejor arma para tu superación
"de grano en grano, se hace la arena" (R) (en trámite, pero para los cuates: LIBRE)


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