Replies: 4 comments 13 replies
-
Hi ! This would indeed be a very useful addition ! Would you be interested in implementing it ? The json component is defined here: |
Beta Was this translation helpful? Give feedback.
-
Hi @mtt-artis ! I implemented multiple improvements to the json component, including things you were suggesting above 😃 Would you be interested in beta-testing it before we release v0.30 ? Development builds are available on docker as |
Beta Was this translation helpful? Give feedback.
-
Hello @lovasoa |
Beta Was this translation helpful? Give feedback.
-
Love it ! Did some test on postgres with all the postgres type and it's working perfectly for select insert delete and update. Doing multiple query like the other components is a really cool trick. select 'json' as component;
select id, name from cats;
select id, name from dogs;
select id, name from pokemon; Having the db error in the json response is nice too. await fetch("/single.sql?id=no-one").then(r => r.json())
// {error: 'error returned from database: invalid input syntax for type integer: "no-one"'} Quetions:
await fetch("/single.sql?id=999").then(r => r.json())
// Uncaught SyntaxError: Unexpected end of JSON input Should SQLPage provide a solution or pattern for this case?
await fetch("/all.sql?id=no-one").then(r => r.json())
// [{ "error": "error returned from database: invalid input syntax for type integer: \"no-one\"" }] I'm really happy with the current implentation as it cover all my use cases (and more). Thank you ! |
Beta Was this translation helpful? Give feedback.
-
Hi 👋,
I like the json component but the forced use of
json(b)
functions add complexity not only because it requires extra knowledge but also because there are named differently across databases.I'd like to propose something like this:
and
PS: love the project
Beta Was this translation helpful? Give feedback.
All reactions