Safe Haskell | None |
---|
Synopsis
- channelName :: TableWithRLS -> ByteString
- data ChangeNotification
- data Change = Change {}
- data ChangeSet
- = InlineChangeSet { }
- | ExternalChangeSet { }
- createNotificationFunction :: TableWithRLS -> Query
- installTableChangeTriggers :: (?modelContext :: ModelContext) => TableWithRLS -> IO ()
- makeCachedInstallTableChangeTriggers :: (?modelContext :: ModelContext) => IO (TableWithRLS -> IO ())
- retrieveChanges :: (?modelContext :: ModelContext) => ChangeSet -> IO [Change]
Documentation
channelName :: TableWithRLS -> ByteString Source #
Returns the event name of the event that the pg notify trigger dispatches
data ChangeNotification Source #
Instances
FromJSON ChangeNotification Source # | |
Defined in IHP.DataSync.ChangeNotifications parseJSON :: Value -> Parser ChangeNotification # parseJSONList :: Value -> Parser [ChangeNotification] # | |
ToJSON ChangeNotification Source # | |
Defined in IHP.DataSync.ChangeNotifications toJSON :: ChangeNotification -> Value # toEncoding :: ChangeNotification -> Encoding # toJSONList :: [ChangeNotification] -> Value # toEncodingList :: [ChangeNotification] -> Encoding # omitField :: ChangeNotification -> Bool # | |
Show ChangeNotification Source # | |
Defined in IHP.DataSync.ChangeNotifications showsPrec :: Int -> ChangeNotification -> ShowS # show :: ChangeNotification -> String showList :: [ChangeNotification] -> ShowS # | |
Eq ChangeNotification Source # | |
Defined in IHP.DataSync.ChangeNotifications (==) :: ChangeNotification -> ChangeNotification -> Bool # (/=) :: ChangeNotification -> ChangeNotification -> Bool # |
InlineChangeSet | |
ExternalChangeSet | When the patch fits into the 8000 bytes limit of |
createNotificationFunction :: TableWithRLS -> Query Source #
Returns the sql code to set up a database trigger. Mainly used by watchInsertOrUpdateTable
.
installTableChangeTriggers :: (?modelContext :: ModelContext) => TableWithRLS -> IO () Source #
makeCachedInstallTableChangeTriggers :: (?modelContext :: ModelContext) => IO (TableWithRLS -> IO ()) Source #
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.