diff --git a/README.md b/README.md index aee955c..0b855bd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,23 @@ OpenDTU logger connects to the OpenDTU livedata websocket and captures metrics. These metrics are inserted into a PostgreSQL database. -Optionally, TimescaleDB can be used for better performance. +Optionally, TimescaleDB can be used. + +## PostgreSQL setup + +```sql +CREATE DATABASE opendtu_logger; +CREATE USER opendtu_logger WITH password 'SECRET'; +GRANT ALL privileges ON DATABASE opendtu_logger TO opendtu_logger; +GRANT ALL ON SCHEMA public TO opendtu_logger; +``` + +Optional: enable TimescaleDB extension + +```sql +\c opendtu_logger +CREATE EXTENSION OF NOT EXISTS timescaledb; +``` ## Environment variables