sqlite3 on cs50 does have foreign key capabilities. If you want to enforce foreign key constraints in phpLiteAdmin (or sqlite3), the command is simply PRAGMA foreign_keys = ON;
. You would only use db.execute("PRAGMA foreign_keys = ON");
in python (execute
is a method of a SQL object). Foreign key support must be turned "on" for every database connection, so the db.execute
would probably go right after db
is instantiated in application.py.