Home Assistant Unofficial Reference 2024.12.1
database.py
Go to the documentation of this file.
1 """Models for the database in the Recorder."""
2 
3 from __future__ import annotations
4 
5 from dataclasses import dataclass
6 
7 from awesomeversion import AwesomeVersion
8 
9 from ..const import SupportedDialect
10 
11 
12 class UnsupportedDialect(Exception):
13  """The dialect or its version is not supported."""
14 
15 
16 @dataclass
18  """Properties of the database engine."""
19 
20  dialect: SupportedDialect
21  optimizer: DatabaseOptimizer
22  max_bind_vars: int
23  version: AwesomeVersion | None
24 
25 
26 @dataclass
28  """Properties of the database optimizer for the configured database engine."""
29 
30  # Some MariaDB versions have a bug that causes a slow query when using
31  # a range in a select statement with an IN clause.
32  #
33  # https://jira.mariadb.org/browse/MDEV-25020
34  #
35  slow_range_in_select: bool