clojure.contrib.sql expects *err* to be a PrintWriter
The problem is that c.c.sql.internal calls `.println` on a "stream" to print update counts and errors. That method only exists on a `PrintWriter`. This isn't true within Slime, where it's a `StringWriter`.
The attached patch binds `*out*` and uses `println` instead, which does the right thing. I've augmented the docstrings to request a `Writer` as the value of `stream`, which aligns with the docstring for `print`.
The attached patch binds `*out*` and uses `println` instead, which does the right thing. I've augmented the docstrings to request a `Writer` as the value of `stream`, which aligns with the docstring for `print`.
Leave a comment
file:btl6lW9Mmr3OPceJe5aVNr: Diff against current head.
Following the discussion in the developer group and as suggested by Stuart Halloway, I'm planning to make these changes:
[1] adopt the substance of Richard Newman's patch, changes to sql.internal's print-sql-exception, print-sql-exception-chain, print-update-counts functions
[2] remove the automatic printing to err on exceptions. It will be up to the caller to handle the exceptions as he desires: eating, logging, or printing, etc.
[3] move the print* functions to c.c.sql proper as they will now be "public".
[1] adopt the substance of Richard Newman's patch, changes to sql.internal's print-sql-exception, print-sql-exception-chain, print-update-counts functions
[2] remove the automatic printing to err on exceptions. It will be up to the caller to handle the exceptions as he desires: eating, logging, or printing, etc.
[3] move the print* functions to c.c.sql proper as they will now be "public".