R/count_n_users.R

Defines functions count_n_users

Documented in count_n_users

#' count_n_users
#'
#' @param conn the database connection
#' @param account_uid the account uid
#'
#' @return the number of users invited to the account
#'
#' @export
#'
#' @importFrom pool dbGetQuery
#'
count_n_users <- function(conn, account_uid) {

  pool::dbGetQuery(
    conn,
    "SELECT COUNT(uid) FROM public.users WHERE created_by=$1",
    params = list(
      account_uid
    )
  )$count
}
Tychobra/polishedapi documentation built on July 19, 2020, 11:41 p.m.