Developing DB Extensions in Python: Examples for SQLite, DuckDB & PostgreSQL
summary
Covers concrete recipes for extending SQLite, DuckDB and PostgreSQL: register Python callables with sqlite3.create_function, use PL/Python for in‑server functions or embed CPython in an extension, and write aggregates that run inside the engine. Shows working projects: a PDF data type (pgPDF), a JQ-style JSON mapper, a Redis‑like Postgres API, window functions and a zip generator, plus correlation aggregates (nonlinear scores computed in‑DB, “detect correlations in under ten lines” demonstrated). Notes performance, security (superuser/unsafe PL concerns) and when C is still required.
AI-written summary · about
chapters (7)
- 0:00Introduction and background
- 1:32Python vs SQL fundamentals
- 5:21SQL extensions explained
- 9:13Extending databases with Python
- 14:49SQLite and DuckDB comparison
- 18:04Custom aggregates and analytics
- 21:48Practical advice for Python developers
related talks
31mExtending SQL Databases with Python
43mPL/Python -- Python inside the PostgreSQL RDBMS
42mPostgreSQL Extensions: A Deep Dive
51mPostgres with Python inside and out: PL/Python
28mBeyond Postgres: Insights about the PostgreSQL Extensibility
39mPython and SQL: Better Together, Powered by DuckDB
33mDuckDB – Overview and latest developments
46mUse PostgreSQL to Step Up Your Game
