Skip to contents

This function provides a consistent way to connect to the DuckDB database used by the RB3 package. It returns an existing connection if one is already established and valid, or creates a new connection if needed.

Usage

rb3_db_connection()

Value

A DuckDB connection object

Details

The function first checks if a valid connection already exists in the package registry. If not, it establishes a new connection to a DuckDB database located in the configured database folder and stores this connection in the package registry.

Examples

# Get a connection to the RB3 database
con <- rb3_db_connection()