Closed mkrasmus closed 2 years ago
Should be an easy fix. Will queue it up.
Closing. The convention in project template is that path names are unquoted in the sql file The reason is that these are treaded as dcf files and not normal R connections.
@KentonWhite it might be helpful to change the error message to something like
Error: Could not connect to database:
unable to open database file ""database/philapd.db"".
The outer quotes would then come from the error message and the inner quotes from the dbname
configuration option if present. Also, we could make it more explicit in the documentation that all strings inside the file should be unquoted.
@Hugovdberg Think this might be a rabbit hole. I'm not sure but I think the errors are thrown by the dcf package and not ProjectTemplate. And the documentation is very clear that quotes are not used in the examples.
Report an Issue / Request a Feature
I'm submitting a (Check one with "x") :
Issue Severity Classification -
(Check one with "x") :
Expected Behavior
When following the guide to add a path to the philapd.db file I created in PhilaPD/database I expected the quoted string "database/philapd.db" to be a reasonable value for the dbname argument to locate the database, as this is the convention for most path-to-object scripts in R. Instead I needed to unquote the string to database/philapd.db.
Current Behavior
With the path in quotes the load.project() functions ends with:
Steps to Reproduce Behavior
Follow guide, create a folder called database and place the database file in there. Create the same sql file but with dbname as "database/philapd.db".
Version Information
R 3.6.2 R studio 1.2.5.034 ProjectTemplate 0.9
Possible Solution
If escape keys a required to unquote the quotes can a grepl assist for the sql reader function?