diff --git a/DESCRIPTION b/DESCRIPTION index a97c2515a0bd3aaf1b1feda0b73aa9f04644d71c..6ada618b777eb10230799a20c7ea713f99db062f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -37,3 +37,4 @@ Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) RoxygenNote: 7.1.1 +URL:https://dreal-datalab.gitlab.io/datalibaba/index.html, https://gitlab.com/dreal-datalab/datalibaba diff --git a/R/commenter_champs.R b/R/commenter_champs.R index 3d7a5984290d761dbb196383eddd1d0707292679..6837ee9110ea4c2e5b0939384c1ad9b06bb42b43 100644 --- a/R/commenter_champs.R +++ b/R/commenter_champs.R @@ -20,10 +20,10 @@ #' \dontrun{ #' commenter_champs(comment = "Je suis un commentaire ultra important sur la variable 'Species'.", #' var = "Species", table = "test_iris", -#' schema = "public", db = "production", user = "does") +#' schema = "public", db = "public", user = "does") #' } -commenter_champs <- function(comment = NULL, var = NULL, table = NULL, schema = NULL, db = "production", user = "does", server = NULL) { +commenter_champs <- function(comment = NULL, var = NULL, table = NULL, schema = NULL, db = "public", user = "does", server = NULL) { # ouverture de la connexion avec DBI::dbDriver("PostgreSQL") con <- connect_to_db(db = db, user = user, server = server) @@ -78,7 +78,7 @@ commenter_champs <- function(comment = NULL, var = NULL, table = NULL, schema = #' -post_dico_attr <- function(dico = NULL, table = NULL, schema = NULL, db = "production", user = "does", server = NULL) { +post_dico_attr <- function(dico = NULL, table = NULL, schema = NULL, db = "public", user = "does", server = NULL) { # ouverture de la connexion avec DBI::dbDriver("PostgreSQL") con <- connect_to_db(db = db, user = user, server = server) @@ -138,7 +138,7 @@ post_dico_attr <- function(dico = NULL, table = NULL, schema = NULL, db = "produ #' @importFrom rlang .data #' -get_table_comment <- function(table = NULL, schema = NULL, db = "production", user = "does", server = NULL) { +get_table_comment <- function(table = NULL, schema = NULL, db = "public", user = "does", server = NULL) { # ouverture de la connexion avec DBI::dbDriver("PostgreSQL") con <- connect_to_db(db = db, user = user, server = server) @@ -177,7 +177,7 @@ get_table_comment <- function(table = NULL, schema = NULL, db = "production", us #' @importFrom dplyr filter distinct #' @importFrom rlang .data -get_cols_comment <- function(table = NULL, schema = NULL, db = "production", user = "does", server = NULL) { +get_cols_comment <- function(table = NULL, schema = NULL, db = "public", user = "does", server = NULL) { # ouverture de la connexion avec DBI::dbDriver("PostgreSQL") con <- connect_to_db(db = db, user = user, server = server) @@ -216,7 +216,7 @@ get_cols_comment <- function(table = NULL, schema = NULL, db = "production", use #' get_table_comments(table = "test_iris", schema = "public", db = "public", #' user = "does", server = "localhost") #'} -get_table_comments <- function(table = NULL, schema = NULL, db = "production", user = "does", server = NULL) { +get_table_comments <- function(table = NULL, schema = NULL, db = "public", user = "does", server = NULL) { # ouverture de la connexion avec DBI::dbDriver("PostgreSQL") con <- connect_to_db(db = db, user = user, server = server) diff --git a/R/commenter_table.R b/R/commenter_table.R index fdd7daca25867726fe9126d2e92889e1288f8bcd..3e08b762fa3bf54c726d306ba9b5f335c55e3b5c 100644 --- a/R/commenter_table.R +++ b/R/commenter_table.R @@ -16,10 +16,10 @@ #' @examples #' \dontrun{ #' commenter_table(comment = "Je suis un commentaire important.", table = "test_iris", -#' schema = "public", db = "production", user = "does") +#' schema = "public", db = "public", user = "does") #' } -commenter_table <- function(comment = NULL, table = NULL, schema = NULL, db = "production", user = "does") { +commenter_table <- function(comment = NULL, table = NULL, schema = NULL, db = "public", user = "does") { # ouverture de la connexion avec DBI::dbDriver("PostgreSQL") con <- connect_to_db(db, user) @@ -55,7 +55,7 @@ commenter_table <- function(comment = NULL, table = NULL, schema = NULL, db = "p #' @importFrom rpostgis dbComment #' @return NULL #' @export -commenter_schema <- function(comment = NULL, schema = NULL, db = "production", user = "does") { +commenter_schema <- function(comment = NULL, schema = NULL, db = "public", user = "does") { # ouverture de la connexion avec DBI::dbDriver("PostgreSQL") con <- connect_to_db(db, user) diff --git a/R/get_data.R b/R/get_data.R index 9de25aa59aba1da2e405497ebbfe3d5a1d3d88ad..b7def292220ca97109c1256d4107b45faf5bba10 100644 --- a/R/get_data.R +++ b/R/get_data.R @@ -68,12 +68,12 @@ get_data_dbi <- function(con = NULL, #' #' @examples #' \dontrun{ -#' importer_data(table = "test_iris", schema = "zonages_habitat", db = "public", user = "does") +#' importer_data(table = "test_iris", schema = "public", db = "public", user = "does") #' } #' @source {rpostgis} http://mablab.org/rpostgis/ -importer_data <- function(table = NULL, schema = NULL, db = "production", server = NULL, user = "does") { +importer_data <- function(table = NULL, schema = NULL, db = "public", server = NULL, user = "does") { attempt::stop_if(table, is.null, msg = "l'argument table n'est pas renseign\u00e9") attempt::stop_if(schema, is.null, msg = "l'argument schema n'est pas renseign\u00e9") attempt::stop_if(db, is.null, msg = "l'argument db n'est pas renseign\u00e9") diff --git a/R/post_data.R b/R/post_data.R index e5af9f792ccaa905fca334ab8a0a01eeb437ed32..74971a958ec5d108928c5e260281aae2ff999351 100644 --- a/R/post_data.R +++ b/R/post_data.R @@ -105,7 +105,7 @@ poster_data <- function(data = NULL, schema = NULL, pk = NULL, post_row_name = FALSE, - db = "production", + db = "public", overwrite = FALSE, droits_schema = TRUE, user = "does", diff --git a/R/set_shema_rights.R b/R/set_shema_rights.R index a6bd57c4c6638d040455889a9c3e8a79b14967cd..c4b5e34f8bf0d6a6c5dbf6212d1c80a6a2cdaf62 100644 --- a/R/set_shema_rights.R +++ b/R/set_shema_rights.R @@ -20,10 +20,10 @@ #' #' @examples #' \dontrun{ -#' set_schema_rights(schema = "zonages_habitat", table = "opah_r52", db = "production", user = "does") +#' set_schema_rights(schema = "public", table = "opah_r52", db = "public", user = "does") #' } -set_schema_rights <- function(schema = "zonages_habitat", table = NULL, con = NULL, db = "production", user = "does", server = NULL) { +set_schema_rights <- function(schema = "public", table = NULL, con = NULL, db = "public", user = "does", server = NULL) { connexion <- con attempt::stop_if_all(c(connexion, db, user), is.null, msg = "con, db et user ne sont pas renseign\u00e9s, merci de fournir les arguments necessaires a la connexion (soit con, soit db + user). ") attempt::stop_if_all(c(connexion, db), is.null, msg = "con et db ne sont pas renseign\u00e9s, merci de fournir les arguments necessaires a la connexion (soit con, soit db + user). ") diff --git a/README.Rmd b/README.Rmd index ab3963b1fe9b40e1bad389a1f7bef7b115bf9479..8c8a7bb6d534ecf0cf4248da340615b4212da786 100644 --- a/README.Rmd +++ b/README.Rmd @@ -49,7 +49,7 @@ check_server_renviron() con sera utilisé ensuite sur l'ensemble des autres fonctions pour dialoguer avec le serveur de base de données. ```{r, eval=FALSE} -con <- connect_to_db(db="datamart", user="does") +con <- connect_to_db(db = "datamart", user = "does") ``` ### Lister les schémas @@ -60,7 +60,7 @@ list_schemas(con) ### Lister les tables d'un schéma -Ici on liste les table du schéma public +Ici on liste les table du schéma "public" ```{r, eval=FALSE} list_tables(con, "public") @@ -85,7 +85,7 @@ La fonction `poster_data()` se veut plus complète : Le schéma spécifié en argument est créé s'il n'existe pas. ```{r, eval=FALSE} -poster_data(data = iris, table = "test_iris", schema = "zonages_habitat", db = "production", user = "does", overwrite = TRUE) +poster_data(data = iris, table = "test_iris", schema = "public", db = "public", user = "does", overwrite = TRUE) ``` ### Télécharger une table @@ -106,7 +106,7 @@ de manière à retrouver le dataframe dans l'état précis où il était avant s ```{r, eval=FALSE} -db_iris <- importer_data(table = "test_iris", schema = "zonages_habitat", db = "production", user = "does", overwrite = TRUE) +db_iris <- importer_data(table = "test_iris", schema = "public", db = "public", user = "does", overwrite = TRUE) ``` ### Poster des métadonnées en commentaires @@ -115,7 +115,7 @@ On peut commenter les tables chargées sur le SGBD depuis RStudio : ```{r, eval=FALSE} commenter_table(comment = "Je suis un commentaire important sur la table test_iris.", table = "test_iris", - schema = "public", db = "production", user = "does") + schema = "public", db = "public", user = "does") ``` En dehors des informations spécifiées au niveau de l'argument _comment_, la fonction ajoute le nom de l'auteur et la date du commentaire. @@ -127,5 +127,5 @@ Ce dataframe peut comprendre autant de lignes que d'attributs que l'on souhaite ```{r, eval=FALSE} dico_iris <- data.frame(VAR = names(iris), VAR_LIB = paste("ceci est le libellé descriptif de", names(iris))) -post_dico_attr(dico = dico_iris, table = "test_iris", schema = "zonages_habitat", db = "production", user = "does") +post_dico_attr(dico = dico_iris, table = "test_iris", schema = "public", db = "public", user = "does") ``` diff --git a/README.md b/README.md index a9813e5e3272f2ce7c5eb3eed53daaf0e2b0bcb2..00e3691076e7e172c9e0defcaaf0d00fc5b69fc7 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ list_schemas(con) ### Lister les tables d’un schéma -Ici on liste les table du schéma public +Ici on liste les table du schéma "public" ``` r list_tables(con, "public") @@ -82,7 +82,7 @@ La fonction `poster_data()` se veut plus complète : Le schéma spécifié en argument est créé s’il n’existe pas. ``` r -poster_data(data = iris, table = "test_iris", schema = "zonages_habitat", db = "production", user = "does", overwrite = TRUE) +poster_data(data = iris, table = "test_iris", schema = "public", db = "production", user = "does", overwrite = TRUE) ``` ### Télécharger une table @@ -106,7 +106,7 @@ de manière à retrouver le dataframe dans l’état précis où il était avant son versement au SGBD. ``` r -db_iris <- importer_data(table = "test_iris", schema = "zonages_habitat", db = "production", user = "does", overwrite = TRUE) +db_iris <- importer_data(table = "test_iris", schema = "public", db = "production", user = "does", overwrite = TRUE) ``` ### Poster des métadonnées en commentaires @@ -135,5 +135,5 @@ d’attributs que l’on souhaite documenter. ``` r dico_iris <- data.frame(VAR = names(iris), VAR_LIB = paste("ceci est le libellé descriptif de", names(iris))) -post_dico_attr(dico = dico_iris, table = "test_iris", schema = "zonages_habitat", db = "production", user = "does") +post_dico_attr(dico = dico_iris, table = "test_iris", schema = "public", db = "production", user = "does") ``` diff --git a/dev_history.R b/dev_history.R index 40271117cd45ed4a7364d5facf8c9ef4aaaf129d..19d5f1fb34568f815e07b257e4590d853962be30 100644 --- a/dev_history.R +++ b/dev_history.R @@ -27,4 +27,5 @@ usethis::use_package("tibble") usethis::use_package("tidyr") attachment::att_amend_desc() devtools::document() +pkgdown::build_site() devtools::check() diff --git a/man/commenter_champs.Rd b/man/commenter_champs.Rd index cf1eac03145858f8f600adeab4a10b2530c9d953..6546b9e4d6c86975005d656762864812cf12ae8f 100644 --- a/man/commenter_champs.Rd +++ b/man/commenter_champs.Rd @@ -9,7 +9,7 @@ commenter_champs( var = NULL, table = NULL, schema = NULL, - db = "production", + db = "public", user = "does", server = NULL ) @@ -36,6 +36,6 @@ commenter_champs : ajouter (ou remplacer) un commentaire de champ d'une table da \dontrun{ commenter_champs(comment = "Je suis un commentaire ultra important sur la variable 'Species'.", var = "Species", table = "test_iris", - schema = "public", db = "production", user = "does") + schema = "public", db = "public", user = "does") } } diff --git a/man/commenter_schema.Rd b/man/commenter_schema.Rd index 54057cf5e7603868a162b5375034b8b4adfe0699..6e6a666a5cd9026b12e329a6c8d20bd6f78cb799 100644 --- a/man/commenter_schema.Rd +++ b/man/commenter_schema.Rd @@ -4,12 +4,7 @@ \alias{commenter_schema} \title{commenter_schema : ajouter (ou remplacer) un commentaire pour un schema du SGBD} \usage{ -commenter_schema( - comment = NULL, - schema = NULL, - db = "production", - user = "does" -) +commenter_schema(comment = NULL, schema = NULL, db = "public", user = "does") } \arguments{ \item{comment}{: le texte du commentaire a poster} diff --git a/man/commenter_table.Rd b/man/commenter_table.Rd index 2870ee17a1785fc4bbf6d672de77f52b6620340f..adcac988c512c66f848fd1795d8ea521c854a1ad 100644 --- a/man/commenter_table.Rd +++ b/man/commenter_table.Rd @@ -8,7 +8,7 @@ commenter_table( comment = NULL, table = NULL, schema = NULL, - db = "production", + db = "public", user = "does" ) } @@ -29,6 +29,6 @@ commenter_table : ajouter (ou remplacer) un commentaire de table dans le SGBD \examples{ \dontrun{ commenter_table(comment = "Je suis un commentaire important.", table = "test_iris", - schema = "public", db = "production", user = "does") + schema = "public", db = "public", user = "does") } } diff --git a/man/get_cols_comment.Rd b/man/get_cols_comment.Rd index b85777e37f41d4350ce6a6d19ecab6bde6fe523c..f3a570f64f34267de521ffa6c129d6f112527e3e 100644 --- a/man/get_cols_comment.Rd +++ b/man/get_cols_comment.Rd @@ -7,7 +7,7 @@ get_cols_comment( table = NULL, schema = NULL, - db = "production", + db = "public", user = "does", server = NULL ) diff --git a/man/get_table_comment.Rd b/man/get_table_comment.Rd index 098076dd6442aa36359a745b287a112bc2321e30..900c65dc0164e4abf54ee888a94fb7300d56001c 100644 --- a/man/get_table_comment.Rd +++ b/man/get_table_comment.Rd @@ -7,7 +7,7 @@ get_table_comment( table = NULL, schema = NULL, - db = "production", + db = "public", user = "does", server = NULL ) diff --git a/man/get_table_comments.Rd b/man/get_table_comments.Rd index e01be1a0a646748f8cbcd79568cfdf2120a5de75..601f9bec5c3d5cd9f8b60c15f3b961bab4bd53f3 100644 --- a/man/get_table_comments.Rd +++ b/man/get_table_comments.Rd @@ -7,7 +7,7 @@ get_table_comments( table = NULL, schema = NULL, - db = "production", + db = "public", user = "does", server = NULL ) diff --git a/man/importer_data.Rd b/man/importer_data.Rd index 1b2badc44cd3ff199b98f73bd7127f7054cc33b3..ef7776eb94a77d2924d05ce07a049f60928fcccf 100644 --- a/man/importer_data.Rd +++ b/man/importer_data.Rd @@ -10,7 +10,7 @@ importer_data( table = NULL, schema = NULL, - db = "production", + db = "public", server = NULL, user = "does" ) @@ -34,6 +34,6 @@ Import d'une table a partir du serveur de donnees, fonction qui s'adapte aux typ } \examples{ \dontrun{ -importer_data(table = "test_iris", schema = "zonages_habitat", db = "public", user = "does") +importer_data(table = "test_iris", schema = "public", db = "public", user = "does") } } diff --git a/man/post_dico_attr.Rd b/man/post_dico_attr.Rd index 2832995d8de7ac2a0d7c2efe2d287edc429d2164..2fab65f4fb8f628130ef9c7d9a6384e2cbb24e41 100644 --- a/man/post_dico_attr.Rd +++ b/man/post_dico_attr.Rd @@ -8,7 +8,7 @@ post_dico_attr( dico = NULL, table = NULL, schema = NULL, - db = "production", + db = "public", user = "does", server = NULL ) diff --git a/man/poster_data.Rd b/man/poster_data.Rd index 8c4582629f3ba2ada510d189130246ef5e2ed559..dffa050d9aac49471ecf27b056af8e1744c4250a 100644 --- a/man/poster_data.Rd +++ b/man/poster_data.Rd @@ -13,7 +13,7 @@ poster_data( schema = NULL, pk = NULL, post_row_name = FALSE, - db = "production", + db = "public", overwrite = FALSE, droits_schema = TRUE, user = "does", diff --git a/man/set_schema_rights.Rd b/man/set_schema_rights.Rd index 2e8b90e2c1f9f8e92111db7488cb248bd9fa6bea..f42f7b689d2744d49842794258285e72380986a4 100644 --- a/man/set_schema_rights.Rd +++ b/man/set_schema_rights.Rd @@ -5,10 +5,10 @@ \title{set_schema_rights() permet d'actualiser les privileges d'une ou de toutes les tables d'un schema a partir des privileges definis au niveau du schema} \usage{ set_schema_rights( - schema = "zonages_habitat", + schema = "public", table = NULL, con = NULL, - db = "production", + db = "public", user = "does", server = NULL ) @@ -31,6 +31,6 @@ set_schema_rights() permet d'actualiser les privileges d'une ou de toutes les ta } \examples{ \dontrun{ -set_schema_rights(schema = "zonages_habitat", table = "opah_r52", db = "production", user = "does") +set_schema_rights(schema = "public", table = "opah_r52", db = "public", user = "does") } } diff --git a/pkgdown/favicon/apple-touch-icon-120x120.png b/pkgdown/favicon/apple-touch-icon-120x120.png index 4176de13246520d19559c15fbac57ba94dcce29f..e57d291339eca54e2180382db49cd91c2209bc75 100644 Binary files a/pkgdown/favicon/apple-touch-icon-120x120.png and b/pkgdown/favicon/apple-touch-icon-120x120.png differ diff --git a/pkgdown/favicon/apple-touch-icon-152x152.png b/pkgdown/favicon/apple-touch-icon-152x152.png index e082b9e00df0661cc8a549a4a9f644774e01ae5b..25adcd5bf6a66407910da2c444478bfbc901cc4a 100644 Binary files a/pkgdown/favicon/apple-touch-icon-152x152.png and b/pkgdown/favicon/apple-touch-icon-152x152.png differ diff --git a/pkgdown/favicon/apple-touch-icon-180x180.png b/pkgdown/favicon/apple-touch-icon-180x180.png index cae8b7bd52a2e030886942d0191191b974bedcc3..68f05dd16eca6fb58062dff6b45c68576fb7a8e5 100644 Binary files a/pkgdown/favicon/apple-touch-icon-180x180.png and b/pkgdown/favicon/apple-touch-icon-180x180.png differ diff --git a/pkgdown/favicon/apple-touch-icon-60x60.png b/pkgdown/favicon/apple-touch-icon-60x60.png index 84e7cad00b4d9f403b57c9c0ba86956803efeaa6..a9ccd6916ad0dacade45a123b1b5617df920d32f 100644 Binary files a/pkgdown/favicon/apple-touch-icon-60x60.png and b/pkgdown/favicon/apple-touch-icon-60x60.png differ diff --git a/pkgdown/favicon/apple-touch-icon-76x76.png b/pkgdown/favicon/apple-touch-icon-76x76.png index 06a14dbd5a1d1b4306a2b970411b5ff5f1a2b442..44bf2fc4ac06e788bc63baf6dcd93164f9daab74 100644 Binary files a/pkgdown/favicon/apple-touch-icon-76x76.png and b/pkgdown/favicon/apple-touch-icon-76x76.png differ diff --git a/pkgdown/favicon/apple-touch-icon.png b/pkgdown/favicon/apple-touch-icon.png index df960e8309979edbe69f7755844e7730f52757e3..e8274f3ea16d8250b9045ccdaea948a5fc9cca23 100644 Binary files a/pkgdown/favicon/apple-touch-icon.png and b/pkgdown/favicon/apple-touch-icon.png differ diff --git a/pkgdown/favicon/favicon-16x16.png b/pkgdown/favicon/favicon-16x16.png index 84e1c414b9053408064f78a189826176221c45ee..e5c9428333a720cba8ac7ae65c11ce8d4be9616e 100644 Binary files a/pkgdown/favicon/favicon-16x16.png and b/pkgdown/favicon/favicon-16x16.png differ diff --git a/pkgdown/favicon/favicon-32x32.png b/pkgdown/favicon/favicon-32x32.png index fc6cb31ca77caee59bcaf71d3008c3bd5f6e9fe4..0910ddc523bec8de88e66c238ceed67aa4c1e689 100644 Binary files a/pkgdown/favicon/favicon-32x32.png and b/pkgdown/favicon/favicon-32x32.png differ