From 91aebb20898f794a42e82cf55629a5c157565cc8 Mon Sep 17 00:00:00 2001 From: lovasoa Date: Fri, 7 Jul 2023 18:29:34 +0200 Subject: [PATCH] document the debug component --- examples/official-site/documentation.sql | 1 + .../official-site/sqlpage/migrations/06_debug.sql | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 examples/official-site/sqlpage/migrations/06_debug.sql diff --git a/examples/official-site/documentation.sql b/examples/official-site/documentation.sql index 93db6af1..928567c6 100644 --- a/examples/official-site/documentation.sql +++ b/examples/official-site/documentation.sql @@ -30,6 +30,7 @@ SELECT my_column_1 AS row_level_parameter_1, my_column_2 AS row_level_parameter_ This page documents all the components provided by default in SQLPage and their parameters. Use this as a reference when building your SQL application. +If at any point you need help, you can ask for it on the [SQLPage forum](https://github.com/lovasoa/SQLpage/discussions). If you have some frontend development experience, you can also create your own components, by placing [`.handlebars`](https://handlebarsjs.com/guide/) files in a folder called `sqlpage/templates` at the root of your server. diff --git a/examples/official-site/sqlpage/migrations/06_debug.sql b/examples/official-site/sqlpage/migrations/06_debug.sql new file mode 100644 index 00000000..ffaaf075 --- /dev/null +++ b/examples/official-site/sqlpage/migrations/06_debug.sql @@ -0,0 +1,14 @@ +-- Insert the http_header component into the component table +INSERT INTO component (name, description, icon) +VALUES ( + 'debug', + 'Display all of the row-level parameters passed to the component. Useful for debugging: just replace the name of the component you want to debug with ''debug''.', + 'bug' + ); +-- Insert an example usage of the http_header component into the example table +INSERT INTO example (component, description, properties) +VALUES ( + 'debug', + 'At any time, if you are confused about what data you are passing to a component, just replace the component name with ''debug'' to see all the parameters that are passed to it.', + JSON('[{"component": "debug"}, {"x": "y", "z": 42}, {"a": "b", "c": null}]') + ); \ No newline at end of file