MsBackendOfflineSql: SQL-based MS backend without active database connection

View source: R/MsBackendOfflineSql.R

MsBackendOfflineSqlR Documentation

SQL-based MS backend without active database connection

Description

The MsBackendOfflineSql backend extends the MsBackendSql() backend directly and inherits thus all of its functions as well as properties. The only difference between the two backend is that MsBackendSql keeps an active connection to the SQL database inside the object while the MsBackendOfflineSql backends reconnects to the SQL database for each query. While the performance of the latter is slightly lower (due to the need to connect/disconnect to the database for each function call) it can also be used in a parallel processing environment.

Usage

MsBackendOfflineSql()

## S4 method for signature 'MsBackendOfflineSql'
backendInitialize(
  object,
  drv = NULL,
  dbname = character(),
  user = character(),
  password = character(),
  host = character(),
  port = NA_integer_,
  data,
  ...
)

Arguments

object

A MsBackendOfflineSql object.

drv

A DBI database driver object (such as SQLite() from the RSQLite package or MariaDB() from the RMariaDB package). See dbConnect() for more information.

dbname

character(1) with the name of the database. Passed directly to dbConnect().

user

character(1) with the user name for the database. Passed directly to dbConnect().

password

character(1) with the password for the database. Note that this password is stored (unencrypted) within the object. Passed directly to dbConnect().

host

character(1) with the host running the database. Passed directly to dbConnect().

port

integer(1) with the port number (optional). Passed directly to dbConnect().

data

For backendInitialize(): optional DataFrame with the full spectra data that should be inserted into a (new) MsBackendSql database. If provided, it is assumed that the provided database connection information if for a (writeable) empty database into which data should be inserted. data could be the output of spectraData from another backend.

...

ignored.

Creation of backend objects

An empty instance of an MsBackendOfflineSql class can be created using the MsBackendOfflineSql() function. An existing MsBackendSql SQL database can be loaded with the backendInitialize() function. This function takes parameters drv, dbname, user, password, host and port, all parameters that are passed to the dbConnect() function to connect to the (existing) SQL database.

See MsBackendSql() for information on how to create a MsBackend SQL database.

Author(s)

Johannes Rainer


rformassspectrometry/MsqlBackend documentation built on Nov. 22, 2024, 9:06 a.m.