Skip to contents

Show history of queries loaded into a database collection

Usage

dbQueryHistory(con, verbose = FALSE)

Arguments

con

A connection object, see section `Databases` in ctrdata.

verbose

If TRUE, prints additional information (default FALSE).

Value

A data frame (or tibble, if tibble is loaded) with columns: `query-timestamp`, `query-register`, `query-records` (note: this is the number of records loaded when last executing ctrLoadQueryIntoDb, not the total record number) and `query-term`, with one row for each time that

ctrLoadQueryIntoDb loaded trial records into this collection.

Examples


dbc <- nodbi::src_sqlite(
    dbname = system.file("extdata", "demo.sqlite", package = "ctrdata"),
    collection = "my_trials"
)

dbQueryHistory(con = dbc)
#>       query-timestamp query-register query-records
#> 1 2023-12-03 11:35:44          EUCTR            12
#> 2 2023-12-03 11:35:58          CTGOV             8
#> 3 2023-12-03 11:36:02         ISRCTN             8
#> 4 2023-12-03 11:36:11           CTIS             3
#> 5 2023-12-03 11:36:16         CTGOV2             5
#>                                                                                                                       query-term
#> 1                                    query=&age=newborn&phase=phase-three&dateFrom=2015-02-28&dateTo=2015-03-31&status=completed
#> 2 term=AREA[MaximumAge]+RANGE[0+days,+28+days]&intr=Drugs,+Investigational&strd_s=01/01/2018&strd_e=01/01/2020&type=Intr&phase=2
#> 3                                                                                    q=&filters=ageRange:Neonate,phase:Phase+III
#> 4                               basicSearchInputAND=cancer&status=Ongoing, recruiting&ageGroupCode=2&haveOrphanDesignation=false
#> 5                                  distance=50&cond=neuroblastoma&aggFilters=phase:2,results:with&primComp=2014-01-01_2014-12-31