Commit graph

122 commits

Author SHA1 Message Date
dougiteixeira
1ef6391e9c
Preserves config flow information in case of error for SQL (#91142) 2023-04-12 09:03:14 -10:00
J. Nick Koston
bd0378a961
Bump sqlalchemy to 2.0.9 (#91151)
changes: https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2.0.9
2023-04-10 10:01:49 -04:00
J. Nick Koston
6e9fcbfec1
Fix false positive in SQL sensor full table scan check (#91134) 2023-04-09 19:45:08 -10:00
J. Nick Koston
53d7e33607
Raise an issue for legacy SQL queries that will cause full table scans (#90971)
* Raise an issue for SQL queries that will cause full table scans

* Raise an issue for SQL queries that will cause full table scans

* Raise an issue for SQL queries that will cause full table scans

* Raise an issue for SQL queries that will cause full table scans

* Update homeassistant/components/sql/sensor.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* coverage

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-04-07 22:32:36 -04:00
J. Nick Koston
b66a99fe8a
Bump sqlalchemy to 2.0.8 (#90756) 2023-04-04 12:47:54 +02:00
J. Nick Koston
8096be768d
Isolate the sql integration with a separate query cache (#90438)
* Isolate the sql integration with a seperate query cache

If there were a lot of sql integrations they could affect
the performance of the recorder/logbook/history since they
were sharing the same LRU and since the sql sensor updates
frequently it would evict the recorder queries from the
LRU.

* generate in stmt

* avoid double gen

* Revert "avoid double gen"

This reverts commit 6a5aa65268.
2023-03-28 23:54:03 -04:00
J. Nick Koston
5dc96a6952
Fix unbound variable in sql when session setup fails (#90439)
Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
    await asyncio.shield(task)
  File "/Users/bdraco/home-assistant/homeassistant/components/sql/sensor.py", line 75, in async_setup_platform
    await async_setup_sensor(
  File "/Users/bdraco/home-assistant/homeassistant/components/sql/sensor.py", line 150, in async_setup_sensor
    sessmaker := await hass.async_add_executor_job(
  File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/bdraco/home-assistant/homeassistant/components/sql/sensor.py", line 205, in _validate_and_get_session_maker_for_db_url
    if sess:
UnboundLocalError: local variable 'sess' referenced before assignment
2023-03-28 23:52:44 -04:00
J. Nick Koston
7098debe09
Fix sql doing I/O in the event loop at startup (#90335)
* Fix sql doing I/O in the event loop

* Fix sql doing I/O in the event loop

* no test query on main db

* fix mocking because it was targeting the recorder
2023-03-26 21:02:24 -04:00
J. Nick Koston
7bceedfc95
Bump sqlalchemy to 2.0.7 (#90256) 2023-03-25 07:05:35 -10:00
J. Nick Koston
03b204f445
Execute sql queries in the database executor when using the recorder database (#89673) 2023-03-14 10:56:02 +01:00
J. Nick Koston
2cb673db04
Handle bytes data in sql sensors (#89169) 2023-03-13 18:07:05 -10:00
G Johansson
afa58b80bd
Default to recorder db for SQL integration (#85436)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-03-13 17:41:32 -10:00
Paulus Schoutsen
8a4233ac8e
Bump SQLAlchemy to 2.0.6 (#89650) 2023-03-13 08:51:01 -10:00
J. Nick Koston
9672b5f02c
Bump sqlalchemy to 2.0.5post1 (#89253)
changelog: https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2.0.5

mostly bugfixes for 2.x regressions
2023-03-06 20:20:37 -05:00
G Johansson
f4cda2dfda
Add device_class and state_class to sql (#85418) 2023-03-05 20:30:42 +01:00
J. Nick Koston
cbba0fee42
Bump sqlalchemy to 2.0.4 (#88574)
changelog: https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2.0.4
2023-02-21 21:11:16 -05:00
J. Nick Koston
e899754919
Bump sqlalchemy to 2.0.3 (#87913)
changes: https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2.0.3
2023-02-11 23:20:22 -05:00
Erik Montnemery
23fa500406
Sort manifests 9 (#87030) 2023-02-08 20:22:30 +01:00
Erik Montnemery
94519de8dd
Upgrade SQLAlchemy to 2.0.2 (#86436)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-02-08 08:17:32 -06:00
Franck Nijhof
939eef3b28
Remove translations from Core (#87543)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-06 15:06:43 +01:00
Franck Nijhof
5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
G Johansson
2a965a6e44
SQL reintroduce yaml support (#75205)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-07 18:14:36 -10:00
J. Nick Koston
8db086f65b
Bump sqlalchemy to 1.4.45 (#85021)
changelog: https://docs.sqlalchemy.org/en/20/changelog/changelog_14.html#change-1.4.45
2023-01-02 20:46:56 -05:00
GitHub Action
1e0345a377 [ci skip] Translation update 2022-12-10 00:21:35 +00:00
GitHub Action
f25017313a [ci skip] Translation update 2022-12-09 00:24:29 +00:00
GitHub Action
1f3e5fb4fc [ci skip] Translation update 2022-12-07 00:24:08 +00:00
GitHub Action
230b50d099 [ci skip] Translation update 2022-11-29 00:26:01 +00:00
GitHub Action
b65d8cc1b3 [ci skip] Translation update 2022-11-28 00:23:09 +00:00
GitHub Action
f3b3193f7a [ci skip] Translation update 2022-11-25 00:24:19 +00:00
GitHub Action
eaf6d43508 [ci skip] Translation update 2022-11-23 00:26:26 +00:00
Franck Nijhof
19e5e671a2
Update sqlalchemy to 1.4.44 (#82129) 2022-11-15 08:51:13 -06:00
Franck Nijhof
cb530e398c
Update sqlalchemy to 1.4.42 (#80495) 2022-10-17 23:30:21 -04:00
G Johansson
18be5f1387
SQL fix entry options save (#78145)
* SQL fix options

* Testing
2022-09-28 08:49:37 +02:00
Franck Nijhof
eae384bbf7
Update sqlalchemy to 1.4.41 (#78507) 2022-09-15 11:54:18 +02:00
GitHub Action
bcf01e8873 [ci skip] Translation update 2022-09-15 00:29:28 +00:00
G Johansson
76006ce9d7
Allow empty db in SQL options flow (#77777) 2022-09-05 14:50:47 -05:00
GitHub Action
ff3fd4c29d [ci skip] Translation update 2022-08-16 00:30:51 +00:00
GitHub Action
6e03b12a93 [ci skip] Translation update 2022-08-13 00:25:00 +00:00
GitHub Action
519d478d61 [ci skip] Translation update 2022-08-11 00:26:23 +00:00
Franck Nijhof
4e3db5bb5c
Update sqlalchemy to 1.4.40 (#76505) 2022-08-09 09:35:22 -04:00
GitHub Action
cb46441b74 [ci skip] Translation update 2022-08-05 00:28:51 +00:00
GitHub Action
81e3ef03f7 [ci skip] Translation update 2022-08-02 00:27:42 +00:00
GitHub Action
377f56ff5f [ci skip] Translation update 2022-07-31 00:25:44 +00:00
GitHub Action
c4ad6d46ae [ci skip] Translation update 2022-07-30 00:22:48 +00:00
GitHub Action
79a0940932 [ci skip] Translation update 2022-07-17 00:25:56 +00:00
G Johansson
09f37fc522
Migrate SQL to new entity naming style (#75203) 2022-07-14 21:46:26 +02:00
J. Nick Koston
cd03c49fc2
Wait for config entry platform forwards (#73806) 2022-07-09 17:27:42 +02:00
J. Nick Koston
3d59088a62
Bump sqlalchemy to 1.4.38 (#73916)
Changes: https://docs.sqlalchemy.org/en/14/changelog/changelog_14.html#change-1.4.38
2022-06-23 14:13:42 -04:00
GitHub Action
7746715590 [ci skip] Translation update 2022-06-02 00:27:51 +00:00
J. Nick Koston
e874a04319
Bump sqlalchemy to 1.4.37 (#72809)
Fixes a bug where reconnects might fail with MySQL 8.0.24+

Changelog: https://docs.sqlalchemy.org/en/14/changelog/changelog_14.html#change-1.4.37
2022-06-01 10:56:05 +02:00