[gnome-db] table modifications API
- From: Rodrigo Moya <rodrigo gnome-db org>
- To: GDA <gnome-db-list gnome org>
- Subject: [gnome-db] table modifications API
- Date: Sun, 23 Nov 2003 20:09:45 +0100
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]