[gnome-db] table modifications API



Hi

Another of the missing things in libgda is the ability to modify tables.
So, I am, thinking on adding functions for that for 1.2.

We've got 2 choices, one is to provide:

	* create_table (GdaFieldAttributes fields[])
	* drop_table (const char *table);
	* modify_table (const gchar *table, GdaFieldAttributes new_fields[],
GdaFieldAttributes changed_fields[]);

methods on the GdaServerProvider class.

The other choice is to have similar functions, but being generic, for
any schema (like the get_schema method). A good thing about this is that
we could make a nice use of the GdaDataModel updatable stuff (get_schema
returns a GdaDataModel) for the management of the schemas. That is, the
providers will have internal implementations of the data model class for
each schema:

GdaPostgresSchemaTables
GdaPostgresSchemaUsers
...

which it creates and returns from get_schema. Then, those data model
implementations could map the additions/removals/changes (made via
gda_data_model_append_row/update_row/remove_row) to CREATE/DROP/MODIFY
SQL commands [Note for Paisa *]

Any comments?

cheers

* Paisa, this is a good example of the batched updates I was talking
about. In that kind of data model implementations, we really dont want
to do one change at a time to the underlying database. For instance,
when dealing with tables' fields, you want to send the complete MODIFY
TABLE command with all fields, not one SQL command for each field. I
hope this helps you understand what I meant, and I'm sorry it didn't
come up to my mind before :-)




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