Database Query — Reference
Return a collection of selected database records.
Return a collection of selected database records.
Before you begin
Section titled “Before you begin”- A working database connection and a disposable test table or records. Validate inputs and enforce access before private reads or writes.
Database Query
Section titled “Database Query”Return a collection of selected database records.
Settings
Section titled “Settings”| Setting | Meaning |
|---|---|
| Name | The step name used by later server expressions and named action output. For example, a query named products is available to subsequent steps as products. |
| Output | Includes the named result in the action response. The result can be used by later server steps when Output is off. Several rules initialize Output on although their declared default is false; inspect the saved action. |
| Debug | Changes diagnostic behavior where supported. For regular SQL Query/Single Query it returns query details instead of the normal records. It can expose SQL and bound data. The installed Node.js Custom Query path still executes the query when this flag is set; do not treat it as a general dry-run guarantee. |
| Connection | The database connection definition to use. It must be available and correctly configured for the active target. |
| Query Type | Selects ordinary, single-record or paged-query behavior. Changing it changes the result shape and the controls relevant to the query. |
| Sort | The requested sort field or alias. The default binding uses $_GET.sort. The runtime matches it against selected columns; choose an allowed field and use an explicit default order in the builder. |
| Direction | The requested sort direction, normally asc or desc. The default binding uses $_GET.dir. Supply a controlled value rather than assuming arbitrary input is meaningful. |
| Query Builder | Choose the source table, output columns, aliases, conditions, joins and ordering for the generated query. The selected names become the response fields. |
Worked example
Section titled “Worked example”Build a query selecting id, name and price from a disposable products table. Name the step products and enable Output. Test zero, one and several matching rows; bind a page repeat to the returned products array rather than treating it as a single record.
Result and safety boundaries
Section titled “Result and safety boundaries”A normal query returns an array. Selected fields and aliases determine the output shape. Conditions, joins and ordering are defined in the Query Builder; a client-side filter is not a substitute for server-side access or ownership conditions.
Use the database workflow
Section titled “Use the database workflow”Use Database Manager to define and inspect the underlying tables. Use Server Connect to control the data returned to the page, and verify the actual response shape before choosing an App Connect binding.
Check your result
Section titled “Check your result”You can configure the intended query/write scope and verify its result shape or database effect.