Request for ideas to integrate unsupported database connection

I have a need to connect my Django application to an unsupported database (Databricks) - not unlike what this StackOverflow poster or this Microsoft developer describes. In my case,

  1. I only need read-only access; I will never be pushing data back to the database.

  2. I would like to avoid littering my code with SQL queries. Or at least I would like to associate the queries with the objects (probably manually created).

I thought I might do this via a model Manager and raw queries but I don’t see how to point a sub-class of the model.Manager at a specific database connection or at a database that is not listed in the settings.databases and supported by Django’s ORM.

This leaves me, it seems, with defining a Django View with an associated SQL Query and connection

  1. I would like to avoid repeating the connection code everywhere
    If this were a Java project lacking an ORM then I might set up a Data Source singleton to share the connection and ensure that the resources are handled correctly. It’s not clear to me if this sort of abstraction exists already in Django.

The Python library that seems most promising for connecting to Databricks would be the databricks-sql-connector. However, this connector is not supported by the Django Database API, it seems. I did see an alternative connector but by virtue of mentioning the first connector in it’s documentation, Microsoft seems to implicitly recommend my first choice. I have seen some posts about the Databricks API but they seem to indicate that the API is for command and control rather than data access.

This databricks-sql-connector includes the SQLAlchemy which provides it’s own ORM incompatible with Django’s. I did find a Django application called Django-Sorcery which attempts to replace the Django ORM with SQLAlchemy. I highly suspect that the replacement is incomplete in which case Django Sorcery might provide an easy way out.

I have seen mention of writing your own Django Database back-end but the lack of Django official documentation (assuming it wasn’t an issue of knowing where to look) seems to hint at a complex programming endeavor.

What do the users of the forum recommend?

Regards,
Justin