9 ms·
Cool hack, but probably wouldn't install a separate kernel or run an entire notebook just for sqlite work. What would be useful is for the kernel of your langu
by seemslegit 6y ago
Cool hack, but probably wouldn't install a separate kernel or run an entire notebook just for sqlite work.
What would be useful is for the kernel of your language of choice to provide a magic for sqlite and return results of queries in language-native data structures.
Something like this: https://pypi.org/project/ipython-sql/ https://pypi.org/project/ipython-sql/
- seemslegit 6y agoAlternatively: a new type of cell in jupyter itself alongside 'code' and 'markdown' for sql work available regardless of kernel choice.
- jedimastert 6y agoWhat's the distinction between "SQL" and "code"?
- seemslegit 6y ago'code' would be the code of whatever kernel is in use and 'sql' would a notebook-level feature like 'markdown' is today.
- 3l3ktr4 6y agoYeah, I had this idea at first, but it's not trivial to run more than one kernel at the same time. I know some examples of people who did it, and some projects that I could plug in and try to make it work with my kernel, but this was a first version to see how the community responds! Let's see, might do something like it in the future. I think it'd be really cool and powerful to make it interact with Python for example.
- cheez 6y agoYes this is a great first step. Would absolutely love a way to use this alongside my Python code.
- pletnes 6y agoThere’s already the %%bash cell magic, which does that for bash.
- santafen 6y agoI like this bit a lot. Might have to extend it for QuestDB. I did a Notebook for QuestDB earlier this week, but having this part would be great!
- thom 6y agoorg-babel in Emacs has some level of support for passing data between different languages in different cells etc. https://orgmode.org/worg/org-contrib/babel/intro.html#meta-programming-language https://orgmode.org/worg/org-contrib/babel/intro.html#meta-p...
- TallGuyShort 6y agoI wonder if this is closer to what you're suggesting, as it already allows sharing of simple data structures between cells of distinct languages: https://polynote.org/ https://polynote.org/. One cell: SQLite kernel to get data. Next cell: operates on that data.
- zmmmmm 6y agoBeakerX [1] provides a kernel that does that. [1] https://nbviewer.jupyter.org/github/twosigma/beakerx/blob/master/doc/sql/Sql.ipynb https://nbviewer.jupyter.org/github/twosigma/beakerx/blob/ma...