MyNixOS website logo
Description

Utilities for 'DIZ' R Package Development.

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.

DIZutils

CRAN Status Badge Cran Checks Dependencies R CMD Check via {tic} linting test-coverage codecov

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

You can install DIZutils directly from CRAN:

install.packages("DIZutils")

The development version can be installed using

install.packages("remotes")
remotes::install_github("miracum/misc-dizutils", ref = "development")

Basic functions

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:

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:

VariableDescription
I2B2_HOSTThe hostname/ IP address of your pg instance.
I2B2_DBNAMEThe name of the pg-database.
I2B2_PORTThe port, your pg postgres instance is running on.
I2B2_USERThe name of the 'I2B2_USER'.
I2B2_PASSWORDThe password of the 'I2B2_USER' of your pg instance.
I2B2_SCHEMA(optional) The database schema on which queries should be performed.

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.

db_con <- DIZutils::db_connection(
    system_name = "i2b2",
    db_type = "postgres"
  )

oracle

The following environment variables need to be set to the active environment in order to connect with an oracle database:

VariableDescription
MYORACLEDB_HOSTThe hostname/ IP address of your oracle instance.
MYORACLEDB_DBNAMEThe name of the oracle-database.
MYORACLEDB_DRIVERThe path to the oracle jdbc driver.
MYORACLEDB_SIDThe SID of the oracle-database.
MYORACLEDB_PORTThe port, your oracle postgres instance is running on.
MYORACLEDB_USERThe name of the 'MYORACLEDB_USER'.
MYORACLEDB_PASSWORDThe password of the 'MYORACLEDB_USER' of your oracle 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. Furthermore, an ojdbc*.jar-file needs to be provided via the function's lib_path argument.

db_con <- DIZutils::db_connection(
  system_name = "myoracledb",
  db_type = "oracle",
  lib_path = "path/to/ojdbc*.jar"
)

For further details on how to set the specific environment variables using a configuration file, please refer to the documentation in the DIZtools R package.

More Infos

Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows