page_sql
One sys.page_sql record is three SQL texts, executed in order inside one transaction:
pre_sqlmain_sqlpost_sql
The column name is main_sql. Soft delete uses del_flag. Each edit is kept in sys.page_sql_hist. call_count and fail_count are call statistics.
Page JSON refers to the record by sql_id. Parameters sit in the same object as sql_id. /sql/run substitutes them into the SQL text.
Template syntax
| Form | Replaced with |
|---|---|
${name} | The parameter as-is. Numbers are not quoted |
%{name} | A SQL string literal. Single quotes are escaped |
^{name} | Wrapped in single quotes. The content is not escaped |
@{name}[template row] | An array, or an array of objects, expanded with the template row |
!{SpEL} | Evaluated after pre_sql. The data is _pre_sql_result_list |
$[optional section] | Kept or dropped according to the parameter _optional_N |
Reserved parameters
| Parameter | Meaning |
|---|---|
_user_id | The server writes the current user. The same name in the request body does not override it |
_return_obj | Return the first row as an object |
_return_val | Return the first field of the first row |
_optional_N | Whether the Nth $[...] section is kept |
In INSERT and UPDATE, a simple placeholder with no matching parameter is removed. A hidden column that sends no value still leaves a statement that can run.
After the SQL text changes, a page that is already open has to be opened again before the session allowlist and the caller use the new text. See Create a page.