drain_record
Drain all pending values from a record since the previous call and return them chronologically. This destructive read supports batch analysis; drained values are not returned again.
Instructions
Drain all pending values from a record since the last drain call. Returns values in chronological order. This is a destructive read — drained values won't be returned again. Use this for batch analysis of accumulated data (e.g., time-series analysis, trend detection). The first drain call creates a reader and returns empty (cold start). Subsequent calls return all values accumulated since the previous drain.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of values to drain. Optional, defaults to all pending. | |
| endpoint | No | Endpoint URL (unix://PATH, serial://DEVICE?baud=N) or a bare path. Falls back to AIMDB_CONNECT env var if omitted. | |
| record_name | Yes | Name of the record to drain (e.g., temp.berlin) |