git.iko.soy/typeable/postgresql-simple
on master help sign in
Documentation Fixes
d267c2eLeon P Smith
CHANGES+3−3
@@ -3,16 +3,16 @@ Version 0.4.0.0 (2013-12-21)
3 a copy of the raw data. This should be a small but significant
3 a copy of the raw data. This should be a small but significant
4 performance bump for most people most of the time; however it
4 performance bump for most people most of the time; however it
5 may slow down retrieval of large values not converted directly
5 may slow down retrieval of large values not converted directly
6− to ByteString, such as json, hstore, and array values.
6+ to ByteString, such as large json, hstore, and array values.
7 See commit 8635f8 for more information.
7 See commit 8635f8 for more information.
8
8
9 * Added the PGArray type. Thanks to Joey Adams for the suggestion
9 * Added the PGArray type. Thanks to Joey Adams for the suggestion
10
10
11 * Fixed JSON decoding, which was almost entirely broken up until now,
11 * Fixed JSON decoding, which was almost entirely broken up until now,
12− due to bugs in the version of aeson currently available on Hackage.
12+ due to bugs in the version of aeson currently available on Hackage.
13 Thanks to Amit Levy for the report.
13 Thanks to Amit Levy for the report.
14
14
15− * Added FromField instances for IORefs, MVars, and IOArrays.
15+ * Added FromField instances for IORef, MVar, and IOVector.
16
16
17Version 0.3.10.0 (2013-12-17)
17Version 0.3.10.0 (2013-12-17)
18 * Added the queryWith function, courtesy of Leonid Onokhov
18 * Added the queryWith function, courtesy of Leonid Onokhov
src/Database/PostgreSQL/Simple/FromField.hs+10
@@ -169,6 +169,16 @@ class FromField a where
169 -- Returns a list of exceptions if the conversion fails. In the case of
169 -- Returns a list of exceptions if the conversion fails. In the case of
170 -- library instances, this will usually be a single 'ResultError', but
170 -- library instances, this will usually be a single 'ResultError', but
171 -- may be a 'UnicodeException'.
171 -- may be a 'UnicodeException'.
172+ --
173+ -- Note that retaining any reference to the 'Field' argument causes
174+ -- the entire @LibPQ.'PQ.Result'@ to be retained. Thus, implementations
175+ -- of 'fromField' should return results that do not refer to this value
176+ -- after the result have been evaluated to WHNF.
177+ --
178+ -- Note that as of @postgresql-simple-0.4.0.0@, the 'ByteString' value
179+ -- has already been copied out of the @LibPQ.'PQ.Result'@ before it has
180+ -- been passed to 'fromField'. This is because for short strings, it's
181+ -- cheaper to copy the string than to set up a finalizer.
172
182
173-- | Returns the data type name. This is the preferred way of identifying
183-- | Returns the data type name. This is the preferred way of identifying
174-- types that do not have a stable type oid, such as types provided by
184-- types that do not have a stable type oid, such as types provided by