Places all tables from the database connection in a list. This makes use of the tables in dplyr extremely easy.
retrieve_tables(connection)
connection | an sql connection |
---|
a list containing pointers to tables within the sql connection.
db_pth <- system.file("testdata/synthetic_db.sqlite3", package = "inspectEHR") ctn <- connect(sqlite_file = db_pth) core <- make_core(ctn) tbls <- retrieve_tables(ctn) tbls[["events"]] # the events table#> # Source: table<events> [?? x 12] #> # Database: sqlite 3.29.0 #> # [/tmp/Rtmpl8hgjg/temp_libpathdc12a384b20/inspectEHR/testdata/synthetic_db.sqlite3] #> code_name string string2 string3 datetime date time real integer integer2 #> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> <int> <int> #> 1 NIHR_HIC… B-2 NA NA NA NA NA NA NA NA #> 2 NIHR_HIC… B-2 NA NA NA NA NA NA NA NA #> 3 NIHR_HIC… B-2 NA NA NA NA NA NA NA NA #> 4 NIHR_HIC… B-2 NA NA NA NA NA NA NA NA #> 5 NIHR_HIC… B-2 NA NA NA NA NA NA NA NA #> 6 NIHR_HIC… B-1 NA NA NA NA NA NA NA NA #> 7 NIHR_HIC… B-1 NA NA NA NA NA NA NA NA #> 8 NIHR_HIC… B-1 NA NA NA NA NA NA NA NA #> 9 NIHR_HIC… B-1 NA NA NA NA NA NA NA NA #> 10 NIHR_HIC… B-1 NA NA NA NA NA NA NA NA #> # … with more rows, and 2 more variables: episode_id <int>, event_id <int>