▲ | dgllghr 2 days ago | |||||||
I wish the macro approach to SQLite in Swift was about generating types from a raw query rather than generating table types. I don’t want an ORM. I want to be able to write raw SQL and have the compiler check that SQL for correctness and generate the proper bindings and types for using it. Similar projects like sqlx in rust or safeql in typescript already do this. | ||||||||
▲ | mbw234 2 days ago | parent [-] | |||||||
> I want to be able to write raw SQL and have the compiler check that SQL for correctness and generate the proper bindings and types for using it. Our library does allow this a little bit, in addition to a Swift API for building queries. You can write SQL as a string while still using the schema information exposed from the @Table macro. For example, a query to select all reminders lists along with a count of the reminders in each list:
| ||||||||
|