Picture of Anton
Registered 5 years 116 days
Anton Thursday, 12 May 2022, 08:39 AM
Using the SqlMonitor
Hi,

I'm trying to use the SqlMonitor feature, but somehow it is not working. I don't understand why.
Here is part of my Code:

statement in config.json:

        "cmd": "statement",
        "name": "add-entry",
        "query": "INSERT INTO table (sip, guid, entry) VALUES (%s,%s,%s) RETURNING id",
        "args": {
          "@sip": { "type": "string" },
          "guid": { "type": "string" },
          "text": { "type": "string" }
        },
        "monitor": "monitorinsert"
      },

In the app js file I use:

        app.send({ mt: "SqlMonitor", name: "monitorinsert" });


If I'm understanding it correctly. Everytime some other user (including me on another device?) is using the Sql statement i should get a websocket update of the statement used.
But other than sending the monitor request nothing happens.

Can somebody help me =)

Regards
Anton
Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Thursday, 12 May 2022, 05:15 PM
1 of 1 users consider this post helpful
Re: Using the SqlMonitor
Hello Anton,

make sure to provide any src property with the SqlMonitor message, since it is required here.

{ mt: "SqlMonitor", name: "tasks", src: "app_connected" }

Best Regards
Andreas Fink
Picture of Anton
Registered 5 years 116 days
Anton Friday, 13 May 2022, 12:50 PM
Re: Using the SqlMonitor
Thanks a lot, Andreas.

It works now
← You can define your color theme preference here