send_query: Function to send to a database.

View source: R/sql_io.R

send_queryR Documentation

Function to send to a database.

Description

Function to send to a database.

Usage

send_query(
  query = NULL,
  drv,
  dbname,
  immediate = TRUE,
  cred_file = NULL,
  ...,
  quiet = FALSE
)

Arguments

query

A query string.

drv

A database driver.

dbname

Name of database.

immediate

TRUE Needed to send multiple statements in RPostgres::dbSendQuery(). Doesn't effect RPostgreSQL::dbSendQuery().

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.