arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Sql.Archive

Description

Internal to the arbiter packages. Not covered by the PVP.

Completed-job archive SQL templates.

Synopsis

Documentation

archiveAckCte :: SchemaName -> TableName -> Text -> TextSource #

The archived CTE teeing rows from the named ack CTE into the archive, per-row on archive_for. archive_expires_at is precomputed. The fragment ends with a comma, so another CTE must follow it.

updateArchiveResultSQL :: SchemaName -> TableName -> Value -> Int64 -> Query ()Source #

Set a completed root job's stored result on its archive row. No-ops without an archive row.

updateArchiveResultsBatchSQL :: SchemaName -> TableName -> [Int64] -> [Value] -> Query ()Source #

updateArchiveResultSQL for several jobs in one statement.

purgeArchiveSQL :: SchemaName -> TableName -> Int -> Query ()Source #

Delete a bounded batch of archived jobs whose per-row archive_expires_at has passed.

listArchiveFilteredSQL :: SchemaName -> TableName -> Query () -> Text -> Int64 -> Int64 -> Query (Int64, UTCTime, JobRead (Stored payload), Maybe Value)Source #

List archived jobs under a dynamic WHERE.

countArchiveFilteredSQL :: SchemaName -> TableName -> Query () -> Query Int64Source #

Count archived jobs under a dynamic WHERE.

deleteArchiveJobsBatchSQL :: SchemaName -> TableName -> [Int64] -> Query ()Source #

Delete archived jobs by archive primary key.

reEnqueueFromArchiveSQL :: SchemaName -> TableName -> Int64 -> Maybe RowEdit -> Query (JobRead (Stored payload))Source #

Re-enqueue an archived job as a fresh standalone job, keeping the archive row. Carries enqueuedAgainCols and resets the other columns to their defaults. An edit replaces its columns.