wvanbergen/node-vertica — pull request #18 by diwu1989 (2013-05-28 23:48:49+00:00)
Title: Allow custom decoders

Addresses this issue: #12

connections options can have a decoders hash.
such as
decoders =
boolean : (buffer) -> "this guy decodes boolean field buffer"
integer : (buffer) -> "this guy decodes integer field buffer"

Query passes the decoders to Query.Field, and Query.Field tries to find an appropriate decoder from the custom decoders first, otherwise falls back to the driver's own set of decoders.

This can be used easily to fix decoding behavior for 64bit or infinite precision numeric. The user will just have to substitute node-num or any other decoder to handle buffer deserialization.

query can have a decoders property that behaves in the same way. query specific decoders take precedence over the connection's decoders. See test custom_decoders_test to see usage.