serversession-backend-persistent-1.0: Storage backend for serversession using persistent and an RDBMS.

Safe HaskellNone
LanguageHaskell98

Web.ServerSession.Backend.Persistent.Internal.Impl

Description

Internal module exposing the guts of the package. Use at your own risk. No API stability guarantees apply.

Synopsis

Documentation

data PersistentSession sess Source

Entity corresponding to a Session.

We're bending persistent in ways it wasn't expected to. In particular, this entity is parametrized over the session type.

Constructors

PersistentSession 

Fields

persistentSessionKey :: !(SessionId sess)

Session ID, primary key.

persistentSessionAuthId :: !(Maybe ByteStringJ)

Value of "_ID" session key.

persistentSessionSession :: !(Decomposed sess)

Rest of the session data.

persistentSessionCreatedAt :: !UTCTime

When this session was created.

persistentSessionAccessedAt :: !UTCTime

When this session was last accessed.

Instances

Eq (Key (PersistentSession sess)) 
Eq (Decomposed sess) => Eq (PersistentSession sess) 
Ord (Key (PersistentSession sess)) 
Ord (Decomposed sess) => Ord (PersistentSession sess) 
Read (Key (PersistentSession sess)) 
Show (Key (PersistentSession sess)) 
Show (Decomposed sess) => Show (PersistentSession sess) 
ToJSON (Key (PersistentSession sess)) 
(ToJSON (Decomposed sess), PersistFieldSql (Decomposed sess)) => ToJSON (Entity (PersistentSession sess)) 
ToJSON (Decomposed sess) => ToJSON (PersistentSession sess) 
FromJSON (Key (PersistentSession sess)) 
(FromJSON (Decomposed sess), PersistFieldSql (Decomposed sess)) => FromJSON (Entity (PersistentSession sess)) 
FromJSON (Decomposed sess) => FromJSON (PersistentSession sess) 
PathPiece (Key (PersistentSession sess)) 
PersistFieldSql (Key (PersistentSession sess)) 
PersistFieldSql (Decomposed sess) => PersistEntity (PersistentSession sess) 
PersistField (Key (PersistentSession sess)) 
Typeable (* -> *) PersistentSession 
data Unique (PersistentSession sess) 
data EntityField (PersistentSession sess) where 
data Key (PersistentSession sess) = PersistentSessionKey' {} 
type PersistEntityBackend (PersistentSession sess) = SqlBackend 

data family EntityField record $a

An EntityField is parameterised by the Haskell record it belongs to and the additional type of that field

serverSessionDefs :: forall sess. PersistEntity (PersistentSession sess) => Proxy sess -> [EntityDef] Source

Entity definitions needed to generate the SQL schema for SqlStorage. Example using SessionMap:

serverSessionDefs (Proxy :: Proxy SessionMap)

psKey :: SessionId sess -> Key (PersistentSession sess) Source

Generate a key to the entity from the session ID.

newtype SqlStorage sess Source

SQL session storage backend using persistent.

Constructors

SqlStorage 

Fields

connPool :: ConnectionPool

Pool of DB connections. You may use the same pool as your application.

Instances