|
|
@@ -1,33 +1,3 @@
|
|
|
-db_is_shema_exist(schema = "x_matsalu")
|
|
|
-db_create_new_schema <- function(conf) {
|
|
|
-conn <- db_connect()
|
|
|
-all_schemas <- DBI::dbGetQuery(conn,sprintf(
|
|
|
-"-- DROP SCHEMA x_matsalu;
|
|
|
-CREATE SCHEMA %s AUTHORIZATION %s;", conf$schema, conf$user))
|
|
|
-}
|
|
|
-db_create_new_schema(conf)
|
|
|
-styler:::style_active_file()
|
|
|
-db_create_new_schema <- function(conf) {
|
|
|
-conn <- db_connect()
|
|
|
-DBI::dbExecute(conn, sprintf(
|
|
|
-"-- DROP SCHEMA x_matsalu;
|
|
|
-CREATE SCHEMA %s AUTHORIZATION %s;", conf$schema, conf$user
|
|
|
-))
|
|
|
-}
|
|
|
-conf <- ruut::get_config()
|
|
|
-conf
|
|
|
-db_create_new_schema <- function(conf) {
|
|
|
-conn <- db_connect()
|
|
|
-DBI::dbExecute(conn, sprintf(
|
|
|
-"-- DROP SCHEMA x_matsalu;
|
|
|
-CREATE SCHEMA %s AUTHORIZATION %s;", conf$schema, conf$user
|
|
|
-))
|
|
|
-}
|
|
|
-db_create_new_schema(conf)
|
|
|
-conf$schema <- "x_valga"
|
|
|
-db_create_new_schema(conf)
|
|
|
-source(paste0(getwd(), "/R/db_all_schemas"))
|
|
|
-source(paste0(getwd(), "/R/db_all_schemas.R"))
|
|
|
paste0(getwd(), "/R/db_all_schemas.R")
|
|
|
source(paste0(getwd(), "/R/db_all_schemas.R"))
|
|
|
db_is_shema_exist(schema = "x_matsalu")
|
|
|
@@ -510,3 +480,33 @@ library(ruut)
|
|
|
config
|
|
|
config$schema <- 'maaamet'
|
|
|
db_schema_tablenames(conf = config)
|
|
|
+library(ruut)
|
|
|
+styler:::style_active_file()
|
|
|
+library(ruut)
|
|
|
+library(ruut)
|
|
|
+styler:::style_active_file()
|
|
|
+construct_qgis_output_result_to_beter_format <- function(str = "") {
|
|
|
+#' str - Processing algorithm… Algorithm '......' starting…
|
|
|
+#' Input parameters: -> kopeerin need loogilistes sulgudes
|
|
|
+#' olevad väärtused argumendi "str" väärtuseks.
|
|
|
+str <- "{ 'CREATEINDEX' : True, 'DATABASE' : 'Data', 'DROP_STRING_LENGTH' : False, 'ENCODING' : 'UTF-8', 'FORCE_SINGLEPART' : False, 'GEOMETRY_COLUMN' : 'geometry', 'INPUT' : '/data/gpkg/teed/teed_l.gpkg|layername=teed_l', 'LOWERCASE_NAMES' : True, 'OVERWRITE' : True, 'PRIMARY_KEY' : 'fid', 'SCHEMA' : 'data', 'TABLENAME' : 'mikihiir' }"
|
|
|
+str <- gsub("'", "", str)
|
|
|
+str <- gsub(":", "=", str)
|
|
|
+str <- gsub(" ", "", str)
|
|
|
+str <- gsub(",", "',", str)
|
|
|
+str <- gsub("=", "='", str)
|
|
|
+str <- gsub("'True'", "1", str)
|
|
|
+str <- gsub("'False'", "0", str)
|
|
|
+str <- gsub(",", ",\n", str)
|
|
|
+str <- gsub("[{]", "\nalgorithm=algorithm,\n", str)
|
|
|
+str <- gsub("[}]", "'\n", str)
|
|
|
+str <- gsub("layername='", "layername=", str)
|
|
|
+cat(str)
|
|
|
+str
|
|
|
+}
|
|
|
+str <- "{ 'CREATEINDEX' : True, 'DATABASE' : 'Data', 'DROP_STRING_LENGTH' : False, 'ENCODING' : 'UTF-8', 'FORCE_SINGLEPART' : False, 'GEOMETRY_COLUMN' : 'geometry', 'INPUT' : '/data/gpkg/teed/teed_l.gpkg|layername=teed_l', 'LOWERCASE_NAMES' : True, 'OVERWRITE' : True, 'PRIMARY_KEY' : 'fid', 'SCHEMA' : 'data', 'TABLENAME' : 'mikihiir' }"
|
|
|
+params <- construct_qgis_output_result_to_beter_format(str = str)
|
|
|
+styler:::style_active_file()
|
|
|
+styler:::style_active_file()
|
|
|
+library(ruut)
|
|
|
+library(ruut)
|