Each RDBMS has a specify DB-API, if you app is able to work with differentes RDBMS probably in some cases you will need to execute specifics SQL statements for ech one.
The SQLAlchemy dialect defines the behavior of a specific database and DB-API combination. The dialect name can be used to identify the vendor of the RDBMS.
The connection string provides various database information, so you can get these parameters by following the code below:
from sqlalchemy.engine import make_url
CONNs = [
"oracle+cx_oracle://user:pass@127.0.0.1:1521/?service_name=data01base",
"postgresql+psycopg2://user:pass@127.0.0.1:5432/data01base",
"sqlite:////tmp/database.db",
]
for conn in CONNs:
url = make_url(conn)
print(url.get_backend_name())
The function get_backend_name
can be used to identify the RDBMS vendor of you database.
The most common RDBMS providers are: Oracle, Postgresql, MySQL, MYSQL, etc.