pg-monitor | : computer : Events monitor for pg-promise | Runtime Evironment library
kandi X-RAY | pg-monitor Summary
kandi X-RAY | pg-monitor Summary
This library takes the flexible event system provided by [pg-promise] and outputs it on screen, with full details available, and in the most informative way. Its purpose is to give you the full picture of how the database is used in your application, providing full details with the context, such as tasks and transactions in which queries are executed. In addition, it simplifies [events logging] #log) for your application.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Print a message .
- Gets the tag name from the given event object .
- Format a duration in milliseconds .
- Writes data to a JSON string .
- Pads value with zeros
- Remove colors from text
- Format a time object .
- Determine if value is null
pg-monitor Key Features
pg-monitor Examples and Code Snippets
Community Discussions
Trending Discussions on pg-monitor
QUESTION
I am using pg-promise package with Nodejs to execute PostgreSQL queries. I want to see the queries executed. Only specific queries, say, just one query that I want to debug.
I can see that one recommended way is to use the pg-monitor to catch the events and log them as mentioned here in the examples documentation.
Without using pg-monitor, is there a simple way to just print the prepared query that is executed. I can't see it in the docs.
Example:
...ANSWER
Answered 2018-Jun-18 at 17:37is there a simple way to just print the prepared query that is executed...
A query in general - yes, see below. A Prepared Query - no, those are by definition formatted on the server-side.
QUESTION
I'm writing an API that does queries over multiple postgres databases using node and pg-promise.
I'm interested in getting the executed SQL statement from query result. Something like pg-monitor outputs to console. I've set up pg-monitor and noticed there is a setLog
method which I can use to get the data I need, but it would be perfect if I could get the same data from the place I'm executing the query from.
Point of this would be to enable the API to return both the query results and the metadata like the executed SQL. Is this possible? Thanks!
...ANSWER
Answered 2018-Apr-02 at 16:52it would be perfect if I could get the same data from the place I'm executing the query from.
In this case you can format the query yourself, log it and then pass it into the query method:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pg-monitor
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page