Added R methods and their c counterparts for connection and database management

This commit is contained in:
2020-10-02 13:12:03 +01:00
parent 91013ea064
commit 907d848791
19 changed files with 847 additions and 28 deletions

26
man/modb_conn_ref.Rd Normal file
View File

@@ -0,0 +1,26 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Manage.R
\name{modb_conn_ref}
\alias{modb_conn_ref}
\title{MODB Connection References}
\usage{
modb_conn_ref(conn_id, conn_name, conn_ref, args = NULL)
}
\arguments{
\item{conn_id}{Integer. The ID of the connection returned by modb_connect}
\item{conn_name}{String. The name provided when creating a connection.}
\item{conn_ref}{Expected to be either a conn_id or a conn_name}
\item{args}{list(...) Arguments passed to a calling function in the va scope.}
}
\description{
\code{modb_conn_ref} checks for and/or validates parameters that may be a
connection reference. Connections in MODB may be named on creation or must
be referenced by the unique ID that is returned by the
\link{\code{modb_connect}} method.
}
\seealso{
\link{\code{modb_connect}}
}

42
man/modb_connect.Rd Normal file
View File

@@ -0,0 +1,42 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Manage.R
\name{modb_connect}
\alias{modb_connect}
\title{MODB Connections}
\usage{
modb_connect(
username,
password,
database,
host = "localhost",
port = 3306,
socket = NULL,
conn_name = NULL
)
}
\arguments{
\item{username}{String. Username to use when connecting to the database.}
\item{password}{String. Password to use when connecting to the database.}
\item{database}{String. The database to use.}
\item{host}{String. The hostname or IP address to connect to.
Either host & port or socket may be used}
\item{port}{Integer. The port number to connect on.}
\item{socket}{String. The socket path to connect to,
e.g. /var/run/mysqld/mysqld.sock}
\item{name}{String. A name for the connection which can be used to identify
the connection later on. Alternatively the id returned
can be used.}
}
\value{
The id of the connection
}
\description{
\code{modb_connect} creates a new database connection and attmepts to open a
connection to a database with the details provided.
}

View File

@@ -0,0 +1,47 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Manage.R
\name{modb_connectionInfo}
\alias{modb_connectionInfo}
\alias{modb_connectionExists}
\alias{modb_connectionId}
\alias{modb_connectionName}
\title{MODB Connections}
\usage{
modb_connectionInfo(stop_on_error = TRUE, ...)
modb_connectionExists(...)
modb_connectionId(conn_name, stop_on_error = TRUE)
modb_connectionName(conn_id, stop_on_error = TRUE)
}
\arguments{
\item{...}{conn_id, conn_name or conn_ref required. See \link{modb_conn_ref}}
\item{conn_name}{String. The name provided when creating a connection.}
\item{conn_id}{Integer. The id of the connection, returned by modb_connect.}
}
\value{
The details of the connection as a list.
TRUE if the connection exists, FALSE if not.
The ID of the connection.
The name of the connection.
}
\description{
Fetches information on a connection such as the last query, insert id and
number of queries run
}
\section{Functions}{
\itemize{
\item \code{modb_connectionExists}: Determines if a connection with the name or
id provided exists
\item \code{modb_connectionId}: Finds a connection id via the name
\item \code{modb_connectionName}: Finds a connection name via the id
}}

14
man/modb_disconnect.Rd Normal file
View File

@@ -0,0 +1,14 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Manage.R
\name{modb_disconnect}
\alias{modb_disconnect}
\title{MODB Connections}
\usage{
modb_disconnect(...)
}
\arguments{
\item{...}{conn_id, conn_name or conn_ref required. See \link{modb_conn_ref}}
}
\description{
modb_disconnect closes a database connection and cleans up the instance
}

16
man/rmodb.Rd Normal file
View File

@@ -0,0 +1,16 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RMODB.R
\docType{package}
\name{rmodb}
\alias{rmodb}
\title{RMODB: Metadata-Object pair database}
\description{
RMODB implements a metadata-object database for storing R objects in
MySQL. R objects are serialized into a binary memory buffer which is then
written into a MySQL database along with metadata such as creation
timestamp, update timestamp, owner, title etc. The metadata fields are
customisable on creation of the database. the metadata fields are cleartext
and queryable allowing objects to be found and returned. On returning an
object, it is de-serialised using the reverseof the serialize to binary
memory process.
}