Skip to contents

User-facing function to connect to the Bouncer cricket database. Use this connection to query data directly with SQL if needed.

Usage

connect_to_bouncer(path = NULL, read_only = FALSE)

Arguments

path

Character string specifying the database file path. If NULL, uses the default system data directory.

read_only

Logical. If TRUE, opens database in read-only mode. Default is FALSE.

Value

A DuckDB connection object. Remember to disconnect when done using disconnect_bouncer(conn).

Examples

if (FALSE) { # \dontrun{
# Connect to database
conn <- connect_to_bouncer()

# Query data
matches <- DBI::dbGetQuery(conn, "SELECT * FROM cricsheet.matches LIMIT 10")

# Always disconnect when done
disconnect_bouncer(conn)
} # }