Metrics in SQL: querying a semantic layer via DuckDB over the pg protocol
github.com
github.com
You may or may not be familiar with the DBT semantic layer. It's out of reach due to cost for many folks— requires expensive monthly fees.
SQLMesh includes a query rewriter if you have defined any metrics, so I simply added it to the existing buenavista query rewriter and added a sample SQLMesh project. Cheers.