Skip to content

Commit 3f55974

Browse files
committed
Fix error in qc.df() when no query is active
Previously, the examples/app-database.R would shown an error on startup because the initial query was "", which was then sent as a SQL query to RSQLite. The get_lazy_data code path accounted for the "" query, so we decided to make the eager code path just call the lazy code path, then collect(). Also fixed a formatting issue with the table.
1 parent d45820f commit 3f55974

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg-r/R/data_source.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ execute_query <- function(source, query, ...) {
9797

9898
#' @export
9999
execute_query.dbi_source <- function(source, query, ...) {
100-
DBI::dbGetQuery(source$conn, query)
100+
dplyr::collect(get_lazy_data(source, query))
101101
}
102102

103103
#' Test a SQL query on a data source.

pkg-r/examples/app-database.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ui <- page_sidebar(
5353
p(
5454
"The table below shows the current filtered data based on your chat queries:"
5555
),
56-
DT::DTOutput("data_table"),
56+
DT::DTOutput("data_table", fill = FALSE),
5757
br(),
5858
h3("Current SQL Query"),
5959
verbatimTextOutput("sql_query"),

0 commit comments

Comments
 (0)