hey y'all, after seeing Mine's presentation at rstudio::conf about the {learner} package I decided to try and whip up some test content for teaching SQL. I can't figure out how to get an exercise block to work with SQL. Here's what I tried:
In the preamble I set up a connection called db
like so:
db <- DBI::dbConnect(
RPostgreSQL::PostgreSQL(),
dbname = "mydb",
port = 5439,
host = "mydb.yada.yada",
user = "userid",
password = "topsecretpassword"
)
then I test to make sure it is working by doing this:
```{sql sql_chunk1, connection=db}
select * from mytable;
```'
Ignore the trailing '
, I can't recall how to make the fences show right, I'll edit this later.
Anyhow, that block works and returns the expected records from mytable
when I start my tutorial. So that's cool. Right after that I try to set up an SQL exercise chunk like so:
```{sql sql_chunk, connection=db, exercise=TRUE}
```'
and that gives me an exercise code box, but no matter what I put in there, I get an "unexpected symbol" or just "unexpected" error:
Am I missing something trivial? I'm flummoxed!