[gnome-db] Completed record set for MySQL and PostgreSQL.



Hello,

Attached a patch against the latest HEAD. The patch includes the following:

MySQL
- Changed  recordset to use gda_data_model_array, rather than gda_data_model_base to simplify implementation.

- Added functionality update_row, remove_row and fixed append_row. The array implementation is such that it only reads the number of records in the data model up to the row number requested. So as soon as a remove_row or append_row is requested all remaining records in the mysql result set will first be placed into the data model.

- implemented only for GDA_COMMAND_TYPE_TABLE, so you have to trigger something similar as this for init: "command = gda_command_new(buffer, GDA_COMMAND_TYPE_TABLE, GDA_COMMAND_OPTION_STOP_ON_ERRORS);"

- If I append a row and then try to update it, I do not have access to the original values in the MySQL result set, since it is not there. Therefore, I have no way of checking if the user is trying to modify a unique index value. We can either solve that on data-model level, where the user can not even the change the value of a field linked to a unique index, or we can go the easy way and make it the user's responsibility not first to check the the changed values before triggering the update_row command.

As a comment, I see that most providers are copying the MySQL implementation regarding recordset. If we can make the one for MySQL a perfect example, hopefully maintainers of other providers will follow as well.

PostgreSQL:

- Changed append_values method to append_row method. (new method introduced by Vivien this weekend)
- minor fixes.

Please let me know any issues/concerns or OK to rollin. The changes are way to much to keep track of a 1.2 version, so I have dropped that idea and will only focus on the HEAD now.

Thank you,
Bas.



Attachment: recset.head.patch.gz
Description: GNU Zip compressed data



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