MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / delete_record

Function delete_record

24-class-metaprog/persistent/dblib.py:157–161  ·  view source on GitHub ↗
(table_name: str, pk: int)

Source from the content-addressed store, hash-verified

155
156
157def delete_record(table_name: str, pk: int) -> sqlite3.Cursor:
158 con = get_connection()
159 check_identifier(table_name)
160 sql = f'DELETE FROM {table_name} WHERE pk = ?'
161 return con.execute(sql, (pk,))

Callers 1

test_delete_recordFunction · 0.90

Calls 3

get_connectionFunction · 0.85
check_identifierFunction · 0.85
executeMethod · 0.80

Tested by 1

test_delete_recordFunction · 0.72