Re: [gnome-db] understanding append, remove, update row in data models



On Sun, 2004-06-20 at 22:53 +0200, Szalai Ferenc wrote:
> Hi,
> 
> I'm using libGDA in my project but I have some unclear things in code. So
> I now would like to turn to you to understand these if you don't mind.
> 
> The main question is how to add remove and update data in data model 
> properly.
> I know there is gda_data_model_[append_row, remove_row, update_row]
> functions but I can't understand how would these functions should use.
> 
those functions are only available in 1.1.x, and the support is not
still complete :(

The idea is to do:
	* get data model
	* gda_data_model_begin_edit
	* gda_data_model_append/remove/update_row
	* gda_data_model_cancel/end_edit

> The situation is the following:
> 1. Created a Postgresql database using the
> https://einstein.ki.iif.hu/~szferi/libgda/test3.sql
> database definition (very simple)
> 
> 2. Created a simple appliation
> https://einstein.ki.iif.hu/~szferi/libgda/test3.c
> The allication connects database and creates query to test table.
> Afterwards, it try to modify data model by inserting new row.
> The problem is that this row can't be address correctly because the
> gda_data_model_get_n_rows gives differenet number of rows than the
> data model really containes.
> 
> The situation is clear: The get_n_rows has been implemented in postgres
> provider but the append_row has been implemented in GdaDataModelHash 
> which is
> a parent of GdaPosgresRecordset.
> 
yes, but it does not add the rows you add to the database, so, as I
said, it's still incomplete.

> The problem with remove_row is the same. The postgres provider doesn't
> implement remove_row function but the hash table implementation
> do nothing (always returns with FALSE).
> 
> In contrast of the situation described above the gda_data_model_update_row
> has been implemented in postgres provider and really updates the data in
> physical databases but doesn't do this in data model.
> 
> So I would like to ask what is the philosophy behind of these functionality
> and how should do this thinks correct? And/Or where is my mistake?
> 
it's still incomplete :( We would appreciate any help in finishing it.

cheers




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