{"repo":"PRQL/dbt-prql","free":true,"listed":false,"github":"https://github.com/PRQL/dbt-prql","clone":"git clone https://github.com/PRQL/dbt-prql.git","description":"dbt-prql allows writing PRQL in dbt models","language":"Python","stars":108,"topics":["dbt","sql","prql"],"license":"Apache-2.0","category":"data-pipelines","readme_excerpt":"dbt-prql Note As of Feb 2023, we're again considering how to best integrate with dbt more closely. Ideally a file with a .prql extension will just work™. If you're interested in this, subscribe or 👍 to . The original plugin is hosted here, but only works with a minority of dialects, and isn't a focus of development at the moment. dbt-prql allows writing PRQL in dbt models. This combines the benefits of PRQL's power & simplicity within queries, with dbt's version control, lineage & testing across queries. Once dbt-prql in installed, dbt commands compile PRQL between {% prql %} & {% endprql %} jinja tags to SQL as part of dbt's compilation. No additional config is required. Examples Simple example ...would appear to dbt as: Less simple example ...would appear to dbt as: ...and then dbt will compile the source and ref s to a full SQL query. Replacing macros dbt's use of macros has saved many of us many lines of code, and even saved some people some time. But imperatively programming text generation with code like if not loop.last is not our highest calling. It's the \"necessary\" part rather than beautiful part of dbt. Here's the canonical example of macros in the dbt documentation: Here's that model using PRQL[^1], including the prql jinja tags. As well the query being simpler in its final form, writing in PRQL also gives us live feedback around any errors, on every keystroke. Though there's much more to come, check out the current version on PRQL Playground. [^1]: Note that whe","default_branch":null,"files":null,"tree":[],"storefront":"/r/PRQL","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/PRQL/dbt-prql/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}