How about being able to add a trigger to the Database?

CREATE TRIGGER db_inserts INSERT ON
DATABASE|{database_name}
BEGIN
  ....
END

--- Chris Waters <[EMAIL PROTECTED]>
wrote:
> Hi,
> 
> I need the ability to tell if changes have been made
> in the database. Kind
> of like the LISTEN capability in Postgresql. In
> particular I need to know
> if:
> 
> * A row was inserted.
> * A row was deleted.
> * A row was modified.
> 
> I would like to implement this through a callback
> that an application could
> register. The callback would specify the operation
> that was performed, the
> affected table and maybe the rowid affected.
> 
> If the rowid is reported then for operations that
> affect a large number of
> rows there would be a performance penalty to call
> the callback per row. For
> my application this is not a problem, but perhaps
> when the callback is
> specified the application could indicate whether it
> wants per row, or per
> table notification.
> 
> I am looking for ideas on where I should hook into
> the source code to add
> this functionality. From what I have seen so far it
> looks like I could
> change the implementation of the Delete and
> MakeRecord VM instructions to do
> the callback.
> 
> I haven't thought through the timing implications
> yet. Ideally when a row is
> inserted, code in the callback could query the newly
> inserted row. I am not
> 100% sure at what point the row becomes visible for
> query.
> 
> I would welcome any insight since this is my first
> attempt (of many I have
> lots of features I want :-) to modify the sqlite
> code.
> 
> Thanks,
> 
> Chris.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to