4 ms·
I actually wrote a blog post about this exact scenario. It takes ideas from the datasette project (https://simonwillison.net/2017/Nov/13/datasette/#Arbitrary_SQ
by james2doyle 5y ago
I actually wrote a blog post about this exact scenario. It takes ideas from the datasette project (https://simonwillison.net/2017/Nov/13/datasette/#Arbitrary_SQL_55 https://simonwillison.net/2017/Nov/13/datasette/#Arbitrary_S...). My example opens a read-only sqlite db and exposes the entire SQL API through a single PHP file.
The post is here: https://ohdoylerules.com/web/sql-as-an-api/ https://ohdoylerules.com/web/sql-as-an-api/
The code is here: https://gist.github.com/james2doyle/9e4b2b4f17e33bfb236fbdaf96c41a4c https://gist.github.com/james2doyle/9e4b2b4f17e33bfb236fbdaf...