Skip to content

Commit

Permalink
Merge branch 'new-functions' of github.com:ScotGovAnalysis/RtoSQLServ…
Browse files Browse the repository at this point in the history
…er into new-functions
  • Loading branch information
tomwilsonsco committed Sep 13, 2024
2 parents 1b615dc + 0634f45 commit 43f125a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/db_table_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ get_table_stats <- function(i, columns_info, schema, table_name) {

# Building the full SQL query
glue::glue_sql(
"SELECT {col} AS column_name, {data_type} AS data_type, \\
"SELECT {col} AS column_name, {data_type} AS data_type, \\
(SELECT COUNT(*) FROM {`schema`}.{`table_name`}) AS row_count, \\
(SELECT COUNT(*) FROM {`schema`}.{`table_name`} WHERE {col} IS NULL) \\
AS null_count, \\
Expand Down
3 changes: 2 additions & 1 deletion R/read_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ create_read_sql <- function(schema,
if (!is.null(filter_stmt)) {
filter_stmt <- format_filter(filter_stmt)
glue::glue_sql(glue::glue(initial_sql, " WHERE {filter_stmt};"),
.con = DBI::ANSI())
.con = DBI::ANSI()
)
} else {
glue::glue_sql(glue::glue(initial_sql, ";"), .con = DBI::ANSI())
}
Expand Down

0 comments on commit 43f125a

Please sign in to comment.