Add ability to add new http functions (Needs refactor, bad stuff)

This commit is contained in:
Peter Stockings
2023-12-16 21:27:49 +11:00
parent efa815c5cb
commit d8b441374e
4 changed files with 167 additions and 1 deletions

4
db.py
View File

@@ -55,3 +55,7 @@ class DataBase():
http_function = self.execute(
'SELECT id, NAME, script_content, invoked_count FROM http_functions WHERE NAME=%s', [name], one=True)
return http_function
def create_new_http_function(self, name, script_content):
self.execute(
'INSERT INTO http_functions (NAME, script_content) VALUES (%s, %s)', [name, script_content], commit=True)