Add application execution action for data manipulation bot

This commit is contained in:
Jake Walker
2023-11-24 09:25:55 +00:00
parent 5f1a5af1b4
commit b13a9d3daf
5 changed files with 25 additions and 9 deletions

View File

@@ -141,7 +141,7 @@ class DatabaseClient(Application):
:param sql: The SQL query.
:return: True if the query was successful, otherwise False.
"""
if self.connected and self.operating_state.RUNNING:
if self.connected and self.operating_state == ApplicationOperatingState.RUNNING:
query_id = str(uuid4())
# Initialise the tracker of this ID to False

View File

@@ -50,7 +50,7 @@ class DataManipulationBot(DatabaseClient):
def _init_request_manager(self) -> RequestManager:
rm = super()._init_request_manager()
rm.add_request(name="execute", request_type=RequestType(func=self.execute))
rm.add_request(name="execute", request_type=RequestType(func=lambda request, context: self.execute()))
return rm