Currently, we use ANTLR to be able to parse statements for detection of statement type, finding the target table name (for column names to add in the RETURNING clause), and detection of a RETURNING clause (to not add another one) for the generated keys facility. When the antlr4-runtime library is not on the classpath, generated keys support is not available.
Replacing the parser has the benefit of removing a dependency (on antlr4-runtime), and always availability of generated keys support. Potentially, the parser can also be reused in the future for parsing JDBC escapes.
Currently, we use ANTLR to be able to parse statements for detection of statement type, finding the target table name (for column names to add in the
RETURNING
clause), and detection of aRETURNING
clause (to not add another one) for the generated keys facility. When the antlr4-runtime library is not on the classpath, generated keys support is not available.Replacing the parser has the benefit of removing a dependency (on antlr4-runtime), and always availability of generated keys support. Potentially, the parser can also be reused in the future for parsing JDBC escapes.