heavyai / heavyai-jdbc

A JDBC driver for connecting to an HeavyAI GPU database and running queries.
https://www.heavy.ai/
Other
8 stars 15 forks source link

[DBeaver] setSchema not supported #25

Open randyzwitch opened 4 years ago

randyzwitch commented 4 years ago

When opening the SQL Editor, DBeaver throws the following error:

Not supported yet, line:776 class:com.omnisci.jdbc.OmniSciConnection method:setSchema

image

julioasotodv commented 4 years ago

Indeed, it looks like the jdbc method setSchema is not supported.

However, there is a workaround that can be configured in DBeaver:

If you go to the "Edit connection" menu, and then into "Edit Driver Settings", and then into the "Advanced Parameters" tab, scroll until you see an option called "Omit Schemas". If you check that checkbox, save changes and reconnect, queries from the SQL editor should work for now on. This way, DBeaver will stop trying to launch a setSchema method.

randyzwitch commented 4 years ago

Thanks @julioasotodv, I should probably submit a PR to DBeaver to enable that by default

randyzwitch commented 4 years ago

I can confirm this workaround solves the issue, thanks @julioasotodv. We're discussing this internally on what the proper fix might be, including possibly just submitting this to the DBeaver repo

image

cdessanti commented 4 years ago

Well, I checked the jdbc documentation about the setSchema method, and not supporting schemas, it would be sufficient to silently fail the call to be compliant (e.g. logging the error as a warning).

Inviato da Postahttps://go.microsoft.com/fwlink/?LinkId=550986 per Windows 10

Da: Randy Zwitchmailto:notifications@github.com Inviato: lunedì 23 marzo 2020 14:36 A: omnisci/omnisci-jdbcmailto:omnisci-jdbc@noreply.github.com Cc: Subscribedmailto:subscribed@noreply.github.com Oggetto: Re: [omnisci/omnisci-jdbc] [DBeaver] setSchema not supported (#25)

I can confirm this workaround solves the issue, thanks @julioasotodvhttps://github.com/julioasotodv. We're discussing this internally on what the proper fix might be, including possibly just submitting this to the DBeaver repo

[image]https://user-images.githubusercontent.com/2762787/77322147-a636a400-6ce9-11ea-9d7c-628daf078fc9.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/omnisci/omnisci-jdbc/issues/25#issuecomment-602593009, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHLFBF6VQRVWXX4KQZJXIRDRI5QXNANCNFSM4KYX626A.

mlazatinph commented 4 years ago

As per javadocs https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#setSchema-java.lang.String-

If the driver does not support schemas, it will silently ignore this request.

So maybe don't throw an exception when setSchema is called.

The getSchema method says:

Returns: the current schema name or null if there is none

So maybe just return null instead of throwing an exception