faucet_query
Query records from a database table with optional filtering, field selection, ordering, and pagination; returns JSON results.
Instructions
Query records from a database table with optional filtering, field selection, ordering, and pagination. Returns results as JSON. Requires GET permission on the table.
Filter syntax (DreamFactory-compatible):
Simple: name = 'John'
Comparison: age > 21, price <= 100
Logical: status = 'active' AND role = 'admin'
IN: status IN ('active', 'pending')
LIKE: name LIKE 'J%'
NULL: email IS NOT NULL
BETWEEN: age BETWEEN 18 AND 65
CONTAINS: name CONTAINS 'smith'
Order syntax: 'column ASC, other_column DESC'
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group | No | Comma-separated columns to GROUP BY (e.g. "region,status"). Aggregate in 'fields' to compute per group; order by an aggregate's alias. | |
| limit | No | Maximum number of records to return (default 25, max 1000) | |
| order | No | Order clause (e.g. "created_at DESC, name ASC") | |
| table | Yes | Name of the table to query | |
| fields | No | List of columns to return, each either a plain column or an aggregate such as "SUM(amount)", "COUNT(*)", or "AVG(price) AS avg_price". Omit for all columns. | |
| filter | No | Filter expression (e.g. "status = 'active' AND age > 21") | |
| offset | No | Number of records to skip for pagination | |
| service | Yes | Name of the database service |