MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / edit

Function edit

projects/CRUD-with-postgresql/main.py:130–141  ·  view source on GitHub ↗
(key, value)

Source from the content-addressed store, hash-verified

128
129 # Edit a entry in the table
130 def edit(key, value):
131 console.print(
132 "Enter The New Values to Update in the form of a name url channel"
133 )
134 new_record = str(Prompt.ask("Enter Here: "))
135 new_records = new_record.split()
136 # Execute the query to update the table
137 cursor.execute(
138 f"UPDATE dbview SET name='{new_records[0]}', url='{new_records[1]}', author='{new_records[2]}' WHERE {key}='{value}'"
139 )
140 console.log(":green_circle: Successfully Updated Database")
141 table()
142
143 # Get the hash of a entry
144 def hash():

Callers 1

main.pyFile · 0.85

Calls 2

tableFunction · 0.85
executeMethod · 0.45

Tested by

no test coverage detected