Closed jsa-codes closed 2 years ago
def create_tag(new_tag): with sqlite3.connect("./db.sqlite3") as conn: conn.row_factory = sqlite3.Row db_cursor = conn.cursor() db_cursor.execute( """ INSERT INTO TAGS (label) VALUES ( ? ); """, ( new_tag["label"] ), ) id = db_cursor.lastrowid new_tag["id"] = id return new_tag
Created the following code