I've been using dbt for achieving the same goals and it's honestly been a bliss. Macros, packages, cross referencing views, unit tests, documentation generation, snapshotting.

And I don't even swear as much at jinja as I thought I would.

dbt allows macros to resolve arguments at "evaluation" time by nesting queries (for example, get a list of DISTINCT values so that they can be then used as column names), which is really useful. I have a particularly nasty database schema (thanks, wordpress) to deal with, and I now have plenty of macros that do the dirty stuff for me.

Intriguing! I would like to learn more about how well dbt can "take over"/reverse engineer an existing database.

> What is dbt?

https://docs.getdbt.com/docs/introduction

Collaborate on data models, version them, and test and document your queries before safely deploying them to production, with monitoring and visibility.

https://docs.getdbt.com/docs/supported-data-platforms

--

core: https://github.com/dbt-labs/dbt-core - Python, Apache 2 license

cloud: https://www.getdbt.com/pricing/