import sqlite3
def find_details(id2find):
db = sqlite3.connect("surfersDB.sdb")
# grap surfer data from database
db.row_factory = sqlite3.Row
cursor = db.cursor()
cursor.execute("select * from surfers")
rows = cursor.fetchall()
In the code snippet above from "Head First Programming", the syntax for the database code is poorly explained.
Is row_factory a call, method, or just a variable based on sqlite3.Row. And what is sqlite3.Row?
And if row_factory is just a variable, why is it proceeded with a db and the two cursor lines and the rows in the line rows = cursor.getchall are not.
Non of this is explained in the book, please help.