Skip to content

page_sql ​

One sys.page_sql record is three SQL texts, executed in order inside one transaction:

  1. pre_sql
  2. main_sql
  3. post_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 ​

FormReplaced 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 ​

ParameterMeaning
_user_idThe server writes the current user. The same name in the request body does not override it
_return_objReturn the first row as an object
_return_valReturn the first field of the first row
_optional_NWhether 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.

This describes the platform. One customer’s business tables are not in these docs.