diff --git a/R/MariaDBConnection.R b/R/MariaDBConnection.R index ac5efb3b..005ca322 100644 --- a/R/MariaDBConnection.R +++ b/R/MariaDBConnection.R @@ -1,7 +1,18 @@ #' Class MariaDBConnection. #' -#' `MariaDBConnection` objects are usually created by -#' [DBI::dbConnect()] +#' `"MariaDBConnection"` objects are usually created by [DBI::dbConnect()]. +#' They represent a connection to a MariaDB or MySQL database. +#' +#' The `"MySQLConnection"` class is a subclass of `"MariaDBConnection"`. +#' Objects of that class are created by `dbConnect(MariaDB(mysql = TRUE), ...)` to indicate +#' that the server is a MySQL server. +#' The \pkg{RMariaDB} package supports both MariaDB and MySQL servers, but the SQL dialect +#' and other details vary. +#' The default is to assume a MariaDB server. +#' +#' The older \pkg{RMySQL} package also implements the `"MySQLConnection"` class. +#' If both packages are loaded, the class of the connection object is determined by the +#' package that was loaded first. #' #' @export #' @keywords internal @@ -20,6 +31,7 @@ setClass("MariaDBConnection", #' @export #' @keywords internal +#' @rdname MariaDBConnection-class setClass("MySQLConnection", contains = "MariaDBConnection" ) diff --git a/R/MariaDBDriver.R b/R/MariaDBDriver.R index de3005c5..18a229b2 100644 --- a/R/MariaDBDriver.R +++ b/R/MariaDBDriver.R @@ -4,6 +4,16 @@ #' This class should always be initialized with the [MariaDB()] function. #' It returns a singleton that allows you to connect to MariaDB. #' +#' The `"MySQLDriver"` class is a subclass of `"MariaDBDriver"`. +#' It is created by `MariaDB(mysql = TRUE)` to indicate intent to connect to a MySQL server. +#' The \pkg{RMariaDB} package supports both MariaDB and MySQL servers, but the SQL dialect +#' and other details vary. +#' The default is to assume a MariaDB server. +#' +#' The older \pkg{RMySQL} package also implements the `"MySQLDriver"` class. +#' If both packages are loaded, the class of the connection object is determined by the +#' package that was loaded first. +#' #' @export #' @keywords internal setClass("MariaDBDriver", @@ -12,6 +22,7 @@ setClass("MariaDBDriver", #' @export #' @keywords internal +#' @rdname MariaDBDriver-class setClass("MySQLDriver", contains = "MariaDBDriver", ) diff --git a/man/MariaDBConnection-class.Rd b/man/MariaDBConnection-class.Rd index 57d8f274..5a30a939 100644 --- a/man/MariaDBConnection-class.Rd +++ b/man/MariaDBConnection-class.Rd @@ -5,6 +5,7 @@ \docType{class} \name{MariaDBConnection-class} \alias{MariaDBConnection-class} +\alias{MySQLConnection-class} \alias{format.MariaDBConnection} \alias{dbDisconnect_MariaDBConnection} \alias{dbDisconnect,MariaDBConnection-method} @@ -27,7 +28,19 @@ \S4method{show}{MariaDBConnection}(object) } \description{ -\code{MariaDBConnection} objects are usually created by -\code{\link[DBI:dbConnect]{DBI::dbConnect()}} +\code{"MariaDBConnection"} objects are usually created by \code{\link[DBI:dbConnect]{DBI::dbConnect()}}. +They represent a connection to a MariaDB or MySQL database. +} +\details{ +The \code{"MySQLConnection"} class is a subclass of \code{"MariaDBConnection"}. +Objects of that class are created by \code{dbConnect(MariaDB(mysql = TRUE), ...)} to indicate +that the server is a MySQL server. +The \pkg{RMariaDB} package supports both MariaDB and MySQL servers, but the SQL dialect +and other details vary. +The default is to assume a MariaDB server. + +The older \pkg{RMySQL} package also implements the \code{"MySQLConnection"} class. +If both packages are loaded, the class of the connection object is determined by the +package that was loaded first. } \keyword{internal} diff --git a/man/MariaDBDriver-class.Rd b/man/MariaDBDriver-class.Rd index 5b619382..0faf780f 100644 --- a/man/MariaDBDriver-class.Rd +++ b/man/MariaDBDriver-class.Rd @@ -4,6 +4,7 @@ \docType{class} \name{MariaDBDriver-class} \alias{MariaDBDriver-class} +\alias{MySQLDriver-class} \alias{dbGetInfo_MariaDBDriver} \alias{dbGetInfo,MariaDBDriver-method} \alias{dbIsValid_MariaDBDriver} @@ -23,4 +24,15 @@ An MariaDB driver implementing the R database (DBI) API. This class should always be initialized with the \code{\link[=MariaDB]{MariaDB()}} function. It returns a singleton that allows you to connect to MariaDB. } +\details{ +The \code{"MySQLDriver"} class is a subclass of \code{"MariaDBDriver"}. +It is created by \code{MariaDB(mysql = TRUE)} to indicate intent to connect to a MySQL server. +The \pkg{RMariaDB} package supports both MariaDB and MySQL servers, but the SQL dialect +and other details vary. +The default is to assume a MariaDB server. + +The older \pkg{RMySQL} package also implements the \code{"MySQLDriver"} class. +If both packages are loaded, the class of the connection object is determined by the +package that was loaded first. +} \keyword{internal}