| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Core.Sql.Groups
Description
Groups SQL templates.
Synopsis
- groupsWindowSQL :: Text -> Text -> Int -> Maybe Text -> Query Text
- emptiedWindowSQL :: Text -> Text -> Int -> Maybe Text -> Query Text
- lockGroupsSQL :: Text -> Text -> Maybe Text -> Maybe Text -> [Text] -> Query Text
- refreshGroupsSQL :: Text -> Text -> [Text] -> Query Int64
- insertMissingGroupsSQL :: Text -> Text -> Int -> Maybe Text -> Maybe Text -> Query (Text, Bool)
Documentation
Source #groupsWindowSQL :: Text -> Text -> Int -> Maybe Text -> Query Text
At most limit groups keys past cursor, in the database's key order, unlocked.
Its last key is the caller's resume cursor.
Source #emptiedWindowSQL :: Text -> Text -> Int -> Maybe Text -> Query Text
At most limit keys past cursor the maintenance triggers emptied in place, in the
database's key order. Its last key is the caller's resume cursor.
Source #lockGroupsSQL :: Text -> Text -> Maybe Text -> Maybe Text -> [Text] -> Query Text
FOR UPDATE SKIP LOCKED over the window groupsWindowSQL returned plus the keys
emptiedWindowSQL returned, one ascending pass in the key order the maintenance
triggers use. Returns the keys this transaction holds.
Source #refreshGroupsSQL :: Text -> Text -> [Text] -> Query Int64
Recompute the groups table, scoped to the locked keys from lockGroupsSQL.
Returns the count of rows it rewrote. A separate statement whose snapshot post-dates the lock.
Source #insertMissingGroupsSQL :: Text -> Text -> Int -> Maybe Text -> Maybe Text -> Query (Text, Bool)
Insert summary rows for grouped jobs the triggers left without one, at most
limit keys per call in key order, bounded to the lower to upper key window its
caller locked. Returns each key it covered and whether the insert landed.