api-foundry-query-engine 0.8.37__tar.gz → 0.8.38__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.37 → api_foundry_query_engine-0.8.38}/PKG-INFO +1 -1
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_insert_query_handler.py +29 -2
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/pyproject.toml +1 -1
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/.gitignore +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/LICENSE +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/.pre-commit-config.yaml +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/__init__.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/adapters/adapter.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/adapters/case_change_adapter.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/adapters/gateway_adapter.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/adapters/security_adapter.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/connectors/connection.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/connectors/connection_factory.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/connectors/oracle_connector.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/connectors/postgres_connection.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/batch_operation_handler.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/dao.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/operation_dao.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_custom_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_delete_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_restore_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_select_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_subselect_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_update_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/lambda_handler.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/operation.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/services/service.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/services/transactional_service.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/api_model.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/app_exception.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/claims_check.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/dependency_resolver.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/gateway_operation.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/logger.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/reference_resolver.py +0 -0
- {api_foundry_query_engine-0.8.37 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/token_decoder.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.38
|
|
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
|
|
@@ -45,10 +45,14 @@ class SQLInsertSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
45
45
|
@property
|
|
46
46
|
def sql(self) -> str:
|
|
47
47
|
self.concurrency_property = self.schema_object.concurrency_property
|
|
48
|
+
# Get columns to return - use read permissions if available,
|
|
49
|
+
# otherwise fall back to primary key
|
|
50
|
+
returning_clause = self._get_returning_clause()
|
|
51
|
+
|
|
48
52
|
if not self.concurrency_property:
|
|
49
53
|
return (
|
|
50
54
|
f"INSERT INTO {self.table_expression}{self.insert_values} "
|
|
51
|
-
+
|
|
55
|
+
+ returning_clause
|
|
52
56
|
)
|
|
53
57
|
|
|
54
58
|
if self.operation.store_params.get(self.concurrency_property.api_name):
|
|
@@ -61,9 +65,32 @@ class SQLInsertSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
61
65
|
)
|
|
62
66
|
return (
|
|
63
67
|
f"INSERT INTO {self.table_expression}{self.insert_values}"
|
|
64
|
-
+
|
|
68
|
+
+ returning_clause
|
|
65
69
|
)
|
|
66
70
|
|
|
71
|
+
def _get_returning_clause(self) -> str:
|
|
72
|
+
"""
|
|
73
|
+
Get RETURNING clause with fallback to primary key
|
|
74
|
+
if no read permissions.
|
|
75
|
+
"""
|
|
76
|
+
try:
|
|
77
|
+
select_list = self.select_list
|
|
78
|
+
if select_list:
|
|
79
|
+
return f"RETURNING {select_list}"
|
|
80
|
+
except ApplicationException:
|
|
81
|
+
# If read permissions filter everything,
|
|
82
|
+
# return at least the primary key
|
|
83
|
+
pass
|
|
84
|
+
|
|
85
|
+
# Fallback to primary key
|
|
86
|
+
pk_property = self.schema_object.primary_key_property
|
|
87
|
+
if pk_property:
|
|
88
|
+
return f"RETURNING {pk_property.column_name}"
|
|
89
|
+
|
|
90
|
+
# Last resort - return nothing
|
|
91
|
+
# (should never happen with properly defined schemas)
|
|
92
|
+
return ""
|
|
93
|
+
|
|
67
94
|
@property
|
|
68
95
|
def insert_values(self) -> str:
|
|
69
96
|
self.store_placeholders = {}
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|