R/sqlFile.r

#' Returns the full path to the query or NULL if not found.
#' 
#' @param query the query to find.
#' @return path to the query file.
sqlFile <- function(query) {
	paths <- sqlPaths()
	for(p in paths) {
		f <- paste(p, '/', query, '.sql', sep='')
		if(file.exists(f)) {
			return(f)
		}
	}
	warning(paste(query, ' not found.', sep=''))
	invisible(NULL)
}

Try the sqlutils package in your browser

Any scripts or data that you put into this service are public.

sqlutils documentation built on May 1, 2019, 7:58 p.m.