pool delete-* check
Hi Uwe,
I played around with pool delete:
deletion via primary key does not work. Is that intended?
foerstch@eaw-sdwh3:~$ pool delete-facts signals "signal_id<= 14701994"
> this is datapool version 2.0.0
> delete-facts
- field signal_id does not exist, please chose one of parameter, project, site, source, source_type, timestamp, x, y, z
Was macht denn die binary_data_id in der Uebersicht?
pool delete-facts meta_data_history "source==bt_dl917_162_luppmenweg"
> this is datapool version 2.0.0
> delete-facts
binary_data_id timestamp_start timestamp_end site source meta_log_type meta_action_type meta_flag person
-------------- ------------------- ------------------- -------------- ----------------------- ------------------ ------------------ ---------------------------- ------
7032 2020-10-21 12:00:00 2020-10-21 12:10:00 162_luppmenweg bt_dl917_162_luppmenweg source_maintenance peripheral_checkup low_operator_confidence_flag SD
5857 2019-11-06 12:30:00 2019-11-06 12:40:00 162_luppmenweg bt_dl917_162_luppmenweg source_maintenance sensor_config low_operator_confidence_flag SD
- this operation would delete 3 facts
- use '--force --force' to delete facts.
I think it would be nice to have an example for the pool delete-entity, as it is provided for delete-facts.
foerstch@eaw-sdwh3:~$ pool delete-entity --help
Usage: pool delete-entity [OPTIONS] NAME
This command deletes a given entity (like site, source..) and the
corresponding facts.
Options:
--what TEXT
--force use this twice to perform deletion, else only checks are
performed and number of affected db entries is estimated
--max-rows INTEGER number of facts to print before deletion, default is 10
--help Show this message and exit.
foerstch@eaw-sdwh3:~$ pool delete-facts --help
Usage: pool delete-facts [OPTIONS] FACT_TABLE [FILTERS]...
This command deletes all facts where all filter conditions are true.
Example:
pool delete-facts signals "timestamp>=2000-01-01" "site==abc"
The surrounding quotes are required if symbols '<' or '>' occur in such
expressions or if the values contain spaces.
Options:
--force use this twice to perform deletion, else only checks are
performed and number of affected db entries is estimated
--max-rows INTEGER number of facts to print before deletion, default is 20
--help Show this message and exit.
Why is the --what option necessary for pool delete-entity. Wouldn't it work the same without what simply passing the name of the entity (like in pool delete-facts? I think this is how people would try to delete after having used the pool delete_facts.
foerstch@eaw-sdwh3:~$ pool delete-entity source
> this is datapool version 2.0.0
> delete-entity
+ entity named None is not known, valid names are meta_action_type, meta_data, meta_flag, meta_log_type, parameter, person, project, site, source, source_type
foerstch@eaw-sdwh3:~$ pool delete-entity source "name==bt_dl917_162_luppmenweg"
Usage: pool delete-entity [OPTIONS] NAME
Try 'pool delete-entity --help' for help.
Error: Got unexpected extra argument (name==bt_dl917_162_luppmenweg)
foerstch@eaw-sdwh3:~$ pool delete-entity --what source
Usage: pool delete-entity [OPTIONS] NAME
Try 'pool delete-entity --help' for help.
Error: Missing argument 'NAME'.
foerstch@eaw-sdwh3:~$ pool delete-entity source
> this is datapool version 2.0.0
> delete-entity
+ entity named None is not known, valid names are meta_action_type, meta_data, meta_flag, meta_log_type, parameter, person, project, site, source, source_type
foerstch@eaw-sdwh3:~$ pool delete-entity source bt_dl917_162_luppmenweg
Usage: pool delete-entity [OPTIONS] NAME
Try 'pool delete-entity --help' for help.
Error: Got unexpected extra argument (bt_dl917_162_luppmenweg)
Maybe we should chat about this before you change something substantial.