Commit 53e1c0e1 authored by Jonathan Mang's avatar Jonathan Mang 💡
Browse files

docs: fixed md style

parent d76f6734
Pipeline #22440 passed with stages
in 30 minutes and 7 seconds
......@@ -13,7 +13,7 @@
The R package `DIZutils` provides utility functions used for the R package development infrastructure inside the data integration centers ('DIZ'), to standardize and facilitate repetitive tasks such as setting up a database connection or issuing notification messages and to avoid redundancy.
# Installation
## Installation
You can install `DIZutils` directly from CRAN:
......@@ -28,19 +28,20 @@ install.packages("devtools")
devtools::install_github("miracum/misc-dizutils", ref = "development")
```
# Basic functions
## Basic functions
## db_connection
### db_connection
The function `DIZutils::db_connection` provides one simple interface for connecting to various types of databases. It reads necessary connection settings from the active environment (see below how to use the function `set_env_vars` to set environment variables).
The following database types are currently supported:
The following database types are currently supported:
* postgres (via the R package [`RPostgres`](https://CRAN.R-project.org/package=RPostgres))
* oracle (via the R packages [`RJDBC`](https://CRAN.R-project.org/package=RJDBC) and [`DBI`](https://CRAN.R-project.org/package=DBI/))
### postgres
#### postgres
The following environment variables need to be set to the active environment in order to connect with a postgres database with "i2b2" as name of the database to connect with:
The following environment variables need to be set to the active environment in order to connect with a postgres database with "i2b2" as name of the database to connect with:
| Variable | Description |
| ----------------- | ------------------------------------------------------------------------- |
......@@ -50,7 +51,7 @@ The following environment variables need to be set to the active environment in
| I2B2_USER | The name of the 'I2B2_USER'. |
| I2B2_PASSWORD | The password of the 'I2B2_USER' of your pg instance. |
To establish the connection, please set those environment variables accordingly and execute the following command. The argument `db_name` is used to detect the corresponding environment variables and thus must match with the environment variables' prefix.
To establish the connection, please set those environment variables accordingly and execute the following command. The argument `db_name` is used to detect the corresponding environment variables and thus must match with the environment variables' prefix.
```r
db_con <- DIZutils::db_connection(
......@@ -59,7 +60,7 @@ db_con <- DIZutils::db_connection(
)
```
### oracle
#### oracle
The following environment variables need to be set to the active environment in order to connect with an oracle database:
......@@ -83,7 +84,7 @@ db_con <- DIZutils::db_connection(
)
```
## set_env_vars
### set_env_vars
In order to set up a database connection using the function `DIZutils::db_connection`, one needs to provide the required connection settings via environment variables. To facilitate the process of making such environment variables available within the current R session, the function `DIZutils::set_env_vars` works as a wrapper function around the base R method `Sys.setenv`. It takes the file name of a text file with the definitions of the environment variables as input, and sets those environment variables within the current R session.
......@@ -95,7 +96,7 @@ The design of the `envfile` is based on the [`.env` file for defining environmen
To create an `envfile` for connecting with an i2b2 database, the following exemplary definitions of environment variables should be written to a simple textfile, e.g. named `envfile`, which can then be passed as argument to `DIZutils::set_env_vars`.
```
```bash
I2B2_HOST=123.45.56.8
I2B2_PORT=5432
I2B2_DBNAME=i2b2
......@@ -103,8 +104,7 @@ I2B2_USER=user
I2B2_PASSWORD=password
```
## More Infos
# More Infos
- about MIRACUM: [https://www.miracum.org/](https://www.miracum.org/)
- about the Medical Informatics Initiative: [https://www.medizininformatik-initiative.de/index.php/de](https://www.medizininformatik-initiative.de/index.php/de)
* about MIRACUM: <https://www.miracum.org/>
* about the Medical Informatics Initiative: <https://www.medizininformatik-initiative.de/index.php/de>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment