api-foundry-query-engine 0.8.79__tar.gz → 0.8.82__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.
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/PKG-INFO +1 -1
- api_foundry_query_engine-0.8.82/api_foundry_query_engine/__init__.py +1 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/dao/sql_select_query_handler.py +12 -1
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/lambda_handler.py +34 -1
- api_foundry_query_engine-0.8.79/api_foundry_query_engine/__init__.py +0 -1
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/.gitignore +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/LICENSE +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/.pre-commit-config.yaml +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/adapters/adapter.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/adapters/gateway_adapter.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/connectors/connection.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/connectors/connection_factory.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/connectors/postgres_connection.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/dao/batch_operation_handler.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/dao/dao.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/dao/operation_dao.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/dao/sql_custom_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/dao/sql_delete_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/dao/sql_insert_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/dao/sql_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/dao/sql_restore_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/dao/sql_subselect_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/dao/sql_update_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/operation.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/services/service.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/services/transactional_service.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/utils/api_model.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/utils/app_exception.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/utils/claims_check.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/utils/dependency_resolver.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/utils/logger.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/utils/reference_resolver.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/api_foundry_query_engine/utils/token_decoder.py +0 -0
- {api_foundry_query_engine-0.8.79 → api_foundry_query_engine-0.8.82}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: api-foundry-query-engine
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.82
|
|
4
4
|
Summary: The AWS lambda service handler use by the `api_foundry` project is a powerful tool designed to automate the deployment of REST APIs on AWS using Lambda services to access and interact with relational databases (RDBMS). This project leverages the OpenAPI specification to define and manage the APIs
|
|
5
5
|
Project-URL: Documentation, https://github.com/DanRepik/api-foundry
|
|
6
6
|
Project-URL: Source, https://github.com/DanRepik/api-foundry
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.8.82"
|
|
@@ -281,10 +281,21 @@ class SQLSelectSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
281
281
|
schema_object.permissions,
|
|
282
282
|
schema_object.properties,
|
|
283
283
|
)
|
|
284
|
+
# Only genuine joined relations need their columns
|
|
285
|
+
# qualified (e.g. "customer.name", to disambiguate from
|
|
286
|
+
# the parent's own "name") -- the primary entity's own
|
|
287
|
+
# properties come back from the cursor under their bare
|
|
288
|
+
# column names, and marshal_record/the post-fetch column
|
|
289
|
+
# filter in PostgresCursor.execute both key off that.
|
|
290
|
+
# Prefixing them too (self.prefix_map[relation], as
|
|
291
|
+
# before) produced selection_results keys like "q.slug"
|
|
292
|
+
# that never matched any real result column, so every
|
|
293
|
+
# row came back empty and marshal_record KeyError'd
|
|
294
|
+
# trying to unwrap it.
|
|
284
295
|
filtered_keys = self.filter_and_prefix_keys(
|
|
285
296
|
reg_exs,
|
|
286
297
|
allowed_properties,
|
|
287
|
-
self.prefix_map[relation],
|
|
298
|
+
self.prefix_map[relation] if relation_property else None,
|
|
288
299
|
)
|
|
289
300
|
|
|
290
301
|
# Extend the result map with the filtered keys
|
|
@@ -13,21 +13,54 @@ logging.basicConfig(level=os.getenv("LOG_LEVEL", "INFO"))
|
|
|
13
13
|
log = logging.getLogger(__name__)
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
# Lambda rejects synchronous responses over 6 MB (6,291,556 bytes including
|
|
17
|
+
# its own envelope); API Gateway then surfaces that as an opaque
|
|
18
|
+
# "502 Internal server error". The margin leaves room for the statusCode/
|
|
19
|
+
# headers wrapper so a body under the limit can't still be refused.
|
|
20
|
+
DEFAULT_MAX_RESPONSE_BYTES = 6 * 1024 * 1024 - 4096
|
|
21
|
+
|
|
22
|
+
|
|
16
23
|
class QueryEngine:
|
|
17
24
|
def __init__(self, config: Mapping[str, str]):
|
|
18
25
|
self.adapter = GatewayAdapter(config)
|
|
26
|
+
self.max_response_bytes = int(
|
|
27
|
+
config.get("MAX_RESPONSE_BYTES") or DEFAULT_MAX_RESPONSE_BYTES
|
|
28
|
+
)
|
|
19
29
|
|
|
20
30
|
def handler(self, event) -> dict[str, Any]:
|
|
21
31
|
log.debug("event: %s", event)
|
|
22
32
|
try:
|
|
23
33
|
response = self.adapter.process_event(event)
|
|
34
|
+
body = json.dumps(response)
|
|
35
|
+
|
|
36
|
+
# json.dumps escapes to ASCII by default, so len(body) is bytes.
|
|
37
|
+
if len(body) > self.max_response_bytes:
|
|
38
|
+
log.error(
|
|
39
|
+
"response of %d bytes exceeds limit of %d bytes",
|
|
40
|
+
len(body),
|
|
41
|
+
self.max_response_bytes,
|
|
42
|
+
)
|
|
43
|
+
return {
|
|
44
|
+
"isBase64Encoded": False,
|
|
45
|
+
"statusCode": 502,
|
|
46
|
+
"headers": {"Content-Type": "application/json"},
|
|
47
|
+
"body": json.dumps(
|
|
48
|
+
{
|
|
49
|
+
"message": (
|
|
50
|
+
f"response of {len(body)} bytes exceeds the "
|
|
51
|
+
f"maximum of {self.max_response_bytes} bytes; "
|
|
52
|
+
"narrow the request with filters"
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
}
|
|
24
57
|
|
|
25
58
|
# Ensure the response conforms to API Gateway requirements
|
|
26
59
|
return {
|
|
27
60
|
"isBase64Encoded": False,
|
|
28
61
|
"statusCode": 200,
|
|
29
62
|
"headers": {"Content-Type": "application/json"},
|
|
30
|
-
"body":
|
|
63
|
+
"body": body,
|
|
31
64
|
}
|
|
32
65
|
except ApplicationException as e:
|
|
33
66
|
log.error("exception: %s", e, exc_info=True)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.8.79"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|