Skip to content

Commit

Permalink
replace outdated RMySQL with successor RMariaDB to avoid json warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansteffan committed Aug 24, 2024
1 parent d52255a commit 215dcef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: peekbankr
Type: Package
Title: Accessing the Peekbank Database
Version: 0.1.1.9007
Version: 0.1.1.9008
Authors@R: c(
person("Mika", "Braginsky", email = "[email protected]", role = c("aut", "cre")),
person("Kyle", "MacDonald", email = "[email protected]", role = "aut"),
Expand All @@ -23,9 +23,9 @@ Imports:
magrittr (>= 2.0.1),
purrr (>= 0.3.4),
rlang (>= 0.4.10),
RMySQL (>= 0.10.21),
tidyr (>= 1.1.2),
stringr (>= 1.5.1)
stringr (>= 1.5.1),
RMariaDB (>= 1.3.2)
Suggests:
knitr,
rmarkdown
Expand Down
8 changes: 6 additions & 2 deletions R/peekbankr.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#' @importFrom rlang .data
NULL

options(warn=-1)

pkg_globals <- new.env()
pkg_globals$SAMPLE_RATE <- 40 # Hz

Expand Down Expand Up @@ -80,12 +82,14 @@ connect_to_peekbank <- function(db_version = "current", db_args = NULL,
compress = TRUE) {

db_info <- get_db_info()
flags <- if (compress) RMySQL::CLIENT_COMPRESS else 0

flags <- if (compress) RMariaDB::CLIENT_COMPRESS else 0

if (is.null(db_args)) db_args <- db_info


DBI::dbConnect(
RMySQL::MySQL(),
RMariaDB::MariaDB(),
host = db_args$host,
dbname = translate_version(db_version, db_args, db_info),
user = db_args$user,
Expand Down

0 comments on commit 215dcef

Please sign in to comment.