Replies: 2 comments 4 replies
-
Simple select queries that are entirely static (= don't fetch data from the database) are resolved directly inside SQLPage, and not sent to your database, so you don't have to worry about reducing their number.
This feedback is very welcome. Could you give some insights about what you were trying to do, what you read in the docs, and what you would have expected instead? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Here is the trick : -- Store all column in a json
SET _user = (SELECT to_json(users.*) from users where username = $username);
-- access each column in the json
SELECT
'text' as component,
($_user)::json -> 'username' as contents;
SELECT
'text' as component,
($_user)::json -> 'first_name' as contents;
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I try to do something like this : https://github.com/lovasoa/SQLpage/blob/main/examples/master-detail-forms/edit_user.sql
But I want to avoid sending a query for each parameter.
I wonder if we can run one query to fetch all parameters, then use them in the form later ?
As a side note, it is not easy to understand how to pass parameters between pages or components :)
Beta Was this translation helpful? Give feedback.
All reactions