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



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.

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.

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?

For the test I used the latest developer release version 1.1.4 of libGDA

--
Regards,
Ferenc




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