marimo-team / marimo

A reactive notebook for Python β€” run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
7.95k stars 278 forks source link

Inserting an SQL cell in the middle of a notebook #2876

Closed Light2Dark closed 1 hour ago

Light2Dark commented 6 days ago

Description

It's not possible to insert a SQL cell in the middle of a notebook. You would have to create one at the end and then drag it to wherever you want. It gets painful when notebooks are long.

Suggested solution

  1. Add a toggle to switch between markdown, python & sql. Image
  1. Add extra bubbles upon hovering the + bubble Image

I'm sure there are more designs possible. Need some brainstorming πŸ˜Άβ€πŸŒ«οΈ

Alternative

No response

Additional context

No response

mscolnick commented 6 days ago

@Light2Dark thanks for the suggestions

1) you can get a menu of cell types by right-clicking, but its not super discoverable. i would be open to always making it a menu like we have today 2) i will will explore adding another toggle to go to SQL from python

Light2Dark commented 6 days ago

Ahh, I see why I didn't discover num 1 earlier.

You can only View as SQL once you run an empty cell. If you don't run it, it will only show View as Markdown

mscolnick commented 6 days ago

@Light2Dark - i made some fixes on this PR https://github.com/marimo-team/marimo/pull/2878, if you'd like to try it out and let me know if you have any suggestions. Also open to more improvements if you have ideas.