Re: Squirrel Read Only Access Feature

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

Re: Squirrel Read Only Access Feature

Robert Manning
You have correctly determined that this feature doesn't exist in the
manner that you have described.  It is very resourceful to think of
using the auto-correction feature - I'd say you get some extra points
for that :)

The "SQL Parametrisation" plugin alters SQL being executed to insert
values for "variables" that it finds in the SQL statements.  As each
statement is executed, it prompts the user for value(s) to variables
that it finds, then takes the user's value and inserts it into the
statement and allows the altered statement to be executed.  It
registers as an ISQLExecutionListener (if memory serves me correctly)
and gets a callback prior to executing the statement.  You should be
able to look at how this plugin is written and derive something that
intercepts SQL to achieve your needs.  Of course, you would also need
to have preferences that the plugin would read to determine which
sessions are to get this treatment.  Many of the plugins register an
IGlobalPreferencesTab implementation with GlobalPreferencesSheet, so
you should be able to find other examples to borrow from there as

One thing that you should probably recognize here is that disabling
this new read-only feature within SQuirreL and outside of SQuirreL
would be a trivial matter.  So, you are in effect only going to keep
"honest" people "honest".  Still, I do see a use for this as you've
described to keep people from "accidentally" modifying the data in the
wrong session.  I think this would be a very useful plugin for others
if you choose to write it.


On Nov 27, 2007 9:45 AM, Serbulent <[hidden email]> wrote:

> Message body follows:
> Hi Rob,
> I have posted the following regarding Squirrel.
> I would really appreciated your prompt reply. I would like
> to recommend Squirrel based on a simulated read only access
> feature.
> I will be happy to update my posting for requested feature
> based on your answer.
> Thanks and regards
> Buletn
> Sometimes it is not possible to define read only access to
> users at
> database level when the permissions are granted to the
> public on the
> objects.
> We would like to use Squirrel where we can define that only
> certain user(s)
> have full access to a database e.g. production database. All
> the other
> users will not be able to change the data in the
> database;i.e. simulated
> read-only access.
> Is there a way to achieve this?
> I tried the following
> 1- I have tried to configure the auto-correct feature that
> converts delete,
> update, insert to NoDeleteOnProduction etc. as a temp solution.
> However, it is listed under Session->Syntax menu but it
> applies to all the
> database alias profiles. It is not possible to have this
> config only for
> production. Is there a workaround to this to make this
> config database
> alias specific?
> 2- There is session script plug-in which sounds very
> promising. However, I
> could not find even a single example of this.
> I would have hoped when a session is initialised it would be
> possible to
> inspect the database and login and set the session
> configuration like the
> auto correct above. Is it possible to do that?
> Regardless of that some examples of its usage would really
> be useful.
> Probably the best solution for this would be to have a
> Restricted Access
> plugin. I could not see anything regarding such as feature.
> Is there any
> plan?
> If we were to write such a plugin, that would regulate
> update, delete and
> insert statements execution based on a list of database and
> login names,
> which plugin would be a good example to look at.
> What application name would you suggest for this plug-in?
> --
> This message has been sent to you, a registered user,
> by another site user, through the site.  This message
> has been delivered to your mail alias.  You may reply
> to this message using the "Reply" feature of your email client, or
> using the messaging facility of at:

This email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
Squirrel-sql-develop mailing list
[hidden email]