api-foundry-query-engine 0.8.8__tar.gz → 0.8.10__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.8 → api_foundry_query_engine-0.8.10}/PKG-INFO +1 -1
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/dao/sql_query_handler.py +1 -1
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/dao/sql_select_query_handler.py +2 -2
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/dao/sql_subselect_query_handler.py +1 -1
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/lambda_handler.py +3 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/utils/api_model.py +3 -1
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/pyproject.toml +1 -1
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/.gitignore +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/LICENSE +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/.pre-commit-config.yaml +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/__init__.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/adapters/adapter.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/adapters/case_change_adapter.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/adapters/gateway_adapter.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/adapters/security_adapter.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/connectors/athena_connector.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/connectors/connection.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/connectors/connection_factory.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/connectors/oracle_connector.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/connectors/postgres_connection.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/dao/dao.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/dao/operation_dao.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/dao/sql_custom_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/dao/sql_delete_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/dao/sql_insert_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/dao/sql_update_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/operation.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/services/security_service.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/services/service.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/services/transactional_service.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/utils/app_exception.py +0 -0
- {api_foundry_query_engine-0.8.8 → api_foundry_query_engine-0.8.10}/api_foundry_query_engine/utils/logger.py +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.10
|
|
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
|
|
@@ -346,7 +346,7 @@ class SQLSchemaQueryHandler(SQLQueryHandler):
|
|
|
346
346
|
|
|
347
347
|
@property
|
|
348
348
|
def table_expression(self) -> str:
|
|
349
|
-
return self.schema_object.
|
|
349
|
+
return self.schema_object.qualified_name or ""
|
|
350
350
|
|
|
351
351
|
@property
|
|
352
352
|
def selection_results(self) -> Dict:
|
|
@@ -99,7 +99,7 @@ class SQLSelectSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
99
99
|
if child_prefix in self.active_prefixes:
|
|
100
100
|
joins.append(
|
|
101
101
|
"INNER JOIN "
|
|
102
|
-
+ str(relation.child_schema_object.
|
|
102
|
+
+ str(relation.child_schema_object.qualified_name)
|
|
103
103
|
+ " AS "
|
|
104
104
|
+ child_prefix
|
|
105
105
|
+ " ON "
|
|
@@ -113,7 +113,7 @@ class SQLSelectSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
113
113
|
)
|
|
114
114
|
|
|
115
115
|
return (
|
|
116
|
-
str(self.schema_object.
|
|
116
|
+
str(self.schema_object.qualified_name)
|
|
117
117
|
+ " AS "
|
|
118
118
|
+ str(self.prefix_map[str(self.schema_object.api_name)])
|
|
119
119
|
+ (f" {' '.join(joins)}" if len(joins) > 0 else "")
|
|
@@ -53,7 +53,7 @@ class SQLSubselectSchemaQueryHandler(SQLSelectSchemaQueryHandler):
|
|
|
53
53
|
|
|
54
54
|
sql = (
|
|
55
55
|
f"SELECT {self.select_list} "
|
|
56
|
-
+ f"FROM {self.relation.child_schema_object.
|
|
56
|
+
+ f"FROM {self.relation.child_schema_object.qualified_name} "
|
|
57
57
|
+ f"WHERE {self.relation.child_property} "
|
|
58
58
|
+ f"IN ( SELECT {self.relation.parent_property} "
|
|
59
59
|
+ f"FROM {self.parent_generator.table_expression}"
|
|
@@ -9,6 +9,7 @@ from api_foundry_query_engine.adapters.gateway_adapter import GatewayAdapter
|
|
|
9
9
|
|
|
10
10
|
log = logging.getLogger(__name__)
|
|
11
11
|
|
|
12
|
+
|
|
12
13
|
class QueryEngine:
|
|
13
14
|
def __init__(self, config: Mapping[str, str]):
|
|
14
15
|
self.adapter = GatewayAdapter(config)
|
|
@@ -42,9 +43,11 @@ class QueryEngine:
|
|
|
42
43
|
"body": json.dumps({"message": f"exception: {e}"}),
|
|
43
44
|
}
|
|
44
45
|
|
|
46
|
+
|
|
45
47
|
engine_config: Optional[Mapping[str, str]] = None
|
|
46
48
|
query_engine: Optional[QueryEngine] = None
|
|
47
49
|
|
|
50
|
+
|
|
48
51
|
def handler(event, _):
|
|
49
52
|
global engine_config, query_engine
|
|
50
53
|
log.info(f"engine_config: {engine_config}")
|
|
@@ -153,7 +153,9 @@ class SchemaObject:
|
|
|
153
153
|
def __init__(self, data: Dict[str, Any]):
|
|
154
154
|
self.api_name: str = str(data.get("api_name"))
|
|
155
155
|
self.database: str = str(data.get("database"))
|
|
156
|
+
self.schema: Optional[str] = data.get("schema")
|
|
156
157
|
self.table_name: str = str(data.get("table_name"))
|
|
158
|
+
self.qualified_name: str = f"{self.schema}.{self.table_name}" if self.schema else self.table_name
|
|
157
159
|
self.properties: Dict[str, SchemaObjectProperty] = {
|
|
158
160
|
name: SchemaObjectProperty(prop_data)
|
|
159
161
|
for name, prop_data in data.get("properties", {}).items()
|
|
@@ -235,7 +237,7 @@ def set_api_model(engine_config: Mapping[str, str]):
|
|
|
235
237
|
if engine_config.get("API_SPEC"):
|
|
236
238
|
api_model = APIModel(yaml.safe_load(engine_config["API_SPEC"]))
|
|
237
239
|
else:
|
|
238
|
-
log.info("Loading API model from file")
|
|
240
|
+
log.info("Loading API model from file")
|
|
239
241
|
with open(
|
|
240
242
|
os.environ.get("API_SPEC", "/var/task/api_spec.yaml"), "r"
|
|
241
243
|
) as file:
|
|
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
|