lovasoa / SQLpage

SQL-only webapp builder, empowering data analysts to build websites and applications quickly
https://sql.ophir.dev
MIT License
883 stars 64 forks source link

Probe component #251

Closed olivierauverlot closed 4 months ago

olivierauverlot commented 4 months ago

A debug component that displays a value (constant, variable, parameter value, result of an SQL function, e.g.). Usefull to validate data flow or function behaviour. Each value (except NULL value) is surrounded by double quotes and followed by datatype (number, string, boolean, e.g.).

lovasoa commented 4 months ago

Is there something that you don't like in the existing debug component?

olivierauverlot commented 4 months ago

Not really the same finality. The debug component is practical to display and control parameters passed to a component. The Probe component is more generic and her work is just to display a value with additional informations (name, datatype, string content, NULL value, etc.). It could be used to print a HTTP parameter from request, the content of a variable, the value of an environment variable, the result of a fonction, etc.

lovasoa commented 4 months ago

I'm not sure I see the difference with just

select 'debug' as component, my_value

where my_value can be an HTTP parameter from request, the contents of a variable, the value of an environment variable, the result of a function, etc.

This dumps the value as json, so you can also see its type (including whether it is null).

Maybe the main issue is in the documentation of the debug component that isn't clear enough and doesn't give enough examples?

olivierauverlot commented 4 months ago

Yes, it may be necessary to modify the documentation for the debug component. The first sentence is too restrictive: "Display all the parameters passed to the component".