Functions | |
| None | _async_create_issue_deprecated_version (HomeAssistant hass, AwesomeVersion server_version, str dialect_name, AwesomeVersion min_version) |
| None | _async_create_mariadb_range_index_regression_issue (HomeAssistant hass, AwesomeVersion version) |
| None | _async_delete_issue_deprecated_version (HomeAssistant hass, str dialect_name) |
| datetime|None | _datetime_or_none (str value) |
| AwesomeVersion|None | _extract_version_from_server_response (str server_response) |
| AwesomeVersion | _extract_version_from_server_response_or_raise (str server_response) |
| NoReturn | _fail_unsupported_dialect (str dialect_name) |
| bool | _is_retryable_error (Recorder instance, OperationalError err) |
| _FuncOrMethType[_P, bool] | _P (_FuncOrMethType[_P, bool] job, str description, bool method) |
| Callable[[_FuncType[_P, bool]], _FuncType[_P, bool]] | _P (str description) |
| _FuncOrMethType[_P, _R] | _R (_FuncOrMethType[_P, _R] job, str description, int attempts, bool method) |
| Callable[[_FuncType[_P, _R]], _FuncType[_P, _R]] | _R (str description, int attempts) |
| NoReturn | _raise_if_version_unsupported (str server_version, str dialect_name, str minimum_version) |
| AwesomeVersion | _simple_version (str version) |
| None | async_create_backup_failure_issue (HomeAssistant hass, datetime local_start_time) |
| bool | async_migration_in_progress (HomeAssistant hass) |
| bool | async_migration_is_live (HomeAssistant hass) |
| bool | basic_sanity_check (SQLiteCursor cursor) |
| dict | build_mysqldb_conv () |
| str | dburl_to_path (str dburl) |
| None | end_incomplete_runs (Session session, datetime start_time) |
| list[Row] | execute (Query qry, bool to_native=False, bool validate_entity_ids=True) |
| None | execute_on_connection (DBAPIConnection dbapi_connection, str statement) |
| Sequence[Row]|Result | execute_stmt_lambda_element (Session session, StatementLambdaElement stmt, datetime|None start_time=None, datetime|None end_time=None, int yield_per=DEFAULT_YIELD_STATES_ROWS, bool orm_rows=True) |
| Callable[[Exception], bool] | filter_unique_constraint_integrity_error (Recorder instance, str row_type) |
| str|None | get_index_by_name (Session session, str table_name, str index_name) |
| bool | is_second_sunday (datetime date_time) |
| bool | last_run_was_recently_clean (SQLiteCursor cursor) |
| None | move_away_broken_database (str dbfile) |
| None | periodic_db_cleanups (Recorder instance) |
| Any | query_on_connection (DBAPIConnection dbapi_connection, str statement) |
| tuple[datetime|None, datetime|None] | resolve_period (StatisticPeriod period_def) |
| None | run_checks_on_open_db (str dbpath, SQLiteCursor cursor) |
| date | second_sunday (int year, int month) |
| DatabaseEngine|None | setup_connection_for_dialect (Recorder instance, str dialect_name, DBAPIConnection dbapi_connection, bool first_connection) |
| bool | validate_or_move_away_sqlite_database (str dburl) |
| bool | validate_sqlite_database (str dbpath) |
| Generator[None] | write_lock_db_sqlite (Recorder instance) |
SQLAlchemy util functions.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Execute a database job repeatedly until it succeeds, at most attempts times. This wrapper handles InnoDB deadlocks and lock timeouts. This is different from retryable_database_job in that it will retry the job attempts number of times instead of returning False if the job fails.
|
private |
|
private |
| None homeassistant.components.recorder.util.async_create_backup_failure_issue | ( | HomeAssistant | hass, |
| datetime | local_start_time | ||
| ) |
| bool homeassistant.components.recorder.util.async_migration_in_progress | ( | HomeAssistant | hass | ) |
| bool homeassistant.components.recorder.util.async_migration_is_live | ( | HomeAssistant | hass | ) |
| bool homeassistant.components.recorder.util.basic_sanity_check | ( | SQLiteCursor | cursor | ) |
| dict homeassistant.components.recorder.util.build_mysqldb_conv | ( | ) |
| str homeassistant.components.recorder.util.dburl_to_path | ( | str | dburl | ) |
| None homeassistant.components.recorder.util.end_incomplete_runs | ( | Session | session, |
| datetime | start_time | ||
| ) |
| list[Row] homeassistant.components.recorder.util.execute | ( | Query | qry, |
| bool | to_native = False, |
||
| bool | validate_entity_ids = True |
||
| ) |
| None homeassistant.components.recorder.util.execute_on_connection | ( | DBAPIConnection | dbapi_connection, |
| str | statement | ||
| ) |
| Sequence[Row] | Result homeassistant.components.recorder.util.execute_stmt_lambda_element | ( | Session | session, |
| StatementLambdaElement | stmt, | ||
| datetime | None | start_time = None, |
||
| datetime | None | end_time = None, |
||
| int | yield_per = DEFAULT_YIELD_STATES_ROWS, |
||
| bool | orm_rows = True |
||
| ) |
Execute a StatementLambdaElement. If the time window passed is greater than one day the execution method will switch to yield_per to reduce memory pressure. It is not recommended to pass a time window when selecting non-ranged rows (ie selecting specific entities) since they are usually faster with .all().
| Callable[[Exception], bool] homeassistant.components.recorder.util.filter_unique_constraint_integrity_error | ( | Recorder | instance, |
| str | row_type | ||
| ) |
| str | None homeassistant.components.recorder.util.get_index_by_name | ( | Session | session, |
| str | table_name, | ||
| str | index_name | ||
| ) |
| bool homeassistant.components.recorder.util.is_second_sunday | ( | datetime | date_time | ) |
| bool homeassistant.components.recorder.util.last_run_was_recently_clean | ( | SQLiteCursor | cursor | ) |
| None homeassistant.components.recorder.util.move_away_broken_database | ( | str | dbfile | ) |
| None homeassistant.components.recorder.util.periodic_db_cleanups | ( | Recorder | instance | ) |
| Any homeassistant.components.recorder.util.query_on_connection | ( | DBAPIConnection | dbapi_connection, |
| str | statement | ||
| ) |
| tuple[datetime | None, datetime | None] homeassistant.components.recorder.util.resolve_period | ( | StatisticPeriod | period_def | ) |
| None homeassistant.components.recorder.util.run_checks_on_open_db | ( | str | dbpath, |
| SQLiteCursor | cursor | ||
| ) |
| date homeassistant.components.recorder.util.second_sunday | ( | int | year, |
| int | month | ||
| ) |
| DatabaseEngine | None homeassistant.components.recorder.util.setup_connection_for_dialect | ( | Recorder | instance, |
| str | dialect_name, | ||
| DBAPIConnection | dbapi_connection, | ||
| bool | first_connection | ||
| ) |
| bool homeassistant.components.recorder.util.validate_or_move_away_sqlite_database | ( | str | dburl | ) |
| bool homeassistant.components.recorder.util.validate_sqlite_database | ( | str | dbpath | ) |
| Generator[None] homeassistant.components.recorder.util.write_lock_db_sqlite | ( | Recorder | instance | ) |
| homeassistant.components.recorder.util.DEFAULT_YIELD_STATES_ROWS |
| homeassistant.components.recorder.util.FIRST_POSSIBLE_SUNDAY |
| homeassistant.components.recorder.util.MARIADB_WITH_FIXED_IN_QUERIES_105 |
| homeassistant.components.recorder.util.MARIADB_WITH_FIXED_IN_QUERIES_106 |
| homeassistant.components.recorder.util.MARIADB_WITH_FIXED_IN_QUERIES_107 |
| homeassistant.components.recorder.util.MARIADB_WITH_FIXED_IN_QUERIES_108 |
| homeassistant.components.recorder.util.MIN_VERSION_SQLITE_MODERN_BIND_VARS |
| homeassistant.components.recorder.util.RECOMMENDED_MIN_VERSION_MARIA_DB |
| homeassistant.components.recorder.util.RECOMMENDED_MIN_VERSION_MARIA_DB_106 |
| homeassistant.components.recorder.util.RECOMMENDED_MIN_VERSION_MARIA_DB_107 |
| homeassistant.components.recorder.util.RECOMMENDED_MIN_VERSION_MARIA_DB_108 |
| homeassistant.components.recorder.util.RETRYABLE_MYSQL_ERRORS |