Giter Site home page Giter Site logo

databaseconnector's Introduction

DatabaseConnector

CRAN_Status_Badge CRAN_Status_Badge

Introduction

This R package provides function for connecting to various DBMSs.

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(with Kerberos support)
    • Google BigQuery
    • IBM Netezza
    • Hive(with Kerberos support)
  • Statements for executing queries with
    • Error reporting to file
    • Progress reporting
    • Multiple statements per query
  • Support for fetching data to ffdf objects
  • Insert data frame to a database table
  • Supports the DBI interface
  • Integrates with RStudio's Connections tab

Examples

connectionDetails <- createConnectionDetails(dbms="mysql", 
                                             server="localhost",
                                             user="root",
                                             password="blah",
                                             schema="cdm_v4")
conn <- connect(connectionDetails)
querySql(conn,"SELECT COUNT(*) FROM person")
disconnect(conn)
## regular data insert
insertTable(connection = connection, 
            tableName = "scratch.somedata", 
            data = data, 
            dropTableIfExists = TRUE, 
            createTable = TRUE, 
            tempTable = FALSE, 
            useMppBulkLoad = FALSE)
            
## bulk data insert with Redshift or PDW
insertTable(connection = connection, 
            tableName = "scratch.somedata", 
            data = data, 
            dropTableIfExists = TRUE, 
            createTable = TRUE, 
            tempTable = FALSE, 
            useMppBulkLoad = TRUE)

Technology

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

System Requirements

Requires R. Also requires Java 1.6 or higher (Oracle Java is recommended. Issues have been reported when using GCJ.)

Dependencies

Please note that this package requires Java to be installed. If you don't have Java already intalled on your computed (on most computers it already is installed), go to java.com to get the latest version.

To be able to use Windows authentication for SQL Server, you have to install the JDBC driver. Download the .exe from Microsoft and run it, thereby extracting its contents to a folder. In the extracted folder you will find the file sqljdbc_4.0/enu/auth/x64/sqljdbc_auth.dll (64-bits) or sqljdbc_4.0/enu/auth/x86/sqljdbc_auth.dll (32-bits), which needs to be moved to location on the system path, for example to c:/windows/system32.

DatabaseConnector also depends on the OHDSI DatabaseConnectorJars and SqlRender packages.

For Redshift Bulk Mpp inserts, the cloudyR aws S3 pacakge is required.

Getting Started

To install the latest development version, install from GitHub:

install.packages("devtools")

install.packages("https://github.com/InfoClinika/DatabaseConnectorJars/releases/download/v1.1.0/DatabaseConnectorJars_1.1.0-source.tar.gz", repo=NULL, type="source")
devtools::install_github("Infoclinika/DatabaseConnector")

Or you can download latest release from DatabaseConnectorJars repository and install it from local file

install.packages("devtools")
 
install.packages("/path/to/file/DatabaseConnectorJars_1.1.0-source.tar.gz", repo=NULL, type="source")
devtools::install_github("Infoclinika/DatabaseConnector")

Getting Involved

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

Build Status codecov.io

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.

databaseconnector's People

Contributors

anthonysena avatar cgreich avatar ericavoss avatar fdefalco avatar lastomato avatar msuchard avatar myounglai avatar schuemie avatar tomwhite avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.