I don't really understand this. So you send SQL to the driver program, which uses the C API to talk to the database? That means for everything except SQLite it's Scheme -> Driver -> DB server -> Driver -> Scheme. Also, are you talking to the driver over a socket (TCP or local, doesn't matter) or over a pair of pipes? If the latter, you have to make sure that both sides flush frequently, or you will get deadlocks.
It would also be possible to run the standard CLI client for the database using a PTY. That solves the flushing problem, but you'd need to carefully pick an output format (or small set of formats) that all CLI clients can produce. that doesn't throw away header names or manifest typing information, and unambiguously indicates the end of the result set somehow.