Database Sorcery 101 Ditch the Ancient SQL Scrolls for SQLModel
summary
Demonstrates replacing raw SQL/SQLAlchemy strings with SQLModel class-based schemas, creating a SQLite engine, auto-creating a wizards table, inserting a record named "Gandalf" via a session and reading it back as an object (no tuple indices), and adding Pydantic field validators that reject empty names. Claims SQLModel is beginner-friendly and built on SQLAlchemy, but notes class-as-table convenience comes with costs: Pydantic validators are slow and advanced multi-join queries become awkward. Overall the demo works but warns about performance and complexity limits.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:48Data runs the modern world
- 3:32Introduction
- 4:55Traditional SQL in Python
- 10:36SQLModel for cleaner code
- 13:18Creating tables with SQLModel
- 15:30Connecting with SQLModel
- 18:42Inserting and querying data
- 23:08SQLModel advantages
- 24:09Field validators in SQLModel
- 27:49SQLModel limitations
- 28:31Closing and Q&A
related talks
01h 28mSQLAlchemy and You - Making SQL the Best Thing Since Sliced Bread
30mThe magic of SQLAlchemy
32mNo More Raw SQL: SQLAlchemy & ORMs
34mLet's talk Databases in Python: SQLAlchemy and Alembic
32mBecause SQL is everywhere but you don't want to use it
39mLet's Build an ORM
37mNo More Raw SQL with SQLAlchemy and ORMs
40mLet's SQL Like It's 1992!
