Skip to content

remote_name() gives the name remote table, or NULL if it's a query. remote_query() gives the text of the query, and remote_query_plan() the query plan (as computed by the remote database). remote_src() and remote_con() give the dplyr source and DBI connection respectively.

Usage

remote_name(x)

remote_src(x)

remote_con(x)

remote_query(x)

remote_query_plan(x)

Arguments

x

Remote table, currently must be a tbl_sql.

Value

The value, or NULL if not remote table, or not applicable. For example, computed queries do not have a "name"

Examples

mf <- memdb_frame(x = 1:5, y = 5:1, .name = "blorp")
remote_name(mf)
#> <IDENT> blorp
remote_src(mf)
#> src:  sqlite 3.37.2 [:memory:]
#> tbls: blorp, dbplyr_001, dbplyr_002, dbplyr_003, dbplyr_004, dbplyr_005,
#>   dbplyr_006, dbplyr_007, dbplyr_008, dbplyr_009, dbplyr_010, dbplyr_011,
#>   dbplyr_012, dbplyr_013, dbplyr_014, dbplyr_015, dbplyr_016, dbplyr_017,
#>   dbplyr_018, dbplyr_019, dbplyr_020, dbplyr_021, dbplyr_022, dbplyr_023,
#>   dbplyr_024, dbplyr_025, dbplyr_026, df, dplyr::band_instruments,
#>   dplyr::band_members, mtcars, sqlite_stat1, sqlite_stat4, squirrels
remote_con(mf)
#> <SQLiteConnection>
#>   Path: :memory:
#>   Extensions: TRUE
remote_query(mf)
#> <SQL> SELECT *
#> FROM `blorp`

mf2 <- dplyr::filter(mf, x > 3)
remote_name(mf2)
#> NULL
remote_src(mf2)
#> src:  sqlite 3.37.2 [:memory:]
#> tbls: blorp, dbplyr_001, dbplyr_002, dbplyr_003, dbplyr_004, dbplyr_005,
#>   dbplyr_006, dbplyr_007, dbplyr_008, dbplyr_009, dbplyr_010, dbplyr_011,
#>   dbplyr_012, dbplyr_013, dbplyr_014, dbplyr_015, dbplyr_016, dbplyr_017,
#>   dbplyr_018, dbplyr_019, dbplyr_020, dbplyr_021, dbplyr_022, dbplyr_023,
#>   dbplyr_024, dbplyr_025, dbplyr_026, df, dplyr::band_instruments,
#>   dplyr::band_members, mtcars, sqlite_stat1, sqlite_stat4, squirrels
remote_con(mf2)
#> <SQLiteConnection>
#>   Path: :memory:
#>   Extensions: TRUE
remote_query(mf2)
#> <SQL> SELECT *
#> FROM `blorp`
#> WHERE (`x` > 3.0)