git.iko.soy/typeable/postgresql-simple
on master help sign in
Documentation tweaks
1bda1d8Leon P Smith
CHANGES+18−18
@@ -1,4 +1,4 @@
1−Version 0.1:
1+Version 0.1: (2012-05-04)
2 * Renamed several modules, typeclasses, and functions:
2 * Renamed several modules, typeclasses, and functions:
3
3
4 QueryParams (renderParams) -> ToRow (toRow)
4 QueryParams (renderParams) -> ToRow (toRow)
@@ -6,19 +6,19 @@ Version 0.1:
6 Param (render) -> ToField (toField)
6 Param (render) -> ToField (toField)
7 Result (convert) -> FromField (fromField)
7 Result (convert) -> FromField (fromField)
8
8
9− * Added the Database.PostgreSQL.Simple.Ok module
9+ * Added the `Database.PostgreSQL.Simple.Ok` module, a variation of
10−
10+ `Either SomeException` that has an instance for `Alternative` and also
11+ uses a list of exceptions to track the ways it has failed.
12+
11 * Changed the return type of `fromField` and `fromRow` from
13 * Changed the return type of `fromField` and `fromRow` from
12− `Either SomeException` to `Ok`. Either doesn't have an instance for
14+ `Either SomeException` to `Ok`.
13− Alternative, and an orphaned instance inside of postgresql-simple is a
15+
14− very bad idea. Also, Ok returns a list of Exceptions so that you can
15− see all the ways it has failed.
16−
17− * Thanks to Ozgun Ataman, the "FromRow" typeclass has been massively
16+ * Thanks to suggestions from Ozgun Ataman, the `FromRow` typeclass has been
18− improved. The result is simpler definitions and better compositionality.
17+ massively improved. The result is simpler definitions and better
19− Also, user-defined instances need not be to be concerned about forcing
18+ compositionality. Also, user-defined instances need not be to be
20− the converted results, as
19+ concerned about forcing the converted results to WHNF. Here is an
21−
20+ example comparing the old to the new:
21+
22 instance (Result a, Result b) => QueryResults (a,b) where
22 instance (Result a, Result b) => QueryResults (a,b) where
23 convertResults [fa,fb] [va,vb] = do
23 convertResults [fa,fb] [va,vb] = do
24 !a <- convert fa va
24 !a <- convert fa va
@@ -29,14 +29,14 @@ Version 0.1:
29 instance (FromField a, FromField b) => FromRow (a,b) where
29 instance (FromField a, FromField b) => FromRow (a,b) where
30 fromRow = (,) <$> field <*> field
30 fromRow = (,) <$> field <*> field
31
31
32− * Added :., a pair that allows one to compose "FromRow" instances:
32+ * Added `(:.)`, a pair that allows one to compose `FromRow` instances:
33−
33+
34 instance (FromRow a, FromRow b) => FromRow (a :. b) where
34 instance (FromRow a, FromRow b) => FromRow (a :. b) where
35 fromRow = (:.) <$> fromRow <*> fromRow
35 fromRow = (:.) <$> fromRow <*> fromRow
36
36
37− * Moved the contents Field module into the "FromField" module.
37+ * Moved the contents `Field` module into the `FromField` module.
38
38
39 * Removed the `RawResult` type.
39 * Removed the `RawResult` type.
40
40
41− * Added `DefaultIsolationLevel` as a distinct `IsolationLevel` option and
41+ * Added `DefaultIsolationLevel` as a distinct `IsolationLevel` option
42− `DefaultReadWriteMode as a distinct `ReadWriteMode` option.
42+ and `DefaultReadWriteMode` as a distinct `ReadWriteMode`.
src/Database/PostgreSQL/Simple.hs+12−7
@@ -504,23 +504,28 @@ ellipsis bs
504-- | Of the four isolation levels defined by the SQL standard,
504-- | Of the four isolation levels defined by the SQL standard,
505-- these are the three levels distinguished by PostgreSQL as of version 9.0.
505-- these are the three levels distinguished by PostgreSQL as of version 9.0.
506-- See <http://www.postgresql.org/docs/9.1/static/transaction-iso.html>
506-- See <http://www.postgresql.org/docs/9.1/static/transaction-iso.html>
507−-- for more information.
507+-- for more information. Note that prior to PostgreSQL 9.0, 'RepeatableRead'
508+-- was equivalent to 'Serializable'.
508
509
509data IsolationLevel
510data IsolationLevel
510 = DefaultIsolationLevel -- ^ the isolation level will be taken from
511 = DefaultIsolationLevel -- ^ the isolation level will be taken from
511 -- PostgreSQL's per-connection
512 -- PostgreSQL's per-connection
512− -- @default_transaction_isolation@ variable.
513+ -- @default_transaction_isolation@ variable,
514+ -- which is initialized according to the
515+ -- server's config. The default configuration
516+ -- is 'ReadCommitted'.
513 | ReadCommitted
517 | ReadCommitted
514 | RepeatableRead
518 | RepeatableRead
515− | Serializable -- ^ Note that prior to PostgreSQL 9.0,
519+ | Serializable
516− -- @Serializable@ was equivalent to
517− -- @RepeatableRead@.
518 deriving (Show, Eq, Ord, Enum, Bounded)
520 deriving (Show, Eq, Ord, Enum, Bounded)
519
521
520data ReadWriteMode
522data ReadWriteMode
521− = DefaultReadWriteMode -- ^ the isolation level will be taken from the
523+ = DefaultReadWriteMode -- ^ the read-write mode will be taken from
522 -- PostgreSQL's per-connection
524 -- PostgreSQL's per-connection
523− -- @default_transaction_read_only@ variable.
525+ -- @default_transaction_read_only@ variable,
526+ -- which is initialized according to the
527+ -- server's config. The default configuration
528+ -- is 'ReadWrite'.
524 | ReadWrite
529 | ReadWrite
525 | ReadOnly
530 | ReadOnly
526 deriving (Show, Eq, Ord, Enum, Bounded)
531 deriving (Show, Eq, Ord, Enum, Bounded)