Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

How to update database cursor as a global variable?

$
0
0

@arrcap wrote:

I have a database connection set up with psycopg2 which is used in a couple different app pages. I can import the cursor and do SQL queries without problems, but sometimes the connection cuts off, so I need a button to create a new connection. However, to my understanding, callback functions can’t change the global variable value across other pages.

What is the best solution to this? With dataframes I can simply convert it to a json as a hidden div, but I can’t do the same with SQL cursors.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images