Repository navigation
Conversation
…-path trap
The demo API pointed at database.db while Part 1 of the lab creates
university.db. sqlite3.connect() silently created an empty database.db,
so every request to /students failed with "no such table: students".
Point the demo at university.db to match the lab handout, add a
student-facing comment above the path ("check where you are connecting,
which one is my database?"), and ignore the generated university.db.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
class-2/week2-sqlite/main.pyconnected todatabase.db, but Part 1 of the lab createsuniversity.db. SQLite silently created an emptydatabase.db, so/studentsfailed withno such table: students.university.db, matching the lab handout (part-1.mdandpart-2.md).sqlite3.connect()creates an empty file when the path is wrong, so the symptom is "no such table" rather than "file not found".university.dbto.gitignore(same convention asapp.db/auth.db), since Part 1 has students generate and reset it fromsetup_students.sql.This is also the first commit of the
week2-sqlitedemo project (main.py,requirements.txt,setup_students.sql).Test plan
class-2/week2-sqlite, create the database if it does not exist yet:sqlite3 -bail university.db ".read setup_students.sql".venv, runuvicorn main:app --reload, openhttp://127.0.0.1:8000/students🤖 Generated with Claude Code