Database change lazarus / 16-Databases ---------------------------------------------------------------------- pcurtis · 2021-01-19 19:59 Hi All, whats the best / correct way to be informed of changes to a DB / dataset? I use Zeos and Sqlite Thanks in advance. ---------------------------------------------------------------------- Zvoni · 2021-01-20 07:04 sqlite itself has a notification callback https://sqlite.org/c3ref/update_hook.html ---------------------------------------------------------------------- madref · 2021-01-20 08:03 When ever I use a form that has data from my database I use a query to get the specific data I need from that database. When that query has changed I update it. To check if the query is changed I use Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   if TQ_Evaluatie.State in [dsEdit, dsInsert] then  begin    TQ_Evaluatie.Post;    TQ_Evaluatie.ApplyUpdates;    if Form_Lint.Trans_RefereeDB.Active then      Form_Lint.Trans_RefereeDB.CommitRetaining;  end; ---------------------------------------------------------------------- cdbc · 2021-01-20 09:09 Hi Implement the Observer pattern... It is built in, in the LCL (TObserved) in TPersistent You only need to build an Observer, with one method If need be, "steal" the implementation of TObserved in TPersistent and put it in your db-code  Two small classes with enormous effect. HTH Regards Benny ---------------------------------------------------------------------- pcurtis · 2021-01-20 10:33 @zvoni - any idea how to implement this in laz / fpc? ---------------------------------------------------------------------- Zvoni · 2021-01-20 12:31 Quote from: pcurtis on January 20, 2021, 11:33:55 am@zvoni - any idea how to implement this in laz / fpc? Probably as a class-helper for sqlite3conn (never worked with Zeos). You should check first if the external function is already declared available in sqlite3conn (at least that's the place i would look in) The link describes the prototype of the Function which acts as a "Event"-Handler. From there......