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.
Cheers, Frank
+1
do you think a simple text console (as mysql cli client) or some kind of graphics?
On Mon, Mar 24, 2014 at 9:47 AM, Frank Lanitz frank@frank.uvena.de 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.
Cheers, Frank _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Am 24.03.2014 13:25, schrieb Federico Reghenzani:
+1
do you think a simple text console (as mysql cli client) or some kind of graphics?
Well, I was thinking about adding some more magic to the editor widget and adding two more widgets for messages and results. But in fact, my mail was to question, what you and all the orther might expect from it ;)
Cheers, Frank
I wrote an sql plugin for gedit a while back which was based on my experience with Microsoft's SQL client. Basically the approach I took, and I think this would work for geany as well, was:
1. Manage various connections to databases and allow switching between the connections - the connection is global to geany (Actually, I think my first plugin only allowed one connection, and later when I tried to remake the plugin for gedit3, I allowed multiple connections to be managed) 2. Run queries from any open document by highlighting them and using some keyboard shortcut and/or button 3. Display the results in a scrollable gtk table in the bottom pane. This was especially beneficial as the ASCII presentation from the command line is hard to see when it starts wrapping.
That would be a reasonable minimum. We could extend it from there to:
1. Show tables in the current database on the side panel, expandable to show the columns 2. Allow editing of the cells in the table output
Some further thoughts:
1. I used SQLAlchemy for my gedit plugin (it was in python) because it allowed connecting to various SQL databases such as MySQL, PostgreSQL, etc 2. If there is a way to make the output in a table on a separate thread to not lock the UI, that would be good for larger result sets. We could at least create some optional built in limit of how many results. 3. A way to kill the query in progress would be good
Thanks,
Steve
On 03/24/2014 06:25 AM, Federico Reghenzani wrote:
+1
do you think a simple text console (as mysql cli client) or some kind of graphics?
On Mon, Mar 24, 2014 at 9:47 AM, Frank Lanitz <frank@frank.uvena.de mailto:frank@frank.uvena.de> 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. Cheers, Frank _______________________________________________ Devel mailing list Devel@lists.geany.org <mailto:Devel@lists.geany.org> https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On 25 March 2014 03:12, Steven Blatnick steve8track@yahoo.com wrote:
I wrote an sql plugin for gedit a while back which was based on my experience with Microsoft's SQL client. Basically the approach I took, and I think this would work for geany as well, was:
Manage various connections to databases and allow switching between the connections - the connection is global to geany (Actually, I think my first plugin only allowed one connection, and later when I tried to remake the plugin for gedit3, I allowed multiple connections to be managed) Run queries from any open document by highlighting them and using some keyboard shortcut and/or button
IMO it would be better if the query was copied to an editable (pane/entry) since whenever I have sql in code it usually has part of the query generated by code and this would need interpolating for the query to make sense at edit time.
Display the results in a scrollable gtk table in the bottom pane. This was especially beneficial as the ASCII presentation from the command line is hard to see when it starts wrapping.
Or a separate editor buffer??
That would be a reasonable minimum. We could extend it from there to:
Show tables in the current database on the side panel, expandable to show the columns
Editable if supported by the underlying database, what about creating tables as well?
Allow editing of the cells in the table output
Which is where outputting to the edit buffer helps, save means commit changes?
Some further thoughts:
I used SQLAlchemy for my gedit plugin (it was in python) because it allowed connecting to various SQL databases such as MySQL, PostgreSQL, etc If there is a way to make the output in a table on a separate thread to not lock the UI, that would be good for larger result sets. We could at least create some optional built in limit of how many results. A way to kill the query in progress would be good
In current Geany thats best handled as a subprocess, which is also a good way of handling multi-database configurability, just run the command for the particular database.
Cheers Lex
Thanks,
Steve
On 03/24/2014 06:25 AM, Federico Reghenzani wrote:
+1
do you think a simple text console (as mysql cli client) or some kind of graphics?
On Mon, Mar 24, 2014 at 9:47 AM, Frank Lanitz frank@frank.uvena.de 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.
Cheers, Frank _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On Tue, 25 Mar 2014 07:46:49 +1100 Lex Trotman elextr@gmail.com wrote:
On 25 March 2014 03:12, Steven Blatnick steve8track@yahoo.com wrote:
I wrote an sql plugin for gedit a while back which was based on my experience with Microsoft's SQL client. Basically the approach I took, and I think this would work for geany as well, was:
Manage various connections to databases and allow switching between the connections - the connection is global to geany (Actually, I think my first plugin only allowed one connection, and later when I tried to remake the plugin for gedit3, I allowed multiple connections to be managed) Run queries from any open document by highlighting them and using some keyboard shortcut and/or button
IMO it would be better if the query was copied to an editable (pane/entry) since whenever I have sql in code it usually has part of the query generated by code and this would need interpolating for the query to make sense at edit time.
Well... in my mind I had also something more, Steven suggested. Mark a query and execute it. The reason why I want such a support is, that I don't want to copy queries e.g. to pgadmin
Display the results in a scrollable gtk table in the bottom pane. This was especially beneficial as the ASCII presentation from the command line is hard to see when it starts wrapping.
Or a separate editor buffer??
Well... also possible. Do you need some editor features on that buffer?
That would be a reasonable minimum. We could extend it from there to:
Show tables in the current database on the side panel, expandable to show the columns
Editable if supported by the underlying database, what about creating tables as well?
CREATE TABLE "foo"; should be not too complicated for everyone in first step IMHO.
Allow editing of the cells in the table output
Which is where outputting to the edit buffer helps, save means commit changes?
Well... This is something, I was thinking of not having -- at least on versions. I just don't think it's needed to often by a developer. And everyone else could use pgadmin/phpmyadmin/*
Some further thoughts:
I used SQLAlchemy for my gedit plugin (it was in python) because it allowed connecting to various SQL databases such as MySQL, PostgreSQL, etc If there is a way to make the output in a table on a separate thread to not lock the UI, that would be good for larger result sets. We could at least create some optional built in limit of how many results. A way to kill the query in progress would be good
In current Geany thats best handled as a subprocess, which is also a good way of handling multi-database configurability, just run the command for the particular database.
I second that there should be a blocking UI when running a query -- by using the geany api it should be not often the issue anymore.
Cheers, Frank
[...]
I guess for my vision of this sort of database development UI tool I am channelling my secret shameful past use of Microsoft Access, whilst lots of it was bad, some of its interactive stuff was kind of useful :)
IMO it would be better if the query was copied to an editable (pane/entry) since whenever I have sql in code it usually has part of the query generated by code and this would need interpolating for the query to make sense at edit time.
Well... in my mind I had also something more, Steven suggested. Mark a query and execute it. The reason why I want such a support is, that I don't want to copy queries e.g. to pgadmin
Suggestion was *in addition* to just executing marked queries. Sure if the whole query exists in the source in executable form, just highlight it and execute. But as soon as something is being interpolated into it, (the "interesting" queries that I would want to try out) then it can't be executed at edit time unless the user can do that interpolation.
Display the results in a scrollable gtk table in the bottom pane. This was especially beneficial as the ASCII presentation from the command line is hard to see when it starts wrapping.
Or a separate editor buffer??
Well... also possible. Do you need some editor features on that buffer?
See below :)
Also you can cut and paste out of an edit buffer, but you can't from trees.
That would be a reasonable minimum. We could extend it from there to:
Show tables in the current database on the side panel, expandable to show the columns
Editable if supported by the underlying database, what about creating tables as well?
CREATE TABLE "foo"; should be not too complicated for everyone in first step IMHO.
Ummm, I was thinking of defining the columns too :) and for use during development it would be nice if it did the drop and re-create if the table already existed, or modified the columns if supported by the particular database. And maybe transferred the existing contents too :)
Allow editing of the cells in the table output
Which is where outputting to the edit buffer helps, save means commit changes?
Well... This is something, I was thinking of not having -- at least on versions. I just don't think it's needed to often by a developer. And everyone else could use pgadmin/phpmyadmin/*
Well, you did ask for suggestions :)
Anyway XXXadmin are specific tools, following on from Stevens comment, the Geany tools should be database independent. And editing data to correct the update you just tried would be useful.
Some further thoughts:
I used SQLAlchemy for my gedit plugin (it was in python) because it allowed connecting to various SQL databases such as MySQL, PostgreSQL, etc If there is a way to make the output in a table on a separate thread to not lock the UI, that would be good for larger result sets. We could at least create some optional built in limit of how many results. A way to kill the query in progress would be good
In current Geany thats best handled as a subprocess, which is also a good way of handling multi-database configurability, just run the command for the particular database.
I second that there should be a blocking UI when running a query -- by using the geany api it should be not often the issue anymore.
Well, good luck Frank, IIUC we can't even make modal dialogs block (at least on Unity and KDE :)
Cheers Lex
PS what about no-SQL databases, yeah I want everything ;-)
Cheers, Frank
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On Tue, 25 Mar 2014 08:45:21 +1100 Lex Trotman elextr@gmail.com wrote:
[...]
I guess for my vision of this sort of database development UI tool I am channelling my secret shameful past use of Microsoft Access, whilst lots of it was bad, some of its interactive stuff was kind of useful :)
Well, this is something at least /me will not build ;)
That would be a reasonable minimum. We could extend it from there to:
Show tables in the current database on the side panel, expandable to show the columns
Editable if supported by the underlying database, what about creating tables as well?
CREATE TABLE "foo"; should be not too complicated for everyone in first step IMHO.
Ummm, I was thinking of defining the columns too :) and for use during development it would be nice if it did the drop and re-create if the table already existed, or modified the columns if supported by the particular database. And maybe transferred the existing contents too :)
Puh. This sounds like a huge thing to be done. But well... should be possible some time.
Allow editing of the cells in the table output
Which is where outputting to the edit buffer helps, save means commit changes?
Well... This is something, I was thinking of not having -- at least on versions. I just don't think it's needed to often by a developer. And everyone else could use pgadmin/phpmyadmin/*
Well, you did ask for suggestions :)
Anyway XXXadmin are specific tools, following on from Stevens comment, the Geany tools should be database independent. And editing data to correct the update you just tried would be useful.
Yes.
Some further thoughts:
I used SQLAlchemy for my gedit plugin (it was in python) because it allowed connecting to various SQL databases such as MySQL, PostgreSQL, etc If there is a way to make the output in a table on a separate thread to not lock the UI, that would be good for larger result sets. We could at least create some optional built in limit of how many results. A way to kill the query in progress would be good
In current Geany thats best handled as a subprocess, which is also a good way of handling multi-database configurability, just run the command for the particular database.
I second that there should be a blocking UI when running a query -- by using the geany api it should be not often the issue anymore.
Well, good luck Frank, IIUC we can't even make modal dialogs block (at least on Unity and KDE :)
It depends where you are doing what ;) But yepp, ongoing topic.
PS what about no-SQL databases, yeah I want everything ;-)
Well.... even this mail is noSQL-database, right? ....
[...]
That would be a reasonable minimum. We could extend it from there to:
Show tables in the current database on the side panel, expandable to show the columns
Editable if supported by the underlying database, what about creating tables as well?
CREATE TABLE "foo"; should be not too complicated for everyone in first step IMHO.
Ummm, I was thinking of defining the columns too :) and for use during development it would be nice if it did the drop and re-create if the table already existed, or modified the columns if supported by the particular database. And maybe transferred the existing contents too :)
Puh. This sounds like a huge thing to be done. But well... should be possible some time.
Sure, but to my mind you need to add some value above the "CREATE TABLE foo; ". As you said anyone can use that, even me :)
[...]
PS what about no-SQL databases, yeah I want everything ;-)
Well.... even this mail is noSQL-database, right? ....
Ummm... I was thinking more about things like mongodb and couchdb and friends. They are very popular in some circles.
Cheers Lex
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On Mon, 24 Mar 2014 09:47:19 +0100 Frank Lanitz frank@frank.uvena.de wrote:
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.
I started to try to compile a wiki entry with ideas from this thread at https://wiki.geany.org/plugins/wishlist/sql-plugin Not yet complete, but will at some time ;)
Cheers, Frank
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
On 26 March 2014 10:33, Matthew Brush mbrush@codebrainz.ca 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.
Agree, thats the sort of UI I had in mind. Maybe with the (no)SQL command that would be used to do the edit being shown in a line across the bottom of the screen, where it can be copy and pasted into the code :)
Cheers Lex
Cheers, Matthew Brush
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
In the mean time...
The plugin I've been working on (external-tool https://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
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
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/ :)