Closed
Description
Not sure if this is expected, but caused some issues for check50...
Let's say we set up a database as:
$ echo "CREATE TABLE users (name TEXT); INSERT INTO users (name) VALUES ('Alice')" | sqlite3 foo.db
And run the following Python program:
from cs50 import SQL
db = SQL("sqlite:///foo.db")
with open("query.sql") as f:
print(db.execute(f.read()))
If query.sql
contains
SELECT * FROM users
the program prints the contents of the table, but if query.sql
contains
-- Get all users
SELECT * FROM users
then the return of db.execute
is just True
.