4 ms·
I'd like to avoid writing boilerplate CRUD code. Is there an equivalent of PostgREST but for SQLite? Essentially, a standard binary would read the schema metada
by nileshtrivedi 4y ago
I'd like to avoid writing boilerplate CRUD code. Is there an equivalent of PostgREST but for SQLite? Essentially, a standard binary would read the schema metadata, and generate standard CRUD APIs: https://postgrest.org/en/stable/api.html https://postgrest.org/en/stable/api.html
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.
- 0cf8612b2e1e 4y agoA 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. [0]: https://datasette.io/ https://datasette.io/
- nileshtrivedi 4y agoAFAIK, Datasette only offers read-only APIs.
- 0cf8612b2e1e 4y agoNot anymore [0]. The announcement [1] [0]: https://docs.datasette.io/en/latest/json_api.html#the-json-write-api https://docs.datasette.io/en/latest/json_api.html#the-json-w... [1]: https://simonwillison.net/2022/Dec/2/datasette-write-api/ https://simonwillison.net/2022/Dec/2/datasette-write-api/
- deleted 4y ago[deleted]
- LVB 4y agoI've not use this myself, but Ben Johnson's https://github.com/benbjohnson/postlite 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.
- Cwizard 4y agoHave you tried pocketbase?
- iccananea 4y agoNot exactly what you want, but I've been using https://sqlc.dev https://sqlc.dev to generate hydration code from SQL queries and loving it!
- mjay23 4y agoYes there is but not FOSS https://github.com/subzerocloud/showcase/tree/main/flyio-sqlite-litefs https://github.com/subzerocloud/showcase/tree/main/flyio-sql...