Skip to content

Param names for src_* functions should agree with the drivers' names #1955

@bborgesr

Description

@bborgesr

I came across a param name mismatch when I was looking at RMySQL in particular (haven't checked the other drivers):

In DBI, using the RMySQL method for dbConnect, we find the param username:

conn <- DBI::dbConnect(
     drv = RMySQL::MySQL(),
     dbname = "shinydemo",
     host = "shiny-demo.csa7qlmguqrf.us-east-1.rds.amazonaws.com",
     username = "guest",
     password = "guest"
)

# get the first 5 rows:
dbGetQuery(conn, "SELECT * from City LIMIT 5;")
#>    ID           Name CountryCode      District Population
#>  1  1          Kabul         AFG         Kabol    1780000
#>  2  2       Qandahar         AFG      Qandahar     237500
#>  3  3          Herat         AFG         Herat     186800
#>  4  4 Mazar-e-Sharif         AFG         Balkh     127800
#>  5  5      Amsterdam         NLD Noord-Holland     731200

In dplyr, in the src_mysql function, the same param is called user:

my_db <- dplyr::src_mysql(
     dbname = "shinydemo",
     host = "shiny-demo.csa7qlmguqrf.us-east-1.rds.amazonaws.com",
     user = "guest",
     password = "guest"
)

# get the first 5 rows:
my_db %>% tbl("City") %>% head(5)
#>    ID           Name CountryCode      District Population
#>  1  1          Kabul         AFG         Kabol    1780000
#>  2  2       Qandahar         AFG      Qandahar     237500
#>  3  3          Herat         AFG         Herat     186800
#>  4  4 Mazar-e-Sharif         AFG         Balkh     127800
#>  5  5      Amsterdam         NLD Noord-Holland     731200

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions