snews_cs.snews_sql¶
Attributes¶
Classes¶
Class for interacting with the SNEWS SQL database. |
Module Contents¶
- class snews_cs.snews_sql.Storage(env=None, drop_db=True)[source]¶
Class for interacting with the SNEWS SQL database.
- Parameters:
env (str, optional) – Path to env file, defaults to ‘./etc/test-config.env’
drop_db (bool, optional) – drops all items in the DB every time Storage is initialized, defaults to False
- insert_mgs(mgs, tier)[source]¶
Inserts a message into the all_mgs table.
- Parameters:
mgs (dict) – dictionary of the SNEWS message
- retract_message(message_id, tier)[source]¶
Retracts a message from the all_mgs table.
- Parameters:
message_id (str) – unique id for each message
- update_message(message, tier)[source]¶
Updates a message in the all_mgs table and corresponding tier tabe.