[Squirrel-sql-develop] Re: [Squirrel-sql-users] sql history

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[Squirrel-sql-develop] Re: [Squirrel-sql-users] sql history

Rob Manning
Richard Vanhook wrote:

> Thanks for the response Rob, I really appreciate it.  The history
> feature you mentioned will definitely help out.  However, let me
> refine my question a little bit - the history I was referring to would
> be a history log that is maintained for the life of the install.  For
> example, if I installed squirrel, ran query A, shut down and re-opened
> squirrel, is there a way to access query A?  I previously used another
> sql editor called QueryMan (I think it was an NCR product) and it
> maintained a log of every single query that was ran including the
> time, connection params, rows returned, and time taken.  If squirrel
> doesn't currently have this feature, what do you believe is the
> feasibility of something like this being implemented?  If its low, is
> there any way I could contribute?


SQuirreL keeps the history of SQL statements that you have executed in a
located in <user.home>/.squirrel-sql/sql_history.sql.  It's not exactly
what you
have specified, nor is it intended to be (it shouldn't contain
duplicates)  You
should add a feature request for this "audit log" feature you need here :


I'm not sure when we'll be able to implement it, but patches are always
welcome :)
Take a look at the ISQLExecutionListener interface in the app module.  
It will
have to be modified to give more info when a statement is executed, such
as exec time,
session (It currently only gives the SQL statement).  Also, I would lean
implementing this feature as a plugin which could allow a user to
configure where
the history log resides, when to rotate it, format, etc.  In the plugin
you would register as a listener to the SQLPanelAPI, which you can get a
to from using the Session method getSQLPanelAPIOfActiveSessionWindow.
Take a look at the other plugins' initialization code for reference.
This is usually
contained in the plugin "main" class which is named <plugin
name>Plugin.  Most
plugins focus on the ObjectTreeAPI, so there may not yet exist a
"template" plugin
that you could use. The Example plugin is pretty small and easier to
understand than the others. If you need any other pointers to get
started or help
along the way, just send an email to the developers list.


This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
Squirrel-sql-develop mailing list
[hidden email]