On 26 March 2014 11:03, Steven Blatnick steve8track@yahoo.com wrote:
In the mean time...
The plugin I've been working on (external-toolhttps://github.com/sblatnick/geany-plugins/tree/external-tools/external-tools/src) *already allows you to run sql* *with a keyboard shortcut*. You would just have to write a simple bash script and it can take whatever is currently highlighted or the current document and output the results to the bottom panel as text. Eventually, I'm planning on adding a table to the potential output for the plugin. Using this method would allow you to decide if you output to a buffer (copy-able) or to a table, since there seems to be differences of opinions on what would be correct behavior.
At the very least, my plugin would be a good starting point for an SQL-specific plugin.
Here is my plugin "in action":
Here is the kind of script you could use:
#!/bin/bash echo "$GEANY_SELECTION" > /tmp/temp.sql mysql -hdatabase -uroot -ppassword < /tmp/temp.sql > /tmp/output.csv cat /tmp/output.csv
I hope this helps,
Steve
Steve,
Nice.
Of course it would be unlikely that the client id would be a literal in the code, thats why my suggestion that the user needs to be able to edit the selection before it is sent to the db.
Cheers Lex
PS also reminds me of http://xkcd.com/327/ :)