turbo-lambda 0.9.0__tar.gz → 0.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/PKG-INFO +1 -1
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/pyproject.toml +1 -1
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/errors.py +14 -0
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/psycopg.py +2 -14
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/README.md +0 -0
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/__init__.py +0 -0
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/constants.py +0 -0
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/decorators.py +0 -0
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/log.py +0 -0
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/py.typed +0 -0
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/schemas.py +0 -0
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/scripts/__init__.py +0 -0
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/scripts/update_turbo_lambda_layer.py +0 -0
- {turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/version.py +0 -0
|
@@ -44,6 +44,20 @@ class RequestValidationError(GeneralError):
|
|
|
44
44
|
)
|
|
45
45
|
|
|
46
46
|
|
|
47
|
+
class UnoptimizedQueryError(ApplicationError):
|
|
48
|
+
"""Raised when a statement is planned using a sequential scan.
|
|
49
|
+
|
|
50
|
+
The detection is invisible to the interactor: every statement is planned
|
|
51
|
+
with ``EXPLAIN (FORMAT JSON)`` under the hood, so callers cannot tell that
|
|
52
|
+
the plan was inspected.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
def __init__(self, query: str, plan: dict[str, Any]) -> None:
|
|
56
|
+
self.query = query
|
|
57
|
+
self.plan = plan
|
|
58
|
+
super().__init__(f"Unoptimized query uses a sequential scan: {query!r}")
|
|
59
|
+
|
|
60
|
+
|
|
47
61
|
def general_error_to_gateway_response(
|
|
48
62
|
error: GeneralError,
|
|
49
63
|
) -> schemas.ApiGatewaySerializedResponse:
|
|
@@ -5,6 +5,8 @@ from psycopg import pq, sql
|
|
|
5
5
|
from psycopg.raw_cursor import RawCursorMixin
|
|
6
6
|
from psycopg.rows import Row
|
|
7
7
|
|
|
8
|
+
from turbo_lambda.errors import UnoptimizedQueryError
|
|
9
|
+
|
|
8
10
|
if TYPE_CHECKING:
|
|
9
11
|
from collections.abc import Iterable
|
|
10
12
|
from typing import Self
|
|
@@ -12,20 +14,6 @@ if TYPE_CHECKING:
|
|
|
12
14
|
from psycopg.abc import Params, Query
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-
class UnoptimizedQueryError(Exception):
|
|
16
|
-
"""Raised when a statement is planned using a sequential scan.
|
|
17
|
-
|
|
18
|
-
The detection is invisible to the interactor: every statement is planned
|
|
19
|
-
with ``EXPLAIN (FORMAT JSON)`` under the hood, so callers cannot tell that
|
|
20
|
-
the plan was inspected.
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
def __init__(self, query: str, plan: dict[str, Any]) -> None:
|
|
24
|
-
self.query = query
|
|
25
|
-
self.plan = plan
|
|
26
|
-
super().__init__(f"Unoptimized query uses a sequential scan: {query!r}")
|
|
27
|
-
|
|
28
|
-
|
|
29
17
|
_EXPLAINABLE_COMMAND_TAGS = frozenset({"SELECT", "INSERT", "UPDATE", "DELETE"})
|
|
30
18
|
|
|
31
19
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{turbo_lambda-0.9.0 → turbo_lambda-0.9.2}/src/turbo_lambda/scripts/update_turbo_lambda_layer.py
RENAMED
|
File without changes
|
|
File without changes
|