git.iko.soy/typeable/postgresql-simple
on master help sign in
Documentation Fixes
commitd267c2e4eafecb0bd9c99c1ce281b6c690d619f5 authorLeon P Smith <leon@melding-monads.com> dateSat 21 Dec 2013, 18:32 (13 years ago) parent59943b2
2 files changed+13−3
CHANGES+3−3 src/Database/PostgreSQL/Simple/FromField.hs+10
CHANGES+3−3
@@ -3,16 +3,16 @@ Version 0.4.0.0 (2013-12-21)
33 a copy of the raw data. This should be a small but significant
44 performance bump for most people most of the time; however it
55 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.
77 See commit 8635f8 for more information.
88
99 * Added the PGArray type. Thanks to Joey Adams for the suggestion
1010
1111 * 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.
1313 Thanks to Amit Levy for the report.
1414
15− * Added FromField instances for IORefs, MVars, and IOArrays.
15+ * Added FromField instances for IORef, MVar, and IOVector.
1616
1717Version 0.3.10.0 (2013-12-17)
1818 * Added the queryWith function, courtesy of Leonid Onokhov
src/Database/PostgreSQL/Simple/FromField.hs+10
@@ -169,6 +169,16 @@ class FromField a where
169169 -- Returns a list of exceptions if the conversion fails. In the case of
170170 -- library instances, this will usually be a single 'ResultError', but
171171 -- 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.
172182
173183-- | Returns the data type name. This is the preferred way of identifying
174184-- types that do not have a stable type oid, such as types provided by