Kate SQL Plugin
Text Editors
Score 76%
Description:

This is a plugin that transform Kate into a simple, light, versatile and useful SQL client.
It take the advantages of the Qt Sql module to allow you to open connections with all supported SQL drivers (MySQL, PostgreSQL, SQLite, ODBC, etc...) and easily launch queries on database. Some of the main features:
- supports all Qt Sql drivers
- manage multiple connections simultaneously
- provides an integrated viewer for SELECT statements
- a simple wizard to export query results in csv file
- provides a basic schema browser for views, tables and fields with primary keys

(Tested on Linux and Windows with MySQL, SQLite and ODBC drivers)

Important:
KateSQL was moved to svn.kde.org , under /trunk/KDE/kdesdk/kate/plugins/katesql/ , and to kate git repository hosted on gitorious.org


Therefore, KateSQL is available on the latest KDE trunk.

Build instructions:
---------------------
If your distribution does not provide the kate development package with libkateinterfaces, you need to compile Kate from sources.
Please follow these steps from the official Kate wiki: http://gitorious.org/kate/pages/Building Kate .

QtSql with development libraries is required.

Note:
---------
If you can\'t see your preferred driver in the new connection wizard, you need to install the appropriate qt driver package and restart kate. (eg. on debian: libqt4-sql-mysql, libqt4-sql-odbc ... )

When you press the Run Query button, all selected text (or all text in the current document if none selected) is executed in an sql query. Pay attention! DELETE and DROP statements are tremendously rapid and destructive.

There are a lot of features planned for future releases, like parameters recognition, support for multiple queries, configurable fonts and colors for outputs.

If you have questions or you need to report a bug, please send an email to marcomentasti@gmail.com or report to bugs.kde.org.

Any suggestions are appreciated.
Last changelog:

7 years ago

0.2 - 22/07/2010
- table fields added to schema browser
- configuration parameters to change output colors
- save/restore last used connection
- improved performance exporting data
- fixed bugs
0.1 - 05/07/2010
- select results are now displayed with default system font.
- fixed incorrect export behavior.
- added possibility to export column names and line numbers.
- added context menu to data output, to quickly export/copy selected cells.

0.1-RC1 - 29/06/2010
- preview release

otzy007

6 years ago

What happend to the plugin? Is it still developed? It seems that it doesn't exist anymore on the kde anonsvn

Report

C

MMentos

6 years ago

Yes, this plugin is alive, and must be included in KDE >= 4.6.0.
Or you can find latest sources in kate repository hosted on git.kde.org (https://projects.kde.org/projects/kde/kdebase/kate/repository/revisions/master/show/kate/plugins/katesql).
Follow this guide to get more information on how to build kde from sources (http://kate-editor.org/get-it/).
Thanks for your interest

Report

BastianBalthazarreBux

7 years ago

It's a really nice start, it would be even greater with the following:

resizeable panel for SQL Output
Using the same font as the window, may be with possibility to select a different one
support for multiple query with one selection
parameters in query for example like python %(param)s. When the query is executed the parameter will be asked with a dialog.


Report

C

MMentos

7 years ago

Hi Bastian,
- what do you mean with "resizable panel"? all kate panels are resizable by default (the splitter is between the statusbar and the panel).

- ok, i will restore the the normal font by default. the possibility to configure fonts and colors for blobs and nulls is already planned for the next release

- multiple query support is provided internally by the sql driver. mysql supports multiple queries putting a ; after each query, odbc not. But i can try emulate this behavior parsing text with a regexp, and detect queries manually. Good idea?

- yesss, i already have this idea. also, with a possibility to enter parameters manually or from an input file (for multiple insert statements, for example).

Really thanks for your suggestions!

Report

BastianBalthazarreBux

7 years ago

Hi Bastian,
- "resizable panel"? <<< My Bad :p

- ok, i will restore the the normal font by default. the possibility to configure fonts and colors for blobs and nulls is already planned for the next release <<< yay

- multiple query support is provided internally by the sql driver. mysql supports multiple queries putting a ; after each query, odbc not. But i can try emulate this behavior parsing text with a regexp, and detect queries manually. Good idea?
<<< Actually you will need to parse anyway to grab the parameters right? then it could be a good idea, otherwise the complexity added is not worth it. For example phpMyAdmin botch it some times and it's a mature project.
Actually I've tried with a QMYSQL connection, it give me the error:

30 Jun 2010 09:59:59: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM tab_users' at line 2 QMYSQL3: Unable to prepare statement

with this text selected:
UPDATE tab_users set id = 1231231231 where id = 1231231231;
SELECT * FROM tab_users;


One strange thing is that the class who give the error is QMYSQL3 when I've used a QMYSQL connection, maybe it's only inherited or maybe it's a bug

- yesss, i already have this idea. also, with a possibility to enter parameters manually or from an input file (for multiple insert statements, for example). <<< yay

Really thanks for your suggestions!
... and to you for this plugin

Report

milianw

7 years ago

hey, really cool :)

if you polish it more, you can get this upstream into kdelibs, so that it can be pushed to the masses with 4.6.

Contact us developers at kwrite-devel@kde.org and/or #kate on freenode IRC.

Hope to hear from you, bye

Report

rADOn

7 years ago

I have been waiting for this for a looong time. Thank you.

Report

freinhard

7 years ago

Thank you so much for that plugin! Built and works!

Report

locke87

7 years ago

I really like your effort. That's really improving my workflow when I don't have to login on a remote phpmyadmin :)

Report

7 years ago

0.2 - 22/07/2010
- table fields added to schema browser
- configuration parameters to change output colors
- save/restore last used connection
- improved performance exporting data
- fixed bugs
0.1 - 05/07/2010
- select results are now displayed with default system font.
- fixed incorrect export behavior.
- added possibility to export column names and line numbers.
- added context menu to data output, to quickly export/copy selected cells.

0.1-RC1 - 29/06/2010
- preview release

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
Details
version
0.2
updated Jul 22 2010
added Jun 28 2010
downloads today
0
page views today 1