Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there SQLAlchemy dialect support JDBC?

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?

like image 772
robert Avatar asked Nov 21 '17 08:11

robert


People also ask

What databases does SQLAlchemy support?

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.

What is dialect in SQLAlchemy?

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.

Does SQLAlchemy support SQL Server?

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.

Can Python use JDBC driver?

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.


2 Answers

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

like image 134
Euan Avatar answered Oct 05 '22 20:10

Euan


It looks like the JDBC API was released fairly recently (October 2020):

https://pypi.org/project/sqlalchemy-jdbcapi/

like image 28
RianLauw Avatar answered Oct 05 '22 20:10

RianLauw