简体   繁体   English

在 Node.js 上监听 Firebird 事件

[英]Listening to Firebird events on Node.js

I created the following event in Firebird 2.5我在 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.我安装了 node-firebird 包并创建了下面的代码,但是没有用。

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

    db.on('new_orc', function(result) {
        console.log(result);
    });
});

The documentation of node-firebird does not mention Firebird events. node-firebird的文档没有提到 Firebird 事件。 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. on函数似乎仅适用于节点火鸟特定的连接事件( “附加、分离、行、结果、事务、提交、回滚、错误等” ),而不适用于 Firebird 事件。

In other words, it looks like you cannot listen for Firebird events using node-firebird.换句话说,您似乎无法使用 node-firebird 侦听 Firebird 事件。

The drivers of https://github.com/asfernandes/node-firebird-drivers seem to support events (eg see this test ), but this library is severely underdocumented. https://github.com/asfernandes/node-firebird-drivers的驱动程序似乎支持事件(例如,请参阅此测试),但该库的文档记录严重不足。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM