Skip to contents

Connect to the Open Justice Oklahoma database

Usage

ojo_connect(
  ...,
  .admin = FALSE,
  .driver = "RPostgres",
  .global = lifecycle::deprecated(),
  .env = ojo_env(),
  .pool = FALSE
)

Arguments

...

Placeholder.

.admin

A logical value indicating whether to connect to the database as an administrator.

.driver

The driver to use for the connection. Default is "RPostgres". "duckdb" is also supported.

.global

Deprecated. A connection will always be created in the specified environment, or in the package environment by default.

.env

The environment in which you want the connection stored.

.pool

A logical value indicating whether to use a connection pool from the {pool} package, or not.

Value

A database connection object created with RPostgres::Postgres() and either pool::dbPool or DBI::dbConnect

Details

Opens a connection to the Open Justice Oklahoma database using credentials stored in the .Renviron file. If no credentials exist, prompts for user, password, and host name and provides instructions to store them for future sessions.

Side Effects

A connection object (named ojo_con or ojo_pool depending on the .pool argument) is created in the package environment.

See also

ojo_auth()

Examples

if (FALSE) { # \dontrun{
ojo_connect()
} # }