https://github.com/leometzger/timescale-cli
TimescaleDB CLI - used to help to operate timescale
https://github.com/leometzger/timescale-cli
cli postgresql timescaledb tool
Last synced: 6 months ago
JSON representation
TimescaleDB CLI - used to help to operate timescale
- Host: GitHub
- URL: https://github.com/leometzger/timescale-cli
- Owner: leometzger
- License: apache-2.0
- Created: 2024-03-11T17:52:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-16T13:08:52.000Z (over 1 year ago)
- Last Synced: 2025-02-09T12:45:45.344Z (8 months ago)
- Topics: cli, postgresql, timescaledb, tool
- Language: Go
- Homepage:
- Size: 158 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
# TimescaleDB CLI
TimescaleDB CLI is a command-line tool designed to simplify some operations within TimescaleDB instances.
This unofficial tool is built to make the developers life easier. It does that by providing a terminal-based
interface for common operations and automation tasks.## Usage
It is pretty simple to use it.
### Configuring
Add the configuration to the config file pointing to your DB instances
```sh
timescale config add staging --host db.timescale.staging --database tsdb --port 5433 --password pass --user postgres
```List configurated environments
```sh
timescale config ls
```Check if the configuration is valid and connect the database
```sh
timescale config check
```Remove configured environment
```sh
timescale config rm staging
```### Aggregation
List aggregations from specified timescale instance
```sh
timescale aggregation lstimescale aggregation ls --hypertable metrics
timescale aggregation ls --view-name %hourly
timescale aggregation ls --hypertable metrics --view-name %hourly
```Refreshes hypertables from start to end using filters for view or hypertable.
```sh
timescale aggregation refresh --env staging --start 2023-01-01 --end 2023-02-01# Refreshes all continuous aggregations from hypertable metrics from 2023-01-01 to 2023-02-01
timescale aggregation refresh --start 2023-01-01 --end 2023-02-01 --hypertable metrics# Refreshes all continuous aggregations ending with hourly from 2023-01-01 to 2023-02-01
timescale aggregation refresh --start 2023-01-01 --end 2023-02-01 --view-name %hourly# Refreshes all continuous aggregations ending with hourly from 2023-01-01 to 2023-02-01
# incrementing 7 days each call
timescale aggregation refresh --start 2023-01-01 --end 2023-02-01 --view-name %hourly --pace 7
```### Hypertable
List the hypertables, giving the main information about it.
```sh
timescale hypertable lstimescale hypertable ls --name %hourly
```Compress chunks manually from a start to end. (TODO)
```sh
timescale hypertable compress --from 2023-01-01 --to 2024-01-01timescale hypertable compress --name %_metrics --from 2023-01-01 --to 2024-01-01
```Give detailed information about the hypertable, like how many chunks it has. (TODO)
```sh
timescale hypertable inspect metrics
```