Skip to content

Commit

Permalink
Introduce simulate_mariadb()
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Oct 6, 2023
1 parent 1e48cfa commit 62c5eca
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ export(simulate_dbi)
export(simulate_hana)
export(simulate_hive)
export(simulate_impala)
export(simulate_mariadb)
export(simulate_mssql)
export(simulate_mysql)
export(simulate_odbc)
Expand Down
6 changes: 5 additions & 1 deletion R/backend-mysql.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ NULL

#' @export
#' @rdname backend-mysql
simulate_mysql <- function() simulate_dbi("MariaDBConnection")
simulate_mysql <- function() simulate_dbi("MySQLConnection")

#' @export
#' @rdname backend-mysql
simulate_mariadb <- function() simulate_dbi("MariaDBConnection")

#' @export
dbplyr_edition.MariaDBConnection <- function(con) {
Expand Down
3 changes: 3 additions & 0 deletions man/backend-mysql.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/test-backend-mysql.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test_that("custom stringr functions translated correctly", {
# verbs -------------------------------------------------------------------

test_that("generates custom sql", {
con_maria <- simulate_mysql()
con_maria <- simulate_mariadb()

expect_snapshot(sql_table_analyze(con_maria, in_schema("schema", "tbl")))
expect_snapshot(sql_query_explain(con_maria, sql("SELECT * FROM table")))
Expand All @@ -57,7 +57,7 @@ test_that("generates custom sql", {

expect_snapshot(copy_inline(con_maria, tibble(x = 1:2, y = letters[1:2])) %>% remote_query())

con_mysql <- simulate_dbi("MySQLConnection")
con_mysql <- simulate_mysql()
expect_snapshot(copy_inline(con_mysql, tibble(x = 1:2, y = letters[1:2])) %>% remote_query())
})

Expand Down

0 comments on commit 62c5eca

Please sign in to comment.