api-foundry-query-engine 0.0.1__tar.gz → 0.0.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.
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/PKG-INFO +1 -1
- api_foundry_query_engine-0.0.2/api_foundry_query_engine/__init__.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/dao/sql_select_query_handler.py +1 -1
- api_foundry_query_engine-0.0.2/api_foundry_query_engine/lambda_handler.py +44 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/utils/api_model.py +8 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/pyproject.toml +1 -1
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/.gitignore +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/LICENSE +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/adapters/adapter.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/adapters/case_change_adapter.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/adapters/gateway_adapter.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/connectors/connection.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/connectors/connection_factory.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/connectors/oracle_connector.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/connectors/postgres_connection.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/dao/dao.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/dao/operation_dao.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/dao/sql_custom_query_handler.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/dao/sql_delete_query_handler.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/dao/sql_insert_query_handler.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/dao/sql_query_handler.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/dao/sql_subselect_query_handler.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/dao/sql_update_query_handler.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/handler.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/operation.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/services/service.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/services/transactional_service.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/utils/app_exception.py +0 -0
- {api_foundry_query_engine-0.0.1 → api_foundry_query_engine-0.0.2}/api_foundry_query_engine/utils/logger.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: api-foundry-query-engine
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
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
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
from api_foundry_query_engine.utils.app_exception import ApplicationException
|
|
6
|
+
from api_foundry_query_engine.adapters.gateway_adapter import GatewayAdapter
|
|
7
|
+
from api_foundry_query_engine.utils.api_model import load_api
|
|
8
|
+
|
|
9
|
+
log = logging.getLogger(__name__)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
load_api(os.environ.get("API_SPEC", "/var/task/api_spec.yaml"))
|
|
13
|
+
adapter = GatewayAdapter()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def lambda_handler(event, _):
|
|
17
|
+
log.debug(f"event: {event}")
|
|
18
|
+
try:
|
|
19
|
+
response = adapter.process_event(event)
|
|
20
|
+
|
|
21
|
+
# Ensure the response conforms to API Gateway requirements
|
|
22
|
+
return {
|
|
23
|
+
"isBase64Encoded": False,
|
|
24
|
+
"statusCode": 200,
|
|
25
|
+
"headers": {"Content-Type": "application/json"},
|
|
26
|
+
"body": json.dumps(response),
|
|
27
|
+
}
|
|
28
|
+
except ApplicationException as e:
|
|
29
|
+
log.error(f"exception: {e}", exc_info=True)
|
|
30
|
+
return {
|
|
31
|
+
"isBase64Encoded": False,
|
|
32
|
+
"statusCode": e.status_code,
|
|
33
|
+
"headers": {"Content-Type": "application/json"},
|
|
34
|
+
"body": json.dumps({"message": f"exception: {e}"}),
|
|
35
|
+
}
|
|
36
|
+
except Exception as e:
|
|
37
|
+
log.error(f"exception: {e}", exc_info=True)
|
|
38
|
+
return {
|
|
39
|
+
"isBase64Encoded": False,
|
|
40
|
+
"statusCode": 500,
|
|
41
|
+
"headers": {"Content-Type": "application/json"},
|
|
42
|
+
"body": json.dumps({"message": f"exception: {e}"}),
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
import yaml
|
|
3
|
+
|
|
1
4
|
from datetime import datetime
|
|
2
5
|
from typing import Any, Dict, Optional
|
|
3
6
|
|
|
@@ -173,3 +176,8 @@ class APIModel:
|
|
|
173
176
|
def __repr__(self):
|
|
174
177
|
return f"APIModel(schema_objects={list(self.schema_objects.keys())}, path_operations={list(self.path_operations.keys())})"
|
|
175
178
|
|
|
179
|
+
|
|
180
|
+
def load_api(filename: str):
|
|
181
|
+
with open(filename, "r") as file:
|
|
182
|
+
APIModel(yaml.safe_load(file))
|
|
183
|
+
|
|
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
|