Page 1 of 1

Read-only connection (new type)

PostPosted: Wed May 13, 2015 12:07 pm
by syop02
Hello.

The option "read-only connection" don't work on all RDBMS.
Example on DB2 LUW 9.7:
SQL Warning (DataSource: DB2-OSIOTT1-EMODA; Code: 4474; State: 01000): [jcc][t4][10217][10310][4.16.53]
Connection read-only mode is not enforceable after the connection has been established.


My suggestion.
When the connection is read-only, DBeaver does not allow the following commands:
UPDATE, INSERT, UPSERT, MERGE, DELETE, TRUNCATE, CREATE, ALTER, DROP, RENAME, GRANT, REVOKE
It is simple and safe (and works with any db).

Best regards!

Re: Read-only connection (new type)

PostPosted: Tue Jun 09, 2015 12:06 pm
by sava
+1

Re: Read-only connection (new type)

PostPosted: Sun Jun 28, 2015 11:57 am
by Serge
DB2 driver doesn't support standard JDBC method to make connections read-only. But they have special workaround - I'll add this workaround in DBeaver in the next version so read-only connections will work for DB2.

Regarding query type checking on DBeaver side. Unfortunately it is not so easy to determine SQL statement type because DBeaver has to understand semantic of SQL queries for all existing SQL dialects.
The only simple workaround is to restrict all non-SELECT queries. But I'm sure it will be way too restrictive. So for now we have to rely on driver implementation.

Re: Read-only connection (new type)

PostPosted: Mon Sep 14, 2015 7:38 am
by syop02

Re: Read-only connection (new type)

PostPosted: Tue Sep 15, 2015 11:38 am
by Serge
Allowing only SELECT statements has many side-effects.
For instance there are many other ways to retrieve data. E.g. SHOW or DESCRIBE operators or stored procedures calls.
Moreover even SELECT statement can lead to data modifications (thru triggers or stored procedures).
So I still think that it is a bad way to manager read-only connections.

Could you confirm that read-only connection flag works in DB2?

Re: Read-only connection (new type)

PostPosted: Fri Sep 18, 2015 10:12 am
by syop02