db_direct_insert: Function to connect and insert directly into a database.

View source: R/db_direct_insert.R

db_direct_insertR Documentation

Function to connect and insert directly into a database.

Description

db_direct_insert has been designed so a database can be connected to, data inserted, and then disconnected with a single function call.

Usage

db_direct_insert(file, database = NA, table, df, replace = FALSE)

Arguments

file

JSON file or string containing database connection details. For SQLite databases, use the database's file path. See db_connect for more information.

database

The name of the database within file to use to create a database connection to. If only one entry is in file, this argument is not needed and will be ignored if used.

table

Table in, or to be created in con.

df

Data frame to be inserted into con.

replace

Should the database table be replaced? Default is FALSE. Be cautious using this argument because it will drop the database table if it exists.

Value

Invisible.

Author(s)

Stuart K. Grange

See Also

db_connect, db_insert, db_direct_read


skgrange/databaser documentation built on April 21, 2024, 6:30 a.m.