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





On 8/28/06, Bas Driessen <bas driessen xobas com> wrote:


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?

The old API  was trying to be an API "one fits all", and the new way of doing things is that each provider explains what it requires for a given operation such as "create index" (this is the reason the GdaServerOperation is created by a provider).

The detailed information required in a GdaServerOperation after it has been created is accessible using the GdaServerOperation API, and when the provider is asked to perform the requested operation, it has all the information it requires (by construction). Each piece of information is accessible using a path like name such as the path column of the table above.

The table above lists the path of bits of information which will always or maybe present in a GdaServerOperation (depending on the value of the 3rd column). The idea is to "standardize" path names to avoid each provider to use its own naming conventions for the same thing.

For example when deleting an index, the name of the index will always be "/INDEX_DESC_P/INDEX_NAME" and will always be a string, moreover this bit of information will always be present in any GdaServerOperation returned by any GdaServerProvider for that operation. Now, the "/INDEX_DESC_P/INDEX_ON_TABLE" will be the table name the index is on and will only be present when the provider needs it (in this case MySQL) and otherwise it won't be present (like for PostgreSQL).

To understand better the whole thing, use the test-dyn-widgets program in the testing/ directory of libgnomedb with test nb 15 (test-dyn-widgets -t 15), select a provider, and a type of operation and note the differences between each provider. For more examples, go into each provider's directory and look at the *.xml.in files which list what each provider needs for each type of operation.

Cheers,

Vivien


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