0

I created the following event in Firebird 2.5

CREATE TRIGGER neworc FOR ORC AFTER INSERT POSITION 0
AS
BEGIN
  POST_EVENT 'new_orc';
END

I would like to know if there is a way for me to listen for this event in my node application. I installed the node-firebird package and created the code below, but it didn't work.

Firebird.attach(options, function(err, db) {
    if (err)
        throw err;

    db.on('new_orc', function(result) {
        console.log(result);
    });
});
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Eduardo
  • 1,698
  • 4
  • 29
  • 48

1 Answers1

2

The documentation of node-firebird does not mention Firebird events. The on function only seems to be for node-firebird specific connection events ("attach, detach, row, result, transaction, commit, rollback, error, etc."), and not for Firebird events.

In other words, it looks like you cannot listen for Firebird events using node-firebird.

The drivers of https://github.com/asfernandes/node-firebird-drivers seem to support events (e.g. see this test), but this library is severely underdocumented.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197