lpsmith/postgresql-simple — Issue #2: Something like HDBC's SqlValue?
Author: pheaver
Created: 2012-01-07 21:14:33+00:00
State: open

The database queries in our application are not always static; the number and types of columns in the result of our select statements are often not known at compile time. So, sometimes I need to be able to check what the type of the result is, and in HDBC I would do that by pattern matching on a SqlValue.

So, it is useful for us to have a composite datatype like HDBC's SqlValue, and instance like this for it:

instance QueryResults [SqlValue]

We don't need an instance for Param or QueryParams because I can just use `render` to convert all my arguments to the `Action` type.

We wouldn't need the silly `toSql` and `fromSql` functions from HDBC, just the SqlValue and the QueryResults instance.

Does this seem reasonable? Would you accept a patch that provides this?