sqltabs
sqltabs copied to clipboard
Macros on selection
It would be nice to have macros run on a selection/block, similarly as it's done in pgadmin.
I actually never used pgAdmin longer than for 5 mins :) so really don't know what do you mean. Could you elaborate on this a bit? In SQL Tabs you can select a certain area of the script and run it. It always works so that if there is a selected area then it executes a selection, if no selection then executes a block or entire script, depending on what shortcut you pressed.
sure: http://www.pgadmin.org/docs/1.8/macros.html
$SELECTION$ is replaced by the selected block and one can put some sql to execute it, useful to do i.e. select * from ($SELECTION$) s limit 10; select * from ($SELECTION$) s tablesample bernoulli(5) limit 100 select runyourfunctiononselection($SELECTION$) explain $SELECTION$ explain analyze $SELECTION$ etc. each macro has a key assigned so it's a matter of a keystroke to rerun it.
In addition it would be nice to remove semicolon if it happens to be included in the selection by accident.
OK, I see what you mean. I think this is related to Snippets https://github.com/sasha-alias/sqltabs/issues/13 If it will be like pgadmin macros or texteditor snippet depends on implementation once we get there.