~/talk

TUTORIAL: SQLAlchemy 2.0

Talkat Python Web Conf 2023 · 2023-03-13..03-17· [databases, python]
slides:none on file

Covers how SQLAlchemy 2.0 actually connects, models and persists: create an engine with create_engine('sqlite:///:memory:'), use base.metadata.create_all under engine.begin to emit DDL, declare ORM models with the new mapped_as_dataclass + mapped_column annotations (server defaults via func.now), run inserts/selects with parameterized statements or session.execute/session.scalars, and persist objects via session.add → flush/identity‑map → session.commit, showing the same Python instance returned after flush.

AI-written summary · about

  1. 0:00Introduction to SQLAlchemy
  2. 4:44Working with the engine
  3. 13:23Connection management
  4. 20:33Table metadata modeling
  5. 33:53Creating database schema
  6. 40:07Inserting data
  7. 47:05Bulk data insertion
  8. 54:21Selecting data
  9. 1:10:01Filtering and ordering
  10. 1:22:28ORM session and work unit
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.