Class for writing json from SQL Queries. Supports query parameters.