TimescaleDB
The robomotion timescaledb CLI connects to TimescaleDB for time-series database operations. It manages hypertables, runs time-bucket aggregation queries, handles data insertion with timestamps, configures compression policies, and manages continuous aggregates.
When to use
- Create hypertables and insert time-series data
- Run time-bucket queries for time-based aggregations
- Configure compression policies and continuous aggregates
- Execute standard SQL queries on TimescaleDB
Prerequisites
robomotionCLI installed- Package installed:
robomotion install timescaledb - TimescaleDB connection credentials configured via Robomotion vault
IMPORTANT: Session Mode Required for Multi-Step Operations
Each CLI command runs as a separate process — connection IDs from connect do NOT persist across calls.
You MUST use --session on connect and pass --session-id to all subsequent commands.
Workflow
- Install (once):
robomotion install timescaledb - Connect with session:
robomotion timescaledb timescaledb_connect --session --output json # → {"outConnectionId":"<conn-id>","session_id":"<session-id>"} - Use the returned
conn-idandsession-idin all subsequent commands:robomotion timescaledb timescaledb_execute_query --conn-id "<conn-id>" --session-id "<session-id>" --output json - Disconnect when done:
robomotion timescaledb timescaledb_disconnect --conn-id "<conn-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion timescaledb timescaledb_connect --session --output jsonConnects to a TimescaleDB server and returns a client ID for subsequent operationsrobomotion timescaledb timescaledb_disconnect --client-id --session-id "<session-id>" --output jsonCloses the TimescaleDB connection and releases resourcesrobomotion timescaledb timescaledb_execute_query --client-id --sql-query --query-params [--60] --session-id "<session-id>" --output jsonExecutes a raw SQL query against TimescaleDB and returns the resultsrobomotion timescaledb timescaledb_insert_data --client-id --table-name --columns --values [--60] --session-id "<session-id>" --output jsonInserts one or more rows of time-series data into a TimescaleDB hypertablerobomotion timescaledb timescaledb_query_data --client-id --table-name --select-columns --time-column --where-clause [--time-bucket] [--order-by] [--1000] [--60] --session-id "<session-id>" --output jsonQueries time-series data from a hypertable with optional time_bucket aggregationrobomotion timescaledb timescaledb_create_hypertable --client-id --table-name --time-column [--chunk-time-interval] [--60] --session-id "<session-id>" --output jsonConverts an existing PostgreSQL table into a TimescaleDB hypertable for time-series datarobomotion timescaledb timescaledb_drop_chunks --client-id --table-name --older-than [--120] --session-id "<session-id>" --output jsonDrops old data chunks from a hypertable based on a time threshold for data retentionrobomotion timescaledb timescaledb_enable_compression --client-id --table-name --segment-by --order-by [--compress-after] [--60] --session-id "<session-id>" --output jsonEnables compression on a hypertable and optionally adds a compression policyrobomotion timescaledb timescaledb_create_continuous_aggregate --client-id --view-name --aggregate-query [--refresh-interval] [--start-offset] [--end-offset] [--120] --session-id "<session-id>" --output jsonCreates a continuous aggregate (materialized view with automatic refresh) for a hypertablerobomotion timescaledb timescaledb_refresh_continuous_aggregate --client-id --view-name --start-time --end-time [--300] --session-id "<session-id>" --output jsonManually refreshes a continuous aggregate for a specified time window
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)