Sorry, I wrote this post from memory and missed some important details. I can't share a minimal reproducible example of the actual data, and can't seem to produce it with a toy sqlite db. My problem exists when using a fairly complicated SQL Server database.
There's isn't a problem running queries using just SQL, i.e initializing a con from the Connections tab, creating a file with "--preview conn=CON" at the top, pasting a query in there, and pressing "Preview". If I create an error - a leading comma after the last column in a SELECT statement, for example- the popup shows a helpful error similar to the one I'd get in a DBMS like dbeaver or Azure Data Studio.
DIAGNOSTIC_INFO Incorrect syntax near the keyword 'FROM'
The problem arises when I try to read in a query with R. For example:
df = DBI::dbGetQuery(con, statement = read_file("query.sql"))
The same leading comma throw an error but there's no error message.