Learn R Programming

geeLite (version 1.0.2)

db_connect: 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)

Value

A database connection object if the connection is successful.

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).