Defining a query
Rules of thumb
- One query per screen or step. A page that shows an order, its lines and its review is one dynamic query with three result sets: one round trip, one place to change.
- Aggregate in SQL. Dashboards are best served by queries that return counts and sums, not rows to count in code.
- Add
ORDER BYto anything you paginate, so pages are stable. - Select the columns you need. Sensitive columns that a caller does not need should not leave the database.
Saving queries
- Console
- API
Open the datasource. In its dynamic queries section, use Create Dynamic Query, or upload several YAML files at once. Each query has a Download action that exports its YAML, which is handy for keeping queries in git.
Running a query
Response
status and error; check them, because one query of several can fail while the others succeed.
Pagination is added for you:
LIMIT … OFFSET … is appended to each query, or, if the query already ends with its own top-level LIMIT, it is wrapped as a subquery and paginated outside.
In a workflow, the
datasource_execute_query node defaults to 10 rows per result set and bypasses the cache. Prefill limit when you need more rows.Exporting to CSV
POST /floware/v1/<datasource-id>/dynamic-queries/<id>/export runs a query with the same options and returns CSV. Exports are limited to one every 5 seconds per user.

