2
0

Add JSON/JSONB support

This commit is contained in:
Joseph Glanville
2015-09-04 05:51:57 +10:00
parent fee3679cb9
commit 0013733535
4 changed files with 85 additions and 1 deletions
+4
View File
@@ -799,6 +799,10 @@ func (c *Conn) sendPreparedQuery(ps *PreparedStatement, arguments ...interface{}
err = encodeTimestampArray(wbuf, arguments[i], TimestampTzOid)
case OidOid:
err = encodeOid(wbuf, arguments[i])
case JsonOid:
err = encodeJson(wbuf, arguments[i])
case JsonbOid:
err = encodeJson(wbuf, arguments[i])
default:
return SerializationError(fmt.Sprintf("Cannot encode %T into oid %v - %T must implement Encoder or be converted to a string", arg, oid, arg))
}