Not exactly what you want, but I've been using https://sqlc.dev to generate hydration code from SQL queries and loving it!
I've not use this myself, but Ben Johnson's https://github.com/benbjohnson/postlite in front of SQlite might allow you to use PostgREST? I recall him saying on a podcast that his goal was to be able to point the large ecosystem of PG tools at SQlite.
Re:Go and SQLite in the Cloud
by 0cf8612b2e1e on Wednesday December 07, 2022 @01:54PM
(#33898504)
A long way off from PostgREST, but you might be able to hack together something sort of similar with Datasette [0] and the new JSON api. Not out of the box at all, but the potential is there to get a similar product.
Re:Go and SQLite in the Cloud
by nileshtrivedi on Wednesday December 07, 2022 @03:01PM
(#33899435)
AFAIK, Datasette only offers read-only APIs.
Re:Go and SQLite in the Cloud
by 0cf8612b2e1e on Wednesday December 07, 2022 @03:09PM
(#33899553)
Not anymore [0]. The announcement [1]
[0]: https://docs.datasette.io/en/latest/json_api.html#the-json-w...
[1]: https://simonwillison.net/2022/Dec/2/datasette-write-api/
Yes there is but not FOSS
https://github.com/subzerocloud/showcase/tree/main/flyio-sql...
The APIs can even support authentication and authorization with the help of JWT tokens. SQLite may not have row-level security, but even a convention (eg: if a row has user_id column, the JWT must have the same user_id value to get access to a row) would go a long way.