
An unofficial package to interface and interact with SAIL Databank’s database via R.
-
Installing
saildb
whilst inside SAIL’s TRE Gateway:- Running the
installer.R
script found withinR:/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' )
- Running the
-
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')
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;
")
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