Add support for Cloudflare D1 via external DB-API + SQLAlchemy dialect #35273
ChadRosseau
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Hi @rusackas! I am Shreyas Rao, a student at University of Toronto Scarborough — it was great meeting you and the community during the Townhall today. Our team would like to take the initiative to work on the above feature to add Cloudflare D1 as a valid Superset data source. Before we begin, we would appreciate your feedback on whether this approach aligns with Superset’s expectations. Thank you! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Add support for Cloudflare D1 via external DB-API + SQLAlchemy dialect
Problem
Superset requires a Python DB-API driver and a SQLAlchemy dialect in order to connect to different database engines. Cloudflare D1 (a serverless SQLite-compatible database built on Workers) isn’t currently supported. This makes it impossible for teams using D1 as their backend to connect it as a datasource in Superset.
Ourselves and many of our peers are avid users of the Cloudflare stack, including D1, and would welcome a Superset integration with D1.
Proposal
Our team* would like to build an external Python package that adds:
As per the Superset 'Connecting to Databases' documentation, these are the two crucial components in a database integration.
Users would then be able to
pip install
the driver and set up connections in Superset using a connection string such as:This approach keeps changes outside of Superset core. Superset will discover the dialect if installed. The only possible core addition later would be adding d1-specific instructions to superset documentation, such as in
docs/docs/configuration/databases.mdx
.Limitations We’re Aware Of
D1 is not a traditional socket-based database, so some DB-API features can’t be fully supported. For example:
commit()
will effectively be a no-op, since D1 autocommits.rollback()
cannot be supported and would raiseNotImplementedError
.We believe these tradeoffs are acceptable since they align with how D1 itself works.
Questions for Maintainers
Thank you in advance for your ideas and feedback.
*cc: @danielalyoshin, @jang-35, @murphylee10, @ThunderRoar
Beta Was this translation helpful? Give feedback.
All reactions