Commit e92aaf0e authored by Ismail Moumni's avatar Ismail Moumni
Browse files

adding db_insert

parent 70986542
Pipeline #723 failed with stage
in 14 seconds
......@@ -22,3 +22,10 @@ tests/__pycache__/test_query_valid.cpython-38-pytest-6.0.2.pyc
tests/__pycache__/test_mail.cpython-38-pytest-6.0.2.pyc
softwares/mailer/__init__.py
softwares/server/__init__.py
softwares/database/__pycache__/__init__.cpython-38.pyc
tests/__pycache__/test_missing_json.cpython-38-pytest-6.0.2.pyc
tests/__pycache__/test_missing_keys.cpython-38-pytest-6.0.2.pyc
softwares/database/__pycache__/database.cpython-38.pyc
tests/__pycache__/test_match_dict.cpython-38-pytest-6.0.2.pyc
tests/__pycache__/test_match_json.cpython-38-pytest-6.0.2.pyc
tests/__pycache__/test_match_query.cpython-38-pytest-6.0.2.pyc
......@@ -10,7 +10,7 @@ sys.path.append(os.path.realpath('../softwares/'))
__RDOS_Dict__ = {}
# tools List
__RDOS_Tool__ = []
__RDOS_Tool__ = {}
class RdosServer:
......@@ -127,3 +127,16 @@ def db_generators(req: dict):
return s
else:
raise Exception("Error Database")
# Function db_insert send a query to insert in database by socket
# Function db_insert takes a socket and dictionary for input
# Function db_insert returns a string if query send
def db_insert(s: socket, req: dict):
if(req is not None):
if (verif_param(req) == req):
s.send(bytes(json.dumps(req), "utf-8")
print("Query send")
else:
raise Exception("Query Doesn't match")
raise Exception("Invalid Query")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment