Database Paged Query — Reference
Return one page of records together with pagination metadata.
Return one page of records together with pagination metadata.
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 Paged Query
Section titled “Database Paged Query”Return one page of records together with pagination metadata.
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. |
| 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. |
| Offset | The number of records to skip. The default expression uses $_GET.offset. Use a validated non-negative integer; 0 starts from the first record. |
| Limit | The maximum records for this page. The default expression uses $_GET.limit; the installed Node.js fallback is 25 when no suitable value is supplied. Enforce a positive upper bound for user-controlled limits. |
| 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 Options | Opens the query configuration for the paged result. Choose columns and conditions before testing its pagination behavior. |
Worked example
Section titled “Worked example”Use Offset 0 and Limit 10 against a test set with more than ten products. Inspect data, total, offset, limit and page metadata. Request Offset 10 for the next page. On the page, repeat the result’s data array, not the pagination wrapper.
Result and safety boundaries
Section titled “Result and safety boundaries”Offset counts records to skip, not a one-based page number. Validate and bound input Limit and Offset. Use a deterministic order, preferably including a unique key, to reduce duplicated or missing rows between requests. Empty-result page offsets can include edge-case values; do not navigate to an unvalidated negative last-page offset.
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.