<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 26 March 2014 11:03, Steven Blatnick <span dir="ltr"><<a href="mailto:steve8track@yahoo.com" target="_blank">steve8track@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
In the mean time...<br>
<br>
The plugin I've been working on (<a href="https://github.com/sblatnick/geany-plugins/tree/external-tools/external-tools/src" target="_blank">external-tool</a>)
<b>already allows you to run sql</b> <b>with a keyboard shortcut</b>.
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.<br>
<br>
At the very least, my plugin would be a good starting point for an
SQL-specific plugin.<br>
<br>
Here is my plugin "in action":<br>
<br>
<blockquote><img src="cid:part2.02010702.08010908@yahoo.com" alt=""></blockquote>
<br>
Here is the kind of script you could use:<br>
<blockquote><font face="Courier New, Courier, monospace">#!/bin/bash<br>
echo \"$GEANY_SELECTION\" > /tmp/temp.sql<br>
mysql -hdatabase -uroot -ppassword < /tmp/temp.sql >
/tmp/output.csv<br>
cat /tmp/output.csv<br>
</font></blockquote>
I hope this helps,<br>
<br>
Steve<div><div class="h5"><br></div></div></div></blockquote><div><br></div><div>Steve,</div><div><br></div><div>Nice.</div><div><br></div><div>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.</div>
<div><br></div><div>Cheers</div><div>Lex</div><div><br></div><div>PS also reminds me of <a href="http://xkcd.com/327/">http://xkcd.com/327/</a> :)</div></div></div></div>