ihp-1.3.0: Haskell Web Framework
Safe HaskellNone
LanguageHaskell2010

IHP.DataSync.ChangeNotifications

Synopsis

Documentation

channelName :: TableWithRLS -> ByteString Source #

Returns the event name of the event that the pg notify trigger dispatches

data ChangeSet Source #

Constructors

InlineChangeSet 

Fields

ExternalChangeSet

When the patch fits into the 8000 bytes limit of pg_notify

Instances

Instances details
FromJSON ChangeSet Source # 
Instance details

Defined in IHP.DataSync.ChangeNotifications

ToJSON ChangeSet Source # 
Instance details

Defined in IHP.DataSync.ChangeNotifications

Show ChangeSet Source # 
Instance details

Defined in IHP.DataSync.ChangeNotifications

Eq ChangeSet Source #

The patch is over 8000 bytes, so we have stored it in the large_pg_notifications table

Instance details

Defined in IHP.DataSync.ChangeNotifications

createNotificationFunction :: TableWithRLS -> Query Source #

Returns the sql code to set up a database trigger. Mainly used by watchInsertOrUpdateTable.

retrieveChanges :: (?modelContext :: ModelContext) => ChangeSet -> IO [Change] Source #

The pg_notify function has a payload limit of 8000 bytes. When a record update is larger than the payload size we store the patch in the large_pg_notifications table and pass over the id to the patch.

This function retrieves the patch from the large_pg_notifications table, or directly returns the patch when it's less than 8000 bytes.