Reference

PersistedOperation

Package Trax.EffectNamespaces Trax.Effect.Models.PersistedOperation, Trax.Effect.Models.PersistedOperationHistorySource PersistedOperation.cs, PersistedOperationHistory.cs

A row of trax.persisted_operation, returned by IPersistedOperationStore reads. Both classes ship in Trax.Effect, as sets on its DataContext.

Properties

PropertyTypeColumnNotes
TenantKeystring?tenant_keyNull at the C# boundary. Stored as '' sentinel because the column participates in the composite primary key.
IdstringidBuild-time-stable id, e.g. userProfile_v1.
OperationNamestringoperation_nameOriginal GraphQL operation name (often differs from id by case).
VersionintversionOperator-set metadata, from UpsertOptions.Version (0 when not given). The id is opaque; nothing is parsed from it.
DocumentstringdocumentFull GraphQL document text.
ShapeFingerprintstringshape_fingerprintsha-256 hex of the canonicalized response shape.
IsActiveboolis_activeFalse indicates a soft-delete. Inactive rows do not serve requests.
DeprecationReasonstring?deprecation_reasonRequired when IsActive is false.
Descriptionstring?descriptionOperator-facing note.
CreatedAtDateTimecreated_atUTC.
UpdatedAtDateTimeupdated_atUTC.

PersistedOperationHistory properties

One row per change to a live row, in trax.persisted_operation_history.

PropertyTypeColumnNotes
HistoryIdlonghistory_idSurrogate key (bigserial).
TenantKeystring?tenant_keyMirrors the live row.
IdstringidMirrors the live row.
DocumentstringdocumentSnapshot at the time of the change.
ShapeFingerprintstringshape_fingerprintSnapshot at the time of the change.
ChangeTypestringchange_typeOne of Upsert, Deactivate, Restore.
ChangedAtDateTimechanged_atUTC.
ChangedReasonstring?changed_reasonRequired on deactivate.

Behavior

The table is created by Trax migration 035_persisted_operations.sql, which also creates trax.persisted_operation_history for audit and rollback. Both tables live in the trax schema alongside the rest of the Trax tables (metadata, manifest, log, etc.), and both are sets on the Effect DataContext (PersistedOperations, PersistedOperationHistories). There is no separate persisted-operations DbContext.

IPersistedOperationsService.GetHistoryAsync reads the history; it is the call behind the persistedOperationHistory management query.

Example

using Trax.Effect.Models.PersistedOperation;
 
static string Describe(PersistedOperation operation) =>
    operation.IsActive
        ? $"{operation.Id} ({operation.OperationName}) v{operation.Version}"
        : $"{operation.Id} deactivated: {operation.DeprecationReason}";
 
Console.WriteLine(Describe(new PersistedOperation { Id = "userProfile_v1", OperationName = "UserProfile" }));

See also