I am looking for a tool or library for Rails to check / parse queries, which can be SQL and / or DDL. Currently, I have not found anything that I could use quickly and easily.
I found a Parslet that I can use to define my own SQL / DDL language to validate SQL / DDL statements.
The goal is to have a tool that we can use to check SQL / DDL syntax before any run in the database. For example, DDL queries are not transactional with MySQL, and therefore, if one statement fails in the middle of a larger script, we need to restore the database or run the script from the point of failure (which is not very convenient for the user), if we can, at least check the syntax, we will improve our daily work by removing a lot of "silly" errors.
source share