Thanks, it looks interesting for cases where I would want to mungle data after query. My use-case for this script is more something like: you already have SQL query files somewhere and want to export them quickly with single CGI script with nice REST API.