Title: | Execute 'SQL' Scripts in 'R' Containing Multiple Queries |
---|---|
Description: | The nature of working with structured query language ('SQL') scripts efficiently often requires the creation of temporary tables and there are few clean and simple 'R' 'SQL' execution approaches that allow you to complete this kind of work with the 'R' environment. This package seeks to give 'SQL' implementations in 'R' a little love by deploying functions that allow you to deploy complex 'SQL' scripts within a typical 'R' workflow. |
Authors: | Kerns Sam [aut, cre] |
Maintainer: | Kerns Sam <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.4 |
Built: | 2024-11-07 03:26:32 UTC |
Source: | https://github.com/samkerns/sqlove |
Requires a DBI workflow that creates a connection with a relational database per DBI: https://dbi.r-dbi.org/. This function is an extension of the DBI::dbGetQuery and RJDBC::dbSendUpdate functions.
dbGetMultiQuery(connection, sql_file_path, pattern = NULL, replacement = NULL)
dbGetMultiQuery(connection, sql_file_path, pattern = NULL, replacement = NULL)
connection |
A database connection object |
sql_file_path |
Character vector pointing to SQL script |
pattern |
A character object you would like to substitute in the SQL script - this is not required and defaults to NULL. Calls gsub under the hood, so use regex for pattern identification |
replacement |
A character vector replacing the pattern specified - this is not required and defaults to NULL. Calls gsub under the hood, so use regex for pattern identification |
A data object
Requires a DBI workflow that creates a connection with a relational database per DBI: https://dbi.r-dbi.org/. This function is an extension of the RJDBC::dbSendUpdate function.
dbSendMultiUpdate(connection, sql_file_path)
dbSendMultiUpdate(connection, sql_file_path)
connection |
A database connection object |
sql_file_path |
Character vector pointing to SQL script |
No object returned - for production automation