Skip to contents

write_sql_files will copy and move the sql file based on the context parameter. The write_sql_file function copies a specified SQL file from a source folder to a target directory, determined by the context (shiny, sandbox, or project). Using the fs::file_copy function, it places the file in the appropriate path (e.g., in the inst/sql folder for shiny, sandbox/sql for sandbox, or the main sql directory otherwise). [Stable]

Usage

write_sql_file(file, folder, name, context)

Arguments

file

The name of the SQL file that you want to copy to a new location

folder

The name of the folder where the sql is stored

name

The name for the sql file you want to create. This is a string and must be provided in quotes (e.g., "your_filename.sql").

context

The context of your project. "project", "shiny", and "sandbox"