db_connect: Create or Open the Database Connection

View source: R/utils.R View source: R/run_geelite.R

db_connectR Documentation

Create or Open the Database Connection

Description

Tries to connect to an SQLite database using dbConnect(). If the initial connection fails, it retries up to max_retries times, waiting wait_time seconds between each attempt. If the connection cannot be established after the maximum retries, the function stops and throws an error.

Usage

db_connect(db_path, max_retries = 3, wait_time = 5)

db_connect(db_path, max_retries = 3, wait_time = 5)

Arguments

db_path

[mandatory] (character) A string specifying the file path to the SQLite database.

max_retries

[mandatory] (integer) The maximum number of retries if the connection fails (default: 3).

wait_time

[mandatory] (numeric) The number of seconds to wait between retries (default: 5).

Value

A database connection object if the connection is successful.


geeLite documentation built on Aug. 9, 2025, 1:08 a.m.