I want to connect superset to a database by a JDBC driver. But from what I find there is no a SQLAlchemy dialect ready for this purpose. The closest option may be jaydebeapi but it does not have a SQLAlchemy dialect either.
Question is if there is a way from SQLAlchemy DB Engine to connect a database through JDBC driver? Or is there a way to use JDBC driver in superset?
Supported Databases. SQLAlchemy includes dialects for SQLite, Postgresql, MySQL, Oracle, MS-SQL, Firebird, Sybase and others, most of which support multiple DBAPIs. Other dialects are published as external projects.
The dialect is the system SQLAlchemy uses to communicate with various types of DBAPI implementations and databases. The sections that follow contain reference documentation and notes specific to the usage of each backend, as well as notes for the various DBAPIs.
SQLAlchemy supports these syntaxes automatically if SQL Server 2012 or greater is detected. Changed in version 1.4: support added for SQL Server “OFFSET n ROWS” and “FETCH NEXT n ROWS” syntax.
The JayDeBeApi module allows you to connect from Python code to databases using Java JDBC. It provides a Python DB-API v2. 0 to that database. It works on ordinary Python (cPython) using the JPype Java integration or on Jython to make use of the Java JDBC driver.
This something I keep coming up against - it's a real shame that neither the SQLAlchemy project nor the JayDeBeAPI project want to cross this bridge.
It would automatically enable so much additional functionality in any tool that chooses SQLAlchemy like Superset.
I understand that SQL Alchemy needs a deeper understanding of the specific DB's SQL dialect for it's ORM functionalty, but it should be fairly simple to implement a mostly functional generic JDBC layer and/or inherit the existing dialects.
The most up to date reference I can find is this:
JayDeBeAPI Comment
It looks like the JDBC API was released fairly recently (October 2020):
https://pypi.org/project/sqlalchemy-jdbcapi/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With