Database Explorer issues

17 views
Skip to first unread message

Guy Rouillier

unread,
Nov 15, 2022, 3:18:33 AM11/15/22
to sql-wo...@googlegroups.com
SQL Workbench version: Build 129 (2022-10-23 13:16)
Java Version 11.0.12 (64-bit)
Windows version: 7 service pack 1 64-bit
winver: Version 6.1 Build 7601

I've been using SQL Workbench for years for certain limited cases - Data Pumper is a fantastic time saver! Thanks for this great tool. I'm now using it more broadly for working with multiple databases: PostgreSQL, CUBRID, Oracle. I've encountered some small challenges with Database Explorer:

(1) I also use DBeaver: https://dbeaver.io/. One navigation issue that trips me up jumping between the two is that DBeaver requires a double-click to select a table for viewing, while SQL Workbench uses a single click. Is there a configuration option in SQL Workbench to navigate using a double-click instead?

(2) CUBRID (https://www.cubrid.org/) comes with a demodb that I use for testing. The tables are created in the PUBLIC schema, and the default logon is "dba" with no password. In SQL Workbench, after selecting a table for viewing - for example, public.participant - I then attempt to view the foreign keys by right-clicking a row, selecting Referenced Rows, and then selecting one of the foreign keys. This results in the following SQL:

SELECT *
FROM nation
WHERE (code = 'ZAM');

which produces the following error, because the PUBLIC schema is not included in the FROM clause:

An error occurred when executing the SQL command:
-- @WbResult Related rows from nation for public.participant
-- through foreign key fk_participant_nation_code
Syntax: Unknown class "dba.nation". select * from [dba.nation] where (code='ZAM')
1 statement failed.

Thanks.

--
Guy Rouillier

Thomas Kellerer

unread,
Nov 15, 2022, 5:40:19 PM11/15/22
to sql-wo...@googlegroups.com
No, there is no option to require a double click to select a row (the table list is just a standard table, so the selection changes with a single click).
Alternatively you could use the DbTree

You can force the use of a schema even if it's the table's schema by setting:

workbench.db.cubrid.schema.always=true

in workbench.settings

Alternatively you can do that by running

WbSetDbConfig schema.always=true;

once while being connected to a Cubrid database. This will automatically update workbench.settings.

Regards
Thomas

Guy Rouillier

unread,
Nov 15, 2022, 6:33:35 PM11/15/22
to sql-wo...@googlegroups.com
Thanks, Thomas. Turns out I misinterpreted what I was seeing with
DBeaver. It also responds to a single click. As long as they use the
same approach, I can train myself to use a single click.

Regarding the second issue, I'm using CUBRID 11.2. Even after setting
schema.always=true, I'm still getting the same error. I tried both ways,
editing workbench.settings manually, and running the WbSetDbConfig
statement while connected; here's the directive it entered:

workbench.db.cubrid.schema.always=true

Even with this, it is still attempting to select from (for example)
dba.game instead of public.game when retrieving a row from the table
defining the foreign key. If I connect with user "public" instead of
"dba", then it works properly.

Thanks.

--
Guy Rouillier


On 11/15/2022 5:40:16 PM, "Thomas Kellerer"
>-- You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/sql-workbench/74426328-3b80-ffc0-27ac-086496ef4e96%40sql-workbench.net.

Thomas Kellerer

unread,
Nov 16, 2022, 12:03:14 PM11/16/22
to sql-wo...@googlegroups.com

So I installed Cubrid and as far as I can tell, it simply doesn't support schemas (at least not the way the SQL standard defines them or the JDBC API expects them).

The driver does not return any schema information for the tables (the screenshot is from the demodb)


This means there is a table named "public.athlete" that does not have a schema.
The "schema support" seems to be just a text replacement feature in the parsed name as far as I can tell.


The JDBC driver also confirmst that cubrid does not support schemas at all.

FEATURE                                 | VALUE        
----------------------------------------+--------------
catalogSeparator                        |              
catalogTerm                             |              
schemaTerm                              |              
supportsCatalogsInDataManipulation      | false        
supportsCatalogsInIndexDefinitions      | false        
supportsCatalogsInProcedureCalls        | false        
supportsCatalogsInTableDefinitions      | false        

supportsSchemasInDataManipulation       | false        
supportsSchemasInIndexDefinitions       | false        
supportsSchemasInProcedureCalls         | false        
supportsSchemasInTableDefinitions       | false        

There are some situations where SQL Workbench gets things wrong, if the table name contains a dot. Generating the queries for the FK dependencies seems to be one of them. If Cubrid had chosen to delimit the prefix using a different character, e.g. the $ sign ("public$athlete") then this wouldn't happen.

I will see if I can fix that.

Regards
Thomas

Guy Rouillier

unread,
Nov 16, 2022, 1:02:16 PM11/16/22
to sql-wo...@googlegroups.com
Thomas, thank you for looking into this. I'm retired and continue with these things out of general interest and to keep my mind active. So please do not divert your time on my behalf. I'll contact CUBRID and see if they have any intent to implement true schema support. I'll report back here what I learn.

Now you've got me curious how DBeaver makes this work. I'd be surprised if they did a special case for CUBRID, as CUBRID doesn't have major market share. 

Thomas Kellerer

unread,
Nov 16, 2022, 1:52:35 PM11/16/22
to sql-wo...@googlegroups.com
It's not that DBeaver does something special for Cubrid. SQL Workbench is trying to be overly clever when processing a table name... :)

Guy Rouillier schrieb am 16.11.2022 um 19:01:
> Thomas, thank you for looking into this. I'm retired and continue with these things out of general interest and to keep my mind active. So please do not divert your time on my behalf. I'll contact CUBRID and see if they have any intent to implement true schema support. I'll report back here what I learn.
>
> Now you've got me curious how DBeaver makes this work. I'd be surprised if they did a special case for CUBRID, as CUBRID doesn't have major market share.
>
> On Wed, Nov 16, 2022, 12:03 PM Thomas Kellerer <google...@sql-workbench.net <mailto:google...@sql-workbench.net>> wrote:
>
> So I installed Cubrid and as far as I can tell, it simply doesn't support schemas (at least not the way the SQL standard defines them or the JDBC API expects them).
>
> The driver does not return any schema information for the tables (the screenshot is from the demodb)
>
>

Guy Rouillier

unread,
Dec 1, 2022, 11:35:47 PM12/1/22
to sql-wo...@googlegroups.com
Thomas, to close the loop, I posted an issue to the CUBRID Reddit group:

https://www.reddit.com/r/CUBRID/comments/z8n3c1/112_java_databasemetadatagetschemas_returns_no/

CUBRID acknowledges this feature is not yet implemented. ;( Here is a
corresponding Jira issue:

http://jira.cubrid.org/browse/CBRD-21555?jql=text%20~%20%22DatabaseMetaData%22

--
Guy Rouillier


On 11/16/2022 1:52:32 PM, "Thomas Kellerer"
>-- You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/sql-workbench/024d6d83-42b8-a421-7af7-65c9de951db5%40sql-workbench.net.

Thomas Kellerer

unread,
Dec 2, 2022, 3:21:41 PM12/2/22
to sql-wo...@googlegroups.com
I already fixed the code that processes table names to correctly deal with names containing a dot.
Reply all
Reply to author
Forward
0 new messages