In the project I’m working on, database queries that were run are saved to a different database. Presently, the statements are prepared manually, but that allows for the exact query to get stored as a log of sorts
Is there a way to update this to prepared statements (runPrepQuery) and get the compiled statement easily? Is there any sort of tracing available?
You can also set the Gateway.Database.Updates (or Selects) loggers to TRACE to get every database event that’s going through Ignition’s connection pooling. On a busy system, that can obviously be quite a lot.
When storing the queries that were sent to the database, the user information is stored as well, which is the beauty of this method… INSERT INTO queryLog (userName, query) kind of thing. So while using the database’s built in method would normally be my go-to, since Ignition is just one user to the database this method makes sense
I just wish I could get us off of manually preparing queries. Perl’s DBI module, for instance, has a method to show you the specific trace event for the latest query you ran with your DBI object. It’s part of what gets returned