4 ms·
This same technique - WITH RECURSIVE - is also supported by SQLite. I ported the example in this tutorial to SQLite here - now you can play with it in Datasett
by simonw 4y ago
This same technique - WITH RECURSIVE - is also supported by SQLite.
I ported the example in this tutorial to SQLite here - now you can play with it in Datasette Lite: https://lite.datasette.io/?sql=https%3A%2F%2Fgist.githubusercontent.com%2Fsimonw%2Faac714be7cbe738064f089a9668eb00d%2Fraw#/data?sql=WITH+RECURSIVE+friend_of_friend+AS+%28%0A++SELECT+edges.next_node%0A++FROM+edges%0A++WHERE+edges.previous_node+%3D+1%0A++UNION%0A++SELECT+edges.next_node%0A++FROM+edges%0A++JOIN+friend_of_friend+ON+edges.previous_node+%3D+friend_of_friend.next_node%0A%29%0ASELECT+nodes.data%0AFROM+nodes%0AJOIN+friend_of_friend+ON+nodes.id+%3D+friend_of_friend.next_node%3B https://lite.datasette.io/?sql=https%3A%2F%2Fgist.githubuser...
Amusingly I ported the sample PostgreSQL code using the new ChatGPT "Browsing" alpha, with the following prompt:
> Read this tutorial and then output equivalent create table and insert statements for SQLite https://www.dylanpaulus.com/posts/postgres-is-a-graph-database/ https://www.dylanpaulus.com/posts/postgres-is-a-graph-databa...
- punnerud 4y agoIf we have links to other Sqlite3 databases in the SQLite itself, we could make an static webpage distributed graph database: https://news.ycombinator.com/item?id=27016630 https://news.ycombinator.com/item?id=27016630 With the static database trick, combined with recursive graphs