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

Vivien Malerba <[email protected]>
Newsgroups gmane.comp.gnome.db
Message-ID <[email protected]>
On 30 June 2010 19:47, Daniel Espinosa <[email protected]> wrote:
> 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?
>

I don't think it's worth it. Let me explain: the existing
"convenience" API is there only because it enables to user to do some
tasks quickly, hence the usage of the ellipsis in C to pass
parameters: the programmer known what he wants and it is "staticaly"
coded.
For a more general purpose I prefer that the user use the full API
because otherwise the final API will be made only of convenience
functions which is not what I want.

Thanks anyway for proposing to improve things,

Regards,

Vivien
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.