Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add a DiagnosticsListener SPI #5960
This issue is for collecting ideas for a future SQL lint module, which collects some runtime statistics and emits hints about potential improvements in the generated SQL.
This module would be optional and could be turned on if required, but given the probably relatively high amount of data that needs to be collected, it shouldn't be turned on by default.
The module can work with jOOQ and/or JDBC directly, meaning that it can be used even in an application that otherwise doesn't use jOOQ.
These issues deal with problematic use of the jOOQ and/or JDBC API. In the case of JDBC, we'll proxy the API and collect statistics behind it.
SQL language misuse
These are relatively easy to do with jOOQ, where the expression tree is available for introspection. When using JDBC, we'll simply parse the SQL string into a jOOQ expression tree, and run the same logic again.
Moved to #7527
Initially, the data would be collected in the same process as the system running jOOQ / JDBC, but in a future version of this lint module, we'll be able to collect all of this data also through the JDK's instrumentation API and send it off to some external tool (hopefully with a nice UI), which allows for:
Communication could be done through JMX or other means. We'll look into this later.