Skip to content

An unofficial R package to interface with SAIL Databank

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

JackScanlon/SAILDB-R

Repository files navigation

SAIL Databank Logo



SAILDB

An unofficial package to interface and interact with SAIL Databank’s database via R.

Project Status: Active – The project has reached a stable, usable state and is being actively developed. License: MIT

Getting Started

Installation

  1. Installing saildb whilst inside SAIL’s TRE Gateway:

    • Running the installer.R script found within R:/R_Packages/SAIL_DBI directly, or by sourcing it:
    # Somewhere in your project
    source('R:/R_Packages/SAIL_DBI/installer.R')
    • Or; you can install directly using the install.packages() function:
    # Install from resource (`R:/`) directory somewhere in your project
    install.packages(
      pkgs   = 'R:/R_Packages/SAIL_DBI/saildb_1.0.0.tar.gz',
      repos  = NULL,
      source = 'source'
    )
  2. Installing saildb whilst outside the gateway:

Important

You won’t be able to use this method whilst inside the gateway as
Github is blocked for security; use the first method if you are
developing inside the gateway

# Install devtools if not already installed
install.packages('devtools')

# Install from github
devtools::install_github('JackScanlon/SAILDB-R')

Connecting to SAIL’s DB

Once installed, you may connect to the database as described below:

# Load the package
library(saildb)

# Connect to the datase
#
#  NOTE:
#   - You will be automatically connected using your gateway credentials if
#     they have already been stored by `saildb::Profile`; otherwise you will
#     be prompted to enter your username/password
#
db = Connection$new()

# Check if we're connected (not required)
if (db$connected) {
  print('We are connected!')
}

# Perform some query
db$run("
  SELECT
      'Hello, world!' AS MESSAGE
    FROM SYSIBM.SYSDUMMY1;
")

Example usage

To view detailed examples and their explanations, see:

  • If you’re viewing from the documentation website: please see the Reference page(s) and the available article(s), e.g. the Connection article
  • If you’re viewing via Github: please see the documentation and vignettes

About

An unofficial R package to interface with SAIL Databank

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages