What is a good query builder that can parse and rebuild SQL queries in PHP 5.3?

I do not want ORM. I am comfortable writing serious and optimized queries myself, and I don’t want any ORM to inflate my code.

I am looking for a lightweight, object-oriented query analyzer and builder that can convert an existing SQL string into a flexible query building object for further processing before recompiling and executing in the database.

The use case itself is updating queries that run against tables in a public schema that contain current valid information with replacement tables from the audit schema when adding predicates to the WHERE clause to represent time data (from substituted) of the real-time status table.

My other use case is to manipulate pre-written queries to provide additional filters before execution.

The analyzer / builder will allow me to write current queries, but it is easy to convert them to the equivalent of time. I am currently planning to raid Doctrine 2 QueryBuilderfor the recovery part. Does anyone know a great library for parsing SQL queries in their base components?

+3
source share
1 answer

It looked pretty good (I didn’t use it), but it is not PHP. You can run one server side of Java by calling PHP with exec () and possibly working in your script

http://www.sqlparser.com/

0
source

Source: https://habr.com/ru/post/1794526/


All Articles