{"repo":"naiquevin/tapestry","free":true,"listed":false,"github":"https://github.com/naiquevin/tapestry","clone":"git clone https://github.com/naiquevin/tapestry.git","description":"A CLI tool for writing postgres SQL queries and pgTAP tests using Jinja templates","language":"Rust","stars":37,"topics":["pgtap","postgresql","sql"],"license":"MIT","category":"databases-storage","readme_excerpt":"Tapestry ======== Tapestry is a framework for writing (postgres)SQL queries and (pgTAP) tests using Jinja templates. It helps you write reusable SQL code and ensures that your pgTAP tests are testing the exact same SQL queries that are actually run by your application. Tapestry is written in Rust but it can be used with applications written in any programming language. It's purely a command line tool that renders Jinja templates into SQL files. How to load the resulting SQL code into memory and use it at runtime is entirely up to the application. This approach of loading SQL from files is not new. There are existing libraries such as yesql, hugsql (Clojure), aiosql (Python) etc. that provide excellent abstractions for it. In absence of such a lib for the language of your choice, it shouldn't take more than a few lines of code to implement a simple file loader. In Rust apps, I simply use the include str! macro. One limitation is that tapestry can only be used with PostgreSQL, because of the tight coupling with pgTAP . You may find this tool useful if, 1. you prefer direct SQL queries over ORMs or query builders to interact with RDBMS from application code 2. you are not averse to the idea of having (reasonable amount of) business logic inside SQL queries In fact, if you have had concerns about point 2 i.e. having business logic in SQL queries, perhaps tapestry addresses some of those concerns. Learn more about the rationale behind this tool. Current status -------------- Tapes","default_branch":null,"files":null,"tree":[],"storefront":"/r/naiquevin","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/naiquevin/tapestry/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."}