Installing Cockroachdb support for sqlalchemy

Tags: #<Tag:0x00007f3270fe0610>

Is it possible to install the cockroachdb dialect for sqlalchemy, such that the recorder plugin can use that instead of eg: postgresql?

I have tried adding a manifest.json to config/custom_components which includes "dependencies": ["sqlalchemy-cockroachdb==1.3.2"] - and I see the conifg/deps/ directory now contains:

config $ ls deps
cockroachdb
sqlalchemy_cockroachdb-1.3.2.dist-info

which looks right, but when using a connection sting in recorder.db_url like ‘cockroachdb://’ I still get the following in the logs on restart:

2021-02-20 10:07:41 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: Can't load plugin: sqlalchemy.dialects:cockroachdb (retrying in 3 seconds)
...

For the record I would like to use cockroachdb since I already have a large multi-machine cluster of it set up and would like to use it specifically. I am running the hass.io image on a raspberrypi 4, if that helps. Thanks in advance.

Im using this for building cockroachdb sqlalc support for my HA dockercontainer:

Yea cool - so that gives me a good idea that it will work if I do get it installed, but I actually just migrated HA away from my k8s to a dedicated pi - do you (or anyone) know how to get the hass.io is image to use a python library like this?

Following other posts is how I got to making a custom_component and having it download it as a dep but maybe that isn’t in the path of the main HA scripts…

Anyway, is there any way to make this happen? From the docs it sounds like this should have been supported already:

Home Assistant uses SQLAlchemy, which is an Object Relational Mapper (ORM). This means that you can use any SQL backend for the recorder that is supported by SQLAlchemy, like MySQL, MariaDB, PostgreSQL, or MS SQL Server.

So as sql alchemy supports cockroachdb, should this just be installed by default, and was accidentally excluded?

More generally speaking, is there any way to have core hass.io load and use libraries?