break stuff by adding new param

This commit is contained in:
Pablo Martin 2024-06-12 17:36:33 +02:00
parent 013f2cdadb
commit 78e3d71b05
4 changed files with 34 additions and 3 deletions

View file

@ -17,9 +17,22 @@
To use `xexe`, you will need to have credentials for the `xe.com` API. Specifically, you need an account id and it's matching api key.
To write into the DWH, you will also need to pass credentials to connect it to it.
To set up your environment, you should create a `.env` file and place it in `~/.xexe/.env`. You will have to run `xexe` as the right user to ensure the `.env` file is found. You can use the `.env-example` file as a reference. We also recommend running `chmod 400` or `chmod 600` on it for safety.
Once you have done this, you can run `xexe xe-healthcheck`. If the connection to the API was successful, you will see some output telling you so.
Once you have done this, you can run:
- `xexe xe-healthcheck` to validate the connection to the xe.com API. If the connection to the API was successful, you will see some output telling you so.
- `xexe dwh-healthcheck` to validate that the DWH is reachable. Again, you will see some happy output if things work.
### DWH pre-requisites
To be able to write rates into the DWH, take these points into consideration:
- `xexe` expects to find the following: a database called `dwh`, schema called `sync_xedotcom_currencies`. These should already exist before `xexe` runs.
- `xexe` should run with a user that has permission to write into `dwh/sync_xedotcom_currencies` and to create tables. It will create the right tables if it can't find them.
- These details are hardcoded in the `constants` module. You might want to refactor them into run-time configuration options if you find yourself having to change them often.
### Using
@ -31,6 +44,12 @@ You can use `xexe` to get rates and store them locally like this:
xexe get-rates --start-date "2024-01-01" --end-date "2024-01-10" --output my_rates.csv
```
If you want to point writing to the DWH instead of a local file.
```bash
xexe get-rates --output dwh
```
You can also run without specifying dates. Not specifying `end-date` will get rates up to today. Not specifying `start-date` will get dates up to last week.
```bash