jupyter-xeus / xeus-sql

Jupyter kernel for SQL databases
https://xeus-sql.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
158 stars 21 forks source link

Support for bash, other magic? #51

Open hexylena opened 2 years ago

hexylena commented 2 years ago

Hey y'all, I started using xeus-sql and it's fantastic, I love the interface for querying data, it feels way more jupyter-native, it's great

I was planning to use it for teaching, and I wanted to build a nice SQLite notebook which had everything the students would need, but I'm struggling with some limitations of our platform which makes it difficult to distribute more than just the notebook file. Normally I'd just add a bash magic for ! wget https://../db.sqlite at the start to do setup, but it seems those aren't implemented yet.

Is such a thing on the roadmap? I think it'd be useful to show off some database specific commands to students when needed, or run 'backup' commands.

If not, no worries, just wanted to check if that was in the plan or if I should just switch to https://github.com/catherinedevlin/ipython-sql

marimeireles commented 2 years ago

Hey @hexylena, thank you for the kind words. Unfortunately xeus based kernels still don't have built-in magics (with the exception of xeus-python, that's actually ipython under the hood). These magics are native from ipython and all xeus-kernels that are not using it somehow don't have it by default. It's not on our roadmap to do something like this, something that substitutes all magics, but we would like to, if we ever get funded for it, I'd personally would love to work on it :) Regarding your issue... I think it's not so difficult to implement something like this, and if you or anyone is interested in giving a try please say it and then I can come up with some sort of step by step on how I would approach it. Thanks again and good luck with your classes!

hexylena commented 2 years ago

Hi @marimeireles! Thank you for the quick response. No worries that it's not on the roadmap, oh well. It's great to hear it might still be doable though! Maybe if I find time or someone to help I'll come back and ask again for your guidance :)

marimeireles commented 2 years ago

Hey @hexylena, no problem at all! :) Thank you for opening the issue, raised an interesting discussion on our internal channel to me.

Yeah, maybe there are other simpler solutions to this, if you still want to use xeus-sql. You could use the terminal that's in the notebook maybe?

image (in the inferior left side)

Anyways, I'm happy to help you or anyone that would be up for start tackling this. It's possible to only add this one command for examples, which would be of course way simpler than doing the whole thing.

marimeireles commented 1 year ago

How hard is it to implement support for terminal cmds @martinRenou ? You did it for xeus-python or did you get it for free smh? Thanks!