Actions36
- Record Actions
- Table Actions
- Field Actions
- Index Actions
- Relationship Actions
- Query Actions
- System Actions
- Batch Actions
Query → Build Select Query
AI-generatedSummary
Builds a SurrealQL SELECT query string for a specified table with options to specify returned fields, filtering conditions, sorting order, grouping, pagination, and additional query configurations.
Inputs
- table (required) — The table name to select data from.
- fields — Comma-separated list of fields to select from the table, or * to select all fields; default is *.
- whereConditions — Multiple filter conditions specifying field, operator, value, and logical links to narrow query results.
- orderBy — List of fields and directions (ASC or DESC) to sort the results.
- groupBy — Comma-separated list of fields to group the results by.
- limit — Maximum number of records to return; defaults to 100.
- start — Number of records to skip from the start for pagination; defaults to 0.
- splitOn — Comma-separated list of fields on which to split the results into individual output items.
- parameters — JSON object specifying parameters to be used in the query conditions via $param_name placeholders.
- options — Additional options including overriding namespace and database, and whether to return the generated query string instead of executing it.
- connectionPooling — Settings to configure database connection pooling for performance optimization.
Output shape
A single record per input item
Output includes query results matching the constructed SELECT query. If 'Return Generated Query' option is true, the output contains the generated SurrealQL query string instead of executing the query. Supports splitting output on specified fields. Pagination is supported via 'limit' and 'start' inputs.
Examples
Example 1: Build a SELECT query to retrieve name and age fields from 'person' table where age is greater than 25, order by name ascending, limit 50 records
Set table='person', fields='name, age', add a where condition with field='age', operator='>', value='25', orderBy with field='name' and direction='ASC', limit=50.