read_query: Function to read from a database.

View source: R/sql_io.R

read_queryR Documentation

Function to read from a database.

Description

Function to read from a database.

Usage

read_query(query = NULL, drv, dbname, cred_file = NULL, ..., quiet = FALSE)

Arguments

query

A query string.

drv

A database driver.

cred_file

An .R file containing the necessary credentials to connect to a different databases (e.g. PostgreSQL). Can contain variables: user, host, port, password, dbname.

...

Arguments passed on to DBI::dbConnect().

quiet

Quiet function call?

Author(s)

Andreas Scharmueller, andschar@proton.me

Examples


# connection to database required
read_query(query = "SELECT * FROM schema.table LIMIT 1;",
           cred_file = cred.R)



andschar/andmisc documentation built on Jan. 19, 2025, 10:46 a.m.