Skip to content

Commit b0bef9e

Browse files
authored
Update recorder documentation according to ADR18 (home-assistant#20145)
1 parent 6c21cda commit b0bef9e

File tree

1 file changed

+14
-44
lines changed

1 file changed

+14
-44
lines changed

source/_integrations/recorder.markdown

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@ This integration constantly saves data. If you use the default configuration, th
1919

2020
</div>
2121

22-
Home Assistant uses [SQLAlchemy](https://www.sqlalchemy.org/), 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](https://www.mysql.com/), [MariaDB](https://mariadb.org/), [PostgreSQL](https://www.postgresql.org/), or [MS SQL Server](https://www.microsoft.com/en-us/sql-server/).
22+
Home Assistant uses [SQLAlchemy](https://www.sqlalchemy.org/), which is an Object Relational Mapper (ORM). This makes it possible to use a number of database solutions.
2323

24-
The default database engine is [SQLite](https://www.sqlite.org/) which does not require any configuration. The database is stored in your Home Assistant configuration directory ('/config/') and is named `home-assistant_v2.db`.
24+
The supported database solutions are:
25+
- [MariaDB](https://mariadb.org/) ≥ 10.3
26+
- [MySQL](https://www.mysql.com/) ≥ 8.0
27+
- [PostgreSQL](https://www.postgresql.org/) ≥ 12
28+
- [SQLite](https://www.sqlite.org/) ≥ 3.32.1
29+
30+
Although SQLAlchemy supports additional database solutions, it will behave differently on different databases, and features relied on by the recorder may work differently, or not at all, in different databases.
31+
32+
The default, and recommended, database engine is [SQLite](https://www.sqlite.org/) which does not require any configuration. The database is stored in your Home Assistant configuration directory ('/config/') and is named `home-assistant_v2.db`.
2533

2634
To change the defaults for the `recorder` integration in your installation, add the following to your `configuration.yaml` file:
2735

@@ -231,10 +239,10 @@ Call the service `recorder.enable` to start again saving events and states to th
231239

232240
The following database engines are tested when major changes are made to the recorder. Other database engines do not have an active core maintainer at this time and may require additional work to maintain.
233241

234-
- SQLite 3.32.1+
235-
- MariaDB 10.3+
236-
- MySQL 5.7+
237-
- PostgreSQL 12+
242+
- SQLite 3.32.1
243+
- MariaDB 10.3
244+
- MySQL ≥ 8.0
245+
- PostgreSQL ≥ 12
238246

239247
## Custom database engines
240248

@@ -278,13 +286,6 @@ PostgreSQL (Socket):
278286
PostgreSQL (Custom socket dir):
279287
description: >
280288
`postgresql://@/DB_NAME?host=/path/to/dir`
281-
MS SQL Server:
282-
description: >
283-
`mssql+pyodbc://username:password@SERVER_IP:1433/DB_NAME?charset=utf8&driver=DRIVER`
284-
Oracle:
285-
description: >
286-
`oracle+cx_oracle://username:password@SERVER_IP:1521/DB_NAME?encoding=UTF-8&nencoding=UTF-8`
287-
288289
{% endconfiguration_basic %}
289290

290291
<div class='note'>
@@ -313,12 +314,6 @@ If you want to use Unix Sockets for PostgreSQL you need to modify the `pg_hba.co
313314

314315
</div>
315316

316-
<div class='note warning'>
317-
318-
If you are using the default `FULL` recovery model for MS SQL Server you will need to manually backup your log file to prevent your transaction log from growing too large. It is recommended you change the recovery model to `SIMPLE` unless you are worried about data loss between backups.
319-
320-
</div>
321-
322317
### Database startup
323318

324319
If you are running a database server instance on the same server as Home Assistant then you must ensure that this service starts before Home Assistant. For a Linux instance running Systemd (Raspberry Pi, Debian, Ubuntu and others) you should edit the service file.
@@ -415,28 +410,3 @@ $ sudo -i -u postgres psql -c "SELECT pg_reload_conf();"
415410
(1 row)
416411
```
417412
A service restart will work as well.
418-
419-
### MS SQL Server
420-
421-
For MS SQL Server you will have to install a few dependencies:
422-
423-
```bash
424-
sudo apt-get install unixodbc-dev
425-
pip3 install pyodbc
426-
```
427-
428-
If you are in a virtual environment, don't forget to activate it before installing the pyodbc package.
429-
430-
```bash
431-
sudo -u homeassistant -H -s
432-
source /srv/homeassistant/bin/activate
433-
pip3 install pyodbc
434-
```
435-
436-
You will also need to install an ODBC Driver. Microsoft ODBC drivers are recommended, however FreeTDS is available for systems that are not supported by Microsoft. Instructions for installing the Microsoft ODBC drivers can be found [here](https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server).
437-
438-
<div class='note'>
439-
440-
If you are using Hass.io, FreeTDS is already installed for you. The db_url you need to use is `mssql+pyodbc://username:password@SERVER_IP:1433/DB_NAME?charset=utf8mb4&driver=FreeTDS`.
441-
442-
</div>

0 commit comments

Comments
 (0)