MCPcopy Create free account
hub / github.com/geekcomputers/Python / update_employee

Method update_employee

bank_managment_system/backend.py:68–72  ·  view source on GitHub ↗
(self, field, new_value, name)

Source from the content-addressed store, hash-verified

66 return self.cur.fetchall()
67
68 def update_employee(self, field, new_value, name):
69 if field not in {"name", "pass", "salary", "position"}:
70 raise ValueError("Invalid employee field")
71 self.cur.execute(f"UPDATE staff SET {field}=? WHERE name=?", (new_value, name))
72 self.conn.commit()
73
74 def check_name_in_staff(self, name):
75 self.cur.execute("SELECT 1 FROM staff WHERE name=?", (name,))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected