Skip to content

Commit

Permalink
chore: Drop unused scdb_right_join functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Munch Grünewald committed Jan 11, 2024
1 parent 9711740 commit 0abc845
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions R/db_joins.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,30 +253,6 @@ right_join.tbl_sql <- function(x, y, by = NULL, ...) {
return(join_result)
}

#' dbplyr and SQLite does not work right now for right_joins it seems
#' so we "fix" it by doing a left join on SQLiteConnections
#' @inheritParams dbplyr::join.tbl_sql
#' @inherit dbplyr::join.tbl_sql return
#' @param renamer named list generated by select_na_sql
#' @noRd
scdb_right_join <- function(x, y, sql_on, suffix = c(".x", ".y"), renamer, ...) {
UseMethod("scdb_right_join")
}

#' @inheritParams scdb_right_join
scdb_right_join.tbl_dbi <- function(x, y, sql_on, renamer, ...) {
dplyr::right_join(x, y, suffix = c(".y", ".x"), sql_on = sql_on, ...) |>
dplyr::rename(!!renamer) |>
dplyr::select(tidyselect::all_of(names(renamer)))
}

#' @inheritParams scdb_right_join
scdb_right_join.tbl_SQLiteConnection <- function(x, y, sql_on, renamer, ...) {
dplyr::left_join(y, x, suffix = c(".y", ".x"), sql_on = sql_on, ...) |>
dplyr::rename(!!renamer) |>
dplyr::select(tidyselect::all_of(names(renamer)))
}


#' @rdname joins
#' @exportS3Method dplyr::full_join
Expand Down

0 comments on commit 0abc845

Please sign in to comment.