devel: setup for sql-like data generation

This commit is contained in:
2026-09-14 13:40:02 +03:00
parent 6a9535ffbb
commit 4a06d93e64
2 changed files with 28 additions and 3 deletions

View File

@@ -1,3 +1,7 @@
options(box.path = here::here())
box::use(
R/modules/utils
)
#' @export
#' @description Function to open connection to db, disigned to easy dubugging.
@@ -102,9 +106,6 @@ get_dummy_data = function(type) {
#' типу данных
get_dummy_df = function(forms_id_type_list) {
options(box.path = here::here())
box::use(R/modules/utils)
purrr::map(
.x = forms_id_type_list,
.f = utils$get_empty_data
@@ -113,6 +114,20 @@ get_dummy_df = function(forms_id_type_list) {
}
#' @description
#' Генерация пустого датасета с пустыми значениями соответствующие
#' типу данных
get_query_df = function(forms_id_type_list) {
names_and_types <- purrr::map(
.x = forms_id_type_list,
.f = utils$get_sql_format
)
paste(names(names_and_types), unname(names_and_types), collapse = ",\n")
}
#' @description
#' Сравнение полей в существующей в базе данных таблице и попытка
#' коррекции таблицы