Issue179

Title (datasources) support for primary keys set in a backend trigger
Priority planned feature Status testing
Superseder Nosy List johannesV, reinhard
Assigned To johannesV Topics gnue-common

Created on 2007-07-18.13:32:28 by reinhard, last changed 2007-09-26.14:29:48 by johannesV.

Messages
msg434 (view) Author: johannesV Date: 2007-09-26.14:29:48
Improved handing of row-id-fields.  Do not automatically add 
row-id-fields or primary-key-fields to read-only resultsets. (rev 9783)
msg421 (view) Author: reinhard Date: 2007-07-18.13:32:27
Currently, primary keys may only be changed in a backend trigger if the database
supports a rowid - otherwise there would be no possibility to re-read the
correct record.

However, some backends (at least MySQL) seem to return the sequence value used
for the primary key on the INSERT statement.

The curernt solution of defining these kinds of primary keys as "rowid" in the
datasource definition is not good because it's not portable: the correct
definition of the datasource depends on whether the backend supports real rowids
or not.

A better solution might be to test whether the INSERT statement returns any
value, and if yes, AND the backend doesn't have rowids, AND the primary key is a
single field AND the primary key was NULL for the inserted record, assume the
return value of the INSERT statement as the new value of the primary key.

This would need testing on the different backends.
History
Date User Action Args
2007-09-26 14:29:48johannesVsetstatus: unread -> testing
messages: + msg434
2007-07-18 13:32:28reinhardcreate