example_db_connect: Create an example in-memory database

View source: R/example.R

example_db_connectR Documentation

Create an example in-memory database

Description

This function creates a connection to an in-memory SQLite database, with the option to add a table to the database. This function is intended to facilitate examples, vignettes, and package tests.

Usage

example_db_connect(df = NULL)

Arguments

df

Optional data.frame to add to the database.

Value

connection from DBI::dbConnect()

Examples

con <- example_db_connect(mtcars)

x <- DBI::dbGetQuery(con, "SELECT * FROM mtcars;")

head(x)

DBI::dbDisconnect(con)

qryflow documentation built on Aug. 8, 2025, 7:39 p.m.