db_ts_delete: Remove Time Series from the Database

View source: R/delete_time_series.R

db_ts_deleteR Documentation

Remove Time Series from the Database

Description

This function completely removes a time series from the database, including all vintages and metadata.

Usage

db_ts_delete(con, ts_keys, schema = "timeseries", skip_checks = FALSE)

Arguments

con

RPostgres connection object.

ts_keys

character vector of time series identifiers.

schema

character name of the database schema. Defaults to 'timeseries'

skip_checks

boolean should checks be skipped? Use with caution and only in batch mode! Defaults to FALSE.

Details

Due to the potentially severe consequences of such a deletion only timeseries admins may perform this action and should do so very diligently.

See Also

Other time series functions: db_collection_read_ts(), db_dataset_read_ts(), db_ts_delete_latest_version(), db_ts_get_last_update(), db_ts_read_history(), db_ts_read(), db_ts_store(), db_ts_trim_history()

Examples


## Not run: 
# Store zrh_airport data
db_ts_store(con = connection, zrh_airport, schema = "schema")

# Deleting one key
db_ts_delete(
  con = connection,
  ts_keys = "ch.zrh_airport.departure.total",
  schema = "schema"
)

# Deleting multiple keys
db_ts_delete(
  con = connection,
  ts_keys = c(
    "ch.zrh_airport.departure.total",
    "ch.zrh_airport.arrival.total"
  ),
  schema = "schema"
)

## End(Not run)

timeseriesdb documentation built on March 24, 2022, 1:06 a.m.