{"repo":"wickwirew/PureSQL","free":true,"listed":false,"github":"https://github.com/wickwirew/PureSQL","clone":"git clone https://github.com/wickwirew/PureSQL.git","description":"A SQLite code generator, compiler, and static analyzer for Swift","language":"Swift","stars":49,"topics":["compiler","sql","sqlite","swift"],"license":"MIT","category":"databases-storage","readme_excerpt":"A SQLite compiler, static analyzer and code generator for Swift ❤️ Generate Swift code from plain SQL Overview PureSQL is a pure Swift SQL compiler that allows developers to simply write plain SQL with compile time safety. If your database schema changes, you will get compile time errors for the places that need to be fixed. It doesn't just generate the code to talk to SQLite, but rather your entire data layer in a testable flexible manner. No more writing mocks or wrappers. Just pass in the query. - Installation - Macros - Queries - Types - Dependency Injection Basic Primer As a quick intro, here is a basic example. First, in SQL we will create our migrations and our first query. PureSQL will automatically generate all structs for the tables and queries providing the APIs below PureSQL is built with testing in mind. Dependency injection is possible right out of the box. No need to wrap your database in repositories. Just pass in the any Query and you can pass in Queries.Just , Queries.Fail or even Queries.Test for call counts. Or Use the Swift Macro PureSQL can even run within a Swift macro by adding the @Database macro to a struct . [!IMPORTANT] As of now it is not recommended for larger projects. There are quite a few limitations that won't scale well beyond a fairly simple schema and a handful of queries. Anatomy of @Query 1. The raw SQL to execute 2. Optionally supply a custom type name for the generated input type. 3. Optionally supply a custom type name for the generat","default_branch":null,"files":null,"tree":[],"storefront":"/r/wickwirew","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/wickwirew/PureSQL/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."}