6 ms·
Recently I tried using SQL directly on the frontend: https://medium.com/@unodgs/sql-on-the-frontend-react-postgres-and-rls-part-1-76bbe4f97353 https://medium.co
by unodgs 6y ago
Recently I tried using SQL directly on the frontend: https://medium.com/@unodgs/sql-on-the-frontend-react-postgres-and-rls-part-1-76bbe4f97353 https://medium.com/@unodgs/sql-on-the-frontend-react-postgre... as an alternative to GraphQL which I also find too complicated. You might find this interesting.
- simonw 6y agoI've been experimenting with SQL as an API language - including client-side SQL constructed in JavaScript - fir a couple of years with my Datasette project. I'm using similar security tricks to you: read-only queries with a time limit, against SQLite rather than PostgreSQL. More here: https://simonwillison.net/2018/Oct/4/datasette-ideas/ https://simonwillison.net/2018/Oct/4/datasette-ideas/ and https://github.com/simonw/datasette https://github.com/simonw/datasette
- unodgs 6y agoGreat to see that! Did it work well for you?
- shean_massey 6y agoIt took me a solid month before graphql finally "clicked" but there's no going back now, I absolutely prefer it over rest now. 10/10 would do again and do suggest everybody give it a try.
- devxpy 6y agoThis makes a ton of sense to me, thanks for sharing your learnings. I see very little value in using GraphQL, when you can just write SQL on the client! We desperately need frameworks to better facilitate this, like Hasura or Django -- DB migrations, permissions, authentication, real-time subscriptions, Admin UI. My most wanted feature is SQL type providers, like Rezoom.SQL - https://github.com/rspeele/Rezoom.SQL https://github.com/rspeele/Rezoom.SQL