Skip to content

Commit 8d5af13

Browse files
committed
Improve haddock documentation
1 parent e5ed00a commit 8d5af13

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/Network/Wai/Session/PostgreSQL.hs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
{-# LANGUAGE FlexibleInstances #-}
22

3+
-- |
4+
-- Module: Network.Wai.Session.PostgreSQL
5+
-- Copyright: (C) 2015, Hans-Christian Esperer
6+
-- License: BSD3
7+
-- Maintainer: Hans-Christian Esperer <hc@hcesperer.org>
8+
-- Stability: experimental
9+
-- Portability: portable
10+
--
11+
-- Simple PostgreSQL backed wai-session backend. This module allows you to store
12+
-- session data of wai-sessions in a PostgreSQL database. Two tables are kept, one
13+
-- to store the session's metadata and one to store key,value pairs for each session.
14+
-- All keys and values are stored as bytea values in the postgresql database using
15+
-- haskell's cereal module to serialize and deserialize them.
16+
--
17+
-- Please note that the module does not let you configure the names of the database
18+
-- tables. It is recommended to use this module with its own database schema.
319
module Network.Wai.Session.PostgreSQL
4-
( clearSession
5-
, dbStore
20+
( dbStore
21+
, clearSession
622
, defaultSettings
723
, fromSimpleConnection
824
, purgeOldSessions
@@ -85,6 +101,10 @@ fromSimpleConnection connection = do
85101
mvar <- newMVar ()
86102
return $ SimpleConnection (mvar, connection)
87103

104+
-- |A simple PostgreSQL connection stored together with a mutex that
105+
-- prevents from running more than one postgresql transaction at
106+
-- the same time. It is recommended to use a connection pool
107+
-- instead for larger sites.
88108
newtype SimpleConnection = SimpleConnection (MVar (), Connection)
89109

90110
instance WithPostgreSQLConn SimpleConnection where

0 commit comments

Comments
 (0)