How to easily create your own SQLite Virtual Table

What is a Virtual Table? "Normal" tables consist of rows and columns. Plenty of data sources - like APIs - don't quite adhere to this format, but with a little "data massaging" can be made to output data into rows/columns. This is exactly what a virtual table does... SQLite can execute your own programs which … Continue reading How to easily create your own SQLite Virtual Table

Reasoning about “complicated” Postgres SQL queries

TL;DR When building non-trivial SQL queries, it helps to: State your objective in as "declarative" a way as possible Work from the "inside out". When using subqueries in SQL it helps to find the innermost nested subquery and work your way outwards to figure out what is going on. Similarly, I find that when building … Continue reading Reasoning about “complicated” Postgres SQL queries