For querying the file directly with SQL or dplyr. Most users want
read_nadia() instead; this is the way in when the file is larger than
memory or when a specific query beats loading everything.
Details
The caller owns the connection and must close it with
DBI::dbDisconnect(con, shutdown = TRUE).
Examples
if (requireNamespace("duckdb", quietly = TRUE)) {
data(nadia_dia)
f <- file.path(tempdir(), "query.nadia")
write_nadia(f, nadia_dia,
process_proteomics(nadia_dia, verbose = FALSE),
verbose = FALSE)
con <- nadia_connect(f)
DBI::dbGetQuery(con, "SELECT COUNT(*) AS n FROM proteins")
DBI::dbDisconnect(con, shutdown = TRUE)
unlink(f)
}