Apache Superset achieves cross-database support through SQLAlchemy, a Python SQL toolkit and Object-Relational Mapping (ORM) library. SQLAlchemy provides a consistent API for interacting with various databases, abstracting the underlying differences in SQL dialects.
Superset uses SQLAlchemy’s dialect system to handle nuances between different SQL dialects. Dialects are responsible for generating SQL statements specific to each database, translating column types, and handling any unique features or limitations of the respective database systems.
To add support for a new database, one needs to install the appropriate SQLAlchemy dialect package and configure the connection string in Superset. This enables seamless integration and querying across multiple databases within the same Superset instance.