~/talk

Yes, You Can Test SQL

Talkat PyCon US 2026 · 2026-05-13..05-19· [testing]
slides:none on file

Covers concrete techniques: run raw SQL against an in-memory SQLite or DuckDB transpile to SQLite for fast transformation tests, or spin up a real Postgres with Docker Compose Postgres fixture and pytest fixtures to get true-dialect behavior. Shows injecting seed rows via a CTE-injected test seed so tests run without touching prod, using pytest parametrized cases, metadata reflection to copy schemas, and automating linters and tests with pre-commit and CI workflows.

AI-written summary · about

  1. 0:00Introduction
  2. 1:10Why SQL testing is hard
  3. 3:18Manual vs automated testing
  4. 4:23Orders table example
  5. 5:05Arrange Act Assert pattern
  6. 7:12Testing logic with test doubles
  7. 8:57DB-API and Pytest fixtures
  8. 11:03SQLite and DuckDB testing
  9. 13:33Transpiling SQL dialects
  10. 14:56Testing with real DBs in containers
  11. 21:12Schema changes and data round trips
  12. 24:42Isolating tests and state
  13. 26:47Schema reflection and detection
  14. 28:31Tools beyond hand-rolled
  15. 29:38Formatters linters pre-commit hooks
  16. 31:23Data quality vs unit testing
  17. 32:05Key takeaways and next steps
~/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.