Replies: 2 comments 4 replies
-
From the look of your code, you're trying to create a database pool at build time and put that into the global state. The problem is that any global or page state in Perseus must implement Of course, you can't turn a database pool into a string, so you can't put it into the state. If you can, I'd advise getting what you need from the database at build time and then putting that into the state. If you need the database pool in the browser (which I don't think you do), you should have a separate server that accesses it on the browser's behalf, otherwise you'd be exposing the secret keys used to access the DB. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I also thought of that, and that's what I'm working on now. in that case, How can I ensure secure communication between perseus app and the auxiliary server? I'm considering using JWT what d you suggest? |
Beta Was this translation helpful? Give feedback.
-
Hi, I have series of errors while trying to implement a few states from the
get_built_state
function trying to get the global state.I am trying to use
deadpool_postgres
alongside with if possible tokio or actix. but facing a series of challenges. among others are the error I posted above.Here is the entire error
Can you please assist?
Here is the repo:
Beta Was this translation helpful? Give feedback.
All reactions