Re: [gnome-db] gda_connection_create_table() equivalent.



On Sun, 2006-08-27 at 11:00 +0200, Vivien Malerba wrote:
On 8/27/06, Bas Driessen <bas driessen xobas com> wrote:
>
>  Hello,
>
>  I noticed that functions like gda_connection_create_table() have been
> removed recently. This now should go through a new GdaServerOperation. Is it
> possible to give an example of how I would create a table now? I used
> function calls like this:
>
>  gda_connection_create_table(connection, table_name,
> columns, NULL)
 >
>  What would the equivalent be with this new GdaServerOperation? Any
> clues/examples?

Example to create a table. The idea is to ask a provider for a
GdaServerOperation for a given operation to perform, then set the data
in the GdaServerOperation (here from an XML string), and the ask the
provider to execute the operation. The parameters to be set for each
kind of operation is provider-dependant, but there is a common set
mentionned in the libgda doc (such as table name and columns to create
a table).

For more examples, have a look at src/util.c and src/ws-tables.c in
mergeant. You can use libgnomedb's GnomeDbServerOperation widget to
have a GUI to enter the necessary parameters for a given
GdaServerOperation.

[snip]

Thanks Vivien. I am starting with the easy ones (drop table, drop index) trying to start to understand the new concept. Regarding the drop index, the old call was as follows:

gboolean gda_connection_drop_index (GdaConnection *cnc,
                                             const gchar *index_name,
                                             gboolean primary_key,
                                             const gchar *table_name);

Where there was an argument called primary key to cater for the providers that do not allow the assignment of a name to a primary key. I can not find back that functionality in the new setup as per your table 7:

Table 7. 

Path Type Required? Description
/INDEX_DESC_P PARAMLIST Yes Index's description
/INDEX_DESC_P/INDEX_NAME PARAM Yes Index's name (string)
/INDEX_DEF_P/INDEX_ON_TABLE PARAM   Table on which the index is applied (string)
/INDEX_DESC_P/REFERENCED_ACTION PARAM   Action to perform for objects referencing the index to drop (CASCADE, RESTRICT, ...) (string)

Has this feature been dropped, forgotten about or do I misinterpret the table?

Thanks,
Bas.



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