Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
LISTEN
/NOTIFY
with hasql
.
Synopsis
- newtype Identifier = Identifier ByteString
- listen :: Identifier -> Statement () ()
- unlisten :: Identifier -> Statement () ()
- unlistenAll :: Statement () ()
- escapeIdentifier :: Text -> Session Identifier
- data Notification = Notification {}
- await :: Session Notification
- poll :: Session (Maybe Notification)
- backendPid :: Session CPid
- data Notify = Notify {}
- notify :: Statement Notify ()
Listen
newtype Identifier Source #
A Postgres identifier.
Instances
Show Identifier Source # | |
Defined in Hasql.ListenNotify showsPrec :: Int -> Identifier -> ShowS # show :: Identifier -> String # showList :: [Identifier] -> ShowS # | |
Eq Identifier Source # | |
Defined in Hasql.ListenNotify (==) :: Identifier -> Identifier -> Bool # (/=) :: Identifier -> Identifier -> Bool # | |
Ord Identifier Source # | |
Defined in Hasql.ListenNotify compare :: Identifier -> Identifier -> Ordering # (<) :: Identifier -> Identifier -> Bool # (<=) :: Identifier -> Identifier -> Bool # (>) :: Identifier -> Identifier -> Bool # (>=) :: Identifier -> Identifier -> Bool # max :: Identifier -> Identifier -> Identifier # min :: Identifier -> Identifier -> Identifier # |
listen :: Identifier -> Statement () () Source #
Listen to a channel.
unlisten :: Identifier -> Statement () () Source #
Stop listening to a channel.
unlistenAll :: Statement () () Source #
Stop listening to all channels.
escapeIdentifier :: Text -> Session Identifier Source #
Escape a string as a Postgres identifier.
data Notification Source #
An incoming notification.
Instances
await :: Session Notification Source #
Get the next notification received from the server.
backendPid :: Session CPid Source #
Get the PID of the backend process handling this session. This can be used to filter out notifications that originate from this session.
Notify
An outgoing notification.
Instances
Generic Notify Source # | |
Show Notify Source # | |
Eq Notify Source # | |
type Rep Notify Source # | |
Defined in Hasql.ListenNotify type Rep Notify = D1 ('MetaData "Notify" "Hasql.ListenNotify" "hasql-listen-notify-0.1.0.1-9QQM5cfHmzE5QxjgAd2Msk" 'False) (C1 ('MetaCons "Notify" 'PrefixI 'True) (S1 ('MetaSel ('Just "channel") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "payload") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) |