Skip to contents

Enable row level security on a table

Usage

rls_enable(con, table)

rls_disable(con, table)

Arguments

con

a DBI database connection object. required. supports only postgres and redshift connections

table

(character) a table name. required

Value

a scalar numeric that specifies the number of rows affected by the statement, invisibly

Examples

if (FALSE) { # has_postgres()
library(DBI)
library(RPostgres)
con <- dbConnect(Postgres())
dbListTables(con)
dbWriteTable(con, "mtcars", mtcars, temporary = TRUE)
rls_enable(con, table = "mtcars")
rls_check_status(con, "mtcars")
rls_disable(con, table = "mtcars")
rls_check_status(con, "mtcars")
dbRemoveTable(con, "mtcars")
dbDisconnect(con)
}