I use PMA to "write" a lot of queries for me, and by that I mean i will use PMA to build a table, then copy the SQL to another insall of PMA on a production server, and execute it there.
Other times I might want to change a column type, or change a column's collation / keys or something of the like which might take several minutes [I have large tables] and the page times out.
Usually PMA will display the SQL it executed afterwards, except on very long queries and pages which time out, so:
I'd love to have a checkbox that says, "Preview SQL" before PMA executes the query. This would only apply to queries which PMA helps automate for us [like building tables, index tweaks, column changes].
Sometimes I don't want to _run_ the SQL, just have PMA spit it out for me so I can batch it at a later time :-)
Where do you suggest to place this checkbox?
I was thinking:
Alongside the "[Delimiter] Show this query here again" on the SQL tab.
Maybe a "Preview SQL" button on db_structure / tbl_structure pages.
It gets a little tricky when implementing it in places like when deleting indexes or using the Empty / Drop tabs.
Hello Marc,
Would it be wise to generate the query for previewing purpose on the client side only rather than getting it generated from server ?
IMO this would be too much coding for nothing. phpMyAdmin already generates the query, it's only a matter of offering it for preview instead of running it.
Implemented with https://github.com/phpmyadmin/phpmyadmin/pull/1209.