Skip to content

OHDSI/DatabaseConnector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ff12112 · Jan 16, 2025
Jan 8, 2025
Nov 28, 2023
Jan 15, 2025
Jan 15, 2025
Jan 15, 2025
Jan 15, 2025
Jun 17, 2024
Jan 9, 2025
Jan 15, 2025
Jan 14, 2025
Apr 11, 2024
Jan 30, 2023
Oct 20, 2020
Jun 1, 2015
Sep 30, 2020
Jul 4, 2017
Jan 16, 2025
Jan 15, 2025
Dec 4, 2020
Jan 9, 2025
Jan 14, 2025
Aug 23, 2024
Feb 7, 2022
Feb 10, 2021
Jan 16, 2025
Feb 10, 2021

Repository files navigation

DatabaseConnector

Build Status codecov.io CRAN_Status_Badge CRAN_Status_Badge

DatabaseConnector is part of HADES.

Introduction

This R package provides function for connecting to various DBMSs. Together with the SqlRender package, the main goal of DatabaseConnector is to provide a uniform interface across database platforms: the same code should run and produce equivalent results, regardless of the database back end.

Features

  • Create connections to the various database platforms:
    • MicrosoftSQL Server
    • Oracle
    • PostgresSql
    • Microsoft Parallel Data Warehouse (a.k.a. Analytics Platform System)
    • Amazon Redshift
    • Apache Impala
    • Google BigQuery
    • IBM Netezza
    • SQLite
    • Spark
  • Statements for executing queries with
    • Error reporting to file
    • Progress reporting
    • Multiple statements per query
  • Support for fetching data to Andromeda objects
  • Insert data frame to a database table
  • Supports the DBI interface, with SQL statements automatically translated to the appropriate dialect.
  • Supports the dbplyr interface.
  • Integrates with RStudio's Connections tab

Examples

connectionDetails <- createConnectionDetails(dbms="postgresql", 
                                             server="localhost",
                                             user="root",
                                             password="blah")
conn <- connect(connectionDetails)
querySql(conn,"SELECT COUNT(*) FROM person")
disconnect(conn)

Technology

DatabaseConnector is an R package using Java's JDBC drivers and other DBI drivers.

System Requirements

Running the package requires R with the package rJava installed. Also requires Java 1.8 or higher.

Installation

  1. See the instructions here for configuring your R environment, including Java.

  2. To install the latest stable version, install from CRAN:

install.packages("DatabaseConnector")
  1. Download the database drivers as described here.

  2. (Optionally) To use Windows Authentication for SQL Server, download the authentication DDL file as described here.

User Documentation

Documentation can be found on the package website.

PDF versions of the documentation are also available:

Support

Contributing

Read here how you can contribute to this package.

License

DatabaseConnector is licensed under Apache License 2.0. The JDBC drivers fall under their own respective licenses.

Development

DatabaseConnector is being developed in R Studio.

Development status

Stable. The code is actively being used in several projects.

Acknowledgements

  • This project is supported in part through the National Science Foundation grant IIS 1251151.