dbcodeio / public

The Power of Databases, The Convenience of VS Code: All in One Place
29 stars 1 forks source link

jupyter: the context is not related #116

Closed wosledon closed 1 week ago

wosledon commented 1 week ago

the variables of the previous code block are not available in the next code block.

Image

mikeburgh commented 1 week ago

I have been thinking about this.. I don't think there is a way to accurate get the variables from one cell to the other.

The reason is the variables are executed on the remote SQL server, not in a repl/local process like in say a python notebook.. and there is no way I know of to get the context from that remote SQL environment.. so while set @id = 1 could in theory be inferred… something like set @version == @@version or set @date = current_timestamp would be impossible.

So for now the cells will remain independent from each other.

wosledon commented 6 days ago

I don't know how modifiable jupyter is, but how about designing a variables cell?

mikeburgh commented 6 days ago

Only two kinds of cells.. the editor cell, and the output cell (which can be anything, but wont have the run commands, and other things the editor ones do).

Are you trying to setup some variables and then use them in a query, so you don't have to change the query and can just change the variables ? I have a solution for this with placeholders in the query I am working on. So when the execution identifies there are place holder strings, it prompts for the values to be entered..

wosledon commented 5 days ago

Only two kinds of cells.. the editor cell, and the output cell (which can be anything, but wont have the run commands, and other things the editor ones do).

Are you trying to setup some variables and then use them in a query, so you don't have to change the query and can just change the variables ? I have a solution for this with placeholders in the query I am working on. So when the execution identifies there are place holder strings, it prompts for the values to be entered..

Okey...