Skip to content

Commit

Permalink
Addresed issue #46
Browse files Browse the repository at this point in the history
  • Loading branch information
CraigDemke committed Nov 25, 2024
1 parent 45d20f4 commit c95cd5f
Show file tree
Hide file tree
Showing 61 changed files with 906 additions and 133 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ BugReports: https://github.com/ut-effectiveness/utDataStoR/issues
Imports:
fs,
here,
lifecycle,
readr
Suggests:
rmarkdown,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export(sql_validate_student_courses)
export(write_sql_file)
importFrom(fs,file_copy)
importFrom(here,here)
importFrom(lifecycle,deprecated)
importFrom(readr,read_file)
3 changes: 1 addition & 2 deletions R/display_sql.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#' Display sql with comments
#'
#' This function returns the content of a specified SQL file, including any comments within
#' the file. The function should used within a sql code chunk (```sql ``` ) in R markdown within single back tick.
#' Please refer to the example section for better understanding.
#' `r lifecycle::badge("stable")`
#'
#' @param folder A character string specifying the folder within `inst/sql` where the SQL file is located.
#' Must be within quotes.
Expand Down
1 change: 1 addition & 0 deletions R/fte.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#' Generate FTE SQL
#' `r lifecycle::badge("deprecated")`
#'
#' `sql_fte` was intended to generate the standard sql query for pulling FTE from Edify, REPT
#' of DSCIR. We have deprecated this function and will use "make_fte_sql()" instead.
Expand Down
10 changes: 3 additions & 7 deletions R/helpers.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#' Generate Helper Functions
#'
#' `create_sql_dir` will generate the path used to house the sql files based on the context parameter.
#'
#' The create_sql_dir function checks if a directory for SQL files exists based on the specified
#' context (project, shiny, or sandbox) and creates one if it doesn't. This ensures the correct folder
#' structure is set up for different project environments.
#' `r lifecycle::badge("stable")`
#'
#' @param context The context of your project. Options are: "project", "shiny", or "sandbox".
#' If not specified, "project" is used bydefault.
#' If not specified, "project" is used by default.
#'
#' @export
#'
Expand All @@ -30,14 +28,12 @@ create_sql_dir <- function(context = "project") {
Please use the 'utHelpR::make_standard_folders()' function instead for improved functionality and support.")
}

#' Write SQL Files Functions
#'
#' `write_sql_files` will copy and move the sql file based on the context parameter.
#'
#' The write_sql_file function copies a specified SQL file from a source folder to a target directory,
#' determined by the context (shiny, sandbox, or project). Using the `fs::file_copy` function,
#' it places the file in the appropriate path (e.g., in the inst/sql folder for shiny, sandbox/sql for
#' sandbox, or the main sql directory otherwise).
#' `r lifecycle::badge("stable")`
#'
#' @param context The context of your project. "project", "shiny", and "sandbox"
#' @param file The name of the SQL file that you want to copy to a new location
Expand Down
3 changes: 1 addition & 2 deletions R/make_fte_sql.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#' Generate fte sql
#'
#' `make_fte_sql` function will generate the standard SQL query for pulling Full-Time
#' Equivalent (FTE) data from Edify.This function allows users to retrieve FTE data based on
#' different available data sources. Use the `type` parameter to select the specific FTE data
#' type. Available options are: "current", "census" and "eot" (end of term). For more details see
#' the fte (full time quivalent) vignette. You can bring this up by running the following code in
#' your console: \code{vignette("full_time_equivalent", package = "utDataStoR")}
#' #' `r lifecycle::badge("stable")`
#'
#' @param name The name you want the SQL file to have in your sql folder. This is a string and
#' must be provided in quotes (e.g., "your_filename.sql").
Expand Down
3 changes: 1 addition & 2 deletions R/make_headcount_sql.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#' Generate headcount Sql
#'
#' `make_headcount_sql` will generate a standard sql query for pulling headcount
#' data from Edify. This function is often used with the function [utHelpR::uth_make_outcome_count] to
#' produce pivot tables with headcount numbers. There are several types of headcounts
Expand All @@ -8,6 +6,7 @@
#' contact Joy Lindsay. For more details see the headcount vignette. You can bring this
#' up by running the following code in your console.
#' \code{vignette("headcount", package = "utDataStoR")}
#' `r lifecycle::badge("stable")`
#'
#'
#' @param name The name you want the SQL file to have in your sql folder. This is a string and must be provided in quotes
Expand Down
3 changes: 1 addition & 2 deletions R/make_retention_sql.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#' Generate Retention Sql
#'
#' `make_retention_sql` will generate the standard SQL query for pulling retention
#' data from Edify. This function helps in retrieving data related to student retention metrics.
#' To specify the type of retention data you would like, use the `type` parameter.
#' `r lifecycle::badge("stable")`
#'
#' @param name The name you want the SQL file to have in your sql folder. This is a string and must be provided in quotes
#' (e.g., "your_filename.sql").
Expand Down
7 changes: 7 additions & 0 deletions R/utDataStoR-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#' @keywords internal
"_PACKAGE"

## usethis namespace: start
#' @importFrom lifecycle deprecated
## usethis namespace: end
NULL
9 changes: 7 additions & 2 deletions R/validations.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Generate Validation SQL
#'
#' `sql_validate_student` will generate the standard sql query for pulling Student Validations from Edify.
#' Validations are done through Edify.
#' `r lifecycle::badge("experimental")`
#'
#'
#' @param data_source The server you will be full from. Currently, Edify.
#' @param name The name you want the SQL file to have in your sql folder. This is a string and must be provided in quotes
Expand All @@ -25,6 +25,7 @@ sql_validate_student <- function(data_source, name, context) {

#' `sql_validate_student_courses` will generate the standard sql query for pulling Student Course Validations from Edify.
#' Validations are done through Edify.
#' `r lifecycle::badge("experimental")`
#'
#' @param data_source The server you will be full from. Currently, Edify.
#' @param name The name you want the SQL file to have in your sql folder. This is a string and must be provided in quotes
Expand All @@ -48,6 +49,7 @@ sql_validate_student_courses <- function(data_source, name, context) {

#' `sql_validate_courses` will generate the standard sql query for pulling Course Validations from Edify.
#' Validations are done through Edify.
#' `r lifecycle::badge("experimental")`
#'
#' @param data_source The server you will be full from. Currently, Edify.
#' @param name The name you want the SQL file to have in your sql folder. This is a string and must be provided in quotes
Expand All @@ -71,6 +73,7 @@ sql_validate_courses <- function(data_source, name, context) {

#' `sql_validate_graduation` will generate the standard sql query for pulling Graduation Validations from Edify.
#' Validations are done through Edify.
#' `r lifecycle::badge("experimental")`
#'
#' @param data_source The server you will be full from. Currently, Edify.
#' @param name The name you want the SQL file to have in your sql folder. This is a string and must be provided in quotes
Expand All @@ -94,6 +97,7 @@ sql_validate_graduation <- function(data_source, name, context) {

#' `sql_validate_rooms` will generate the standard sql query for pulling Rooms Validations from Edify.
#' Validations are done through Edify.
#' `r lifecycle::badge("experimental")`
#'
#' @param data_source The server you will be full from. Currently, Edify.
#' @param name The name you want the SQL file to have in your sql folder. This is a string and must be provided in quotes
Expand All @@ -117,6 +121,7 @@ sql_validate_rooms <- function(data_source, name, context) {

#' `sql_validate_buildings` will generate the standard sql query for pulling Building Validations from Edify.
#' Validations are done through Edify.
#' `r lifecycle::badge("experimental")`
#'
#' @param data_source The server you will be full from. Currently, Edify.
#' @param name The name you want the SQL file to have in your sql folder. This is a string and must be provided in quotes
Expand Down
Loading

0 comments on commit c95cd5f

Please sign in to comment.