Page 1 of 1

Feature request detect dataset changes

Posted: 20.07.2016, 12:46
by DPStano
imagine that you make query like 'SELECT author from authors where author = 'Foo''; // Modified and PendingUpdates is False

now call dataset.fieldbyName('author').asString = 'Foo' // Modified and PendingUpdates is True now

and when you call dataset.Post-> it will produce no query, it would be nice to be able detect changes that will produce queries something like

Code: Select all

IZCachedResultSet -> HasPhysicalChanges 

function TZAbstractCachedResultSet.HasPhysicalChanges():boolean
begin
 // will compare detect changes based on OldRowAccessor, NewRowAccessor comparation 
end

function TZAbstractDataset.HasPhysicalUpdates: Boolean;
begin
  if State = dsInactive then
    Result := False
  else if (CachedResultSet <> nil) and CachedResultSet.HasPhysicalChanges then
    Result := True
  else if (State in [dsInsert, dsEdit]) then
    Result := Modified
  else
    Result := False;
end;

Re: Feature request detect dataset changes

Posted: 16.09.2016, 16:29
by marsupilami
Hello - the problem here is that Zeos (currently) doesn't use its own set of TFields. So we are limited to the things that Delphi enables us to do.