added test, tolerating non-DDL, non-DML keywords like BEGIN · CO2RR/python-cs50@a130c1b · GitHub
Skip to content

Commit a130c1b

Browse files
committed
added test, tolerating non-DDL, non-DML keywords like BEGIN
1 parent 431a432 commit a130c1b

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion

src/cs50/sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def execute(self, sql, *args, **kwargs):
126126
command = token.value.upper()
127127
break
128128
else:
129-
raise RuntimeError("unrecognized command")
129+
command = None
130130

131131
# Flatten statement
132132
tokens = list(statements[0].flatten())

tests/sql.py

Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)