serversession-backend-persistent-2.0.1: Storage backend for serversession using persistent and an RDBMS.
Safe HaskellNone
LanguageHaskell2010

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

Instances

Instances details
Eq (Key (PersistentSession sess)) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

Eq (Decomposed sess) => Eq (PersistentSession sess) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

Ord (Key (PersistentSession sess)) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

Ord (Decomposed sess) => Ord (PersistentSession sess) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

Read (Key (PersistentSession sess)) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

Show (Key (PersistentSession sess)) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

Show (Decomposed sess) => Show (PersistentSession sess) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

ToJSON (Key (PersistentSession sess)) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

(ToJSON (Decomposed sess), PersistFieldSql (Decomposed sess)) => ToJSON (Entity (PersistentSession sess)) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

ToJSON (Decomposed sess) => ToJSON (PersistentSession sess) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

FromJSON (Key (PersistentSession sess)) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

(FromJSON (Decomposed sess), PersistFieldSql (Decomposed sess)) => FromJSON (Entity (PersistentSession sess)) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

FromJSON (Decomposed sess) => FromJSON (PersistentSession sess) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

PathPiece (Key (PersistentSession sess)) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

PersistFieldSql (Key (PersistentSession sess)) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

Methods

sqlType :: Proxy (Key (PersistentSession sess)) -> SqlType #

PersistFieldSql (Decomposed sess) => PersistEntity (PersistentSession sess) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

Associated Types

type PersistEntityBackend (PersistentSession sess) #

data Key (PersistentSession sess) #

data EntityField (PersistentSession sess) :: Type -> Type #

data Unique (PersistentSession sess) #

PersistField (Key (PersistentSession sess)) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

data Unique (PersistentSession sess) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

data EntityField (PersistentSession sess) typ Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

newtype Key (PersistentSession sess) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

type PersistEntityBackend (PersistentSession sess) Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

data family EntityField record :: Type -> Type #

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

As of persistent-2.11.0.0, it's possible to use the OverloadedLabels language extension to refer to EntityField values polymorphically. See the documentation on SymbolToField for more information.

Instances

Instances details
SymbolToField sym rec typ => IsLabel sym (EntityField rec typ)

This instance delegates to SymbolToField to provide OverloadedLabels support to the EntityField type.

Since: persistent-2.11.0.0

Instance details

Defined in Database.Persist.Class.PersistEntity

Methods

fromLabel :: EntityField rec typ #

data EntityField (PersistentSession sess) typ Source # 
Instance details

Defined in Web.ServerSession.Backend.Persistent.Internal.Impl

serverSessionDefsBySessionMap :: [UnboundEntityDef] Source #

Simple version. Entity definitions needed to generate the SQL schema for SqlStorage. Example:

mkMigrate "migrateAll" serverSessionDefsBySessionMap

Note: Also import PersistentSessionBySessionMap in the same module.

mkServerSessionDefs :: forall sess. PersistEntity sess => Proxy sess -> Text -> [UnboundEntityDef] Source #

Entity definitions needed to generate the SQL schema for SqlStorage. Generate schema by specifying Haskell name in Text.

Example using SessionMap:

type PersistentSessionBySessionMap = PersistentSession SessionMap
mkMigrate "migrateAll" (mkServerSessionDefs (Proxy :: Proxy PersistentSessionBySessionMap) "PersistentSessionBySessionMap")

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

throwSS :: Storage (SqlStorage sess) => StorageException (SqlStorage sess) -> TransactionM (SqlStorage sess) a Source #

Specialization of throwIO for SqlStorage.