In the mean time...
The plugin I've been working on (external-tool)
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
On 03/25/2014 05:33 PM, Matthew Brush
wrote:
On
14-03-24 01:47 AM, Frank Lanitz wrote:
Hi folks,
A often wished feature at our boothes at e.g. Chemnitzer Linux
Tage were
to have some kind of a SQL plugin for Geany, supporting
executing
queries at the database.
As I'm also looking for something like this, I'm wondering what
do you
think such a plugin should be able to do in some global view. I
don't
think we will be able to build up another MySQLWorkbench or
PGAdmin --
and this is also not my goal for a Geany plugin -- but most
likley more
than an execution of queries might would be useful.
This would be a good project for GeanyPy as it has all kinds of
modules to access various types of databases.
One idea for the UI would be to do like Devhelp plugin does to add
it's own help webview/notebook around Geany's, and then using
gtktreeview or some libgda stuff make a gridview type of thing
like is common in db/spreadsheet editors.
Cheers,
Matthew Brush
_______________________________________________
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel