Replies: 1 comment
-
|
The temporary tables you create in Temporary tables are the wrong thing to use if you want to persist data across requests. Use a normal table or url parameters to pass state for anything that has to be persisted. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I had my application dashboard all in one SQL file. It started by creating two temporary tables (sqlite3) and then various queries to build components. Recently, I refactored it to have multiple files accessed by dynamic component with sqlpage_runsql(). One of the components is a card with two embedded charts - each pointing to its own SQL file using sqlpage.link(). Only for these, often I get error stating temporary table is not created. When I refresh, often times it comes up.
Entry point creates a dynamic component running this sql. That includes two embeds which are single sql queries each.
I am guessing sqlpage.link() actually creates a new session and that is why temporary tables are not there. On reload, often I get data for previous query.
My goal is two simply have two charts side by side. If I can do that with some component using sqlpage.runsql(), then that is great. Otherwise, I will've to write a custom component - wanted to see if any simpler fixes are available.
Beta Was this translation helpful? Give feedback.
All reactions