db_is_shema_exist.R 501 B

123456789101112131415161718192021
  1. #' Does the schema exist
  2. #'
  3. #' Kontrollime kas andmebaasi schema eksisteerib.
  4. #' @param schema str A database schema name.
  5. #' @return TRUE/FALSE.
  6. #' @seealso [ruut::db_connect()], [ruut::get_config()], [ruut::db_all_schemas()]
  7. #' @keywords database, schema
  8. #' @export
  9. #' @examples
  10. #' ## Not run:
  11. #' ##
  12. #' ## db_is_shema_exist(schema = "public")
  13. #' ##
  14. #' ## End(**Not run**)
  15. db_is_shema_exist <- function(schema = NULL) {
  16. if (schema %in% ruut::db_all_schemas()) {
  17. TRUE
  18. } else {
  19. FALSE
  20. }
  21. }