Skip to content

Graphorin API reference v0.12.1


Graphorin API reference / @graphorin/store-sqlite / / SqliteConflictStore

Class: SqliteConflictStore

Defined in: packages/store-sqlite/src/conflict-store.ts:139

SQLite-backed conflict store. Constructed by SqliteMemoryStore; never instantiated directly by application code.

Stable

Constructors

Constructor

ts
new SqliteConflictStore(conn): SqliteConflictStore;

Defined in: packages/store-sqlite/src/conflict-store.ts:142

Parameters

ParameterType
connSqliteConnection

Returns

SqliteConflictStore

Methods

enqueuePending()

ts
enqueuePending(input): Promise<{
  id: number;
}>;

Defined in: packages/store-sqlite/src/conflict-store.ts:173

Enqueue a candidate fact + the conflicting fact ids for the deep phase.

Parameters

ParameterType
inputPendingConflictInput

Returns

Promise<{ id: number; }>


listPending()

ts
listPending(scope, limit?): Promise<readonly PendingConflictRow[]>;

Defined in: packages/store-sqlite/src/conflict-store.ts:198

List pending rows for the supplied user, oldest-first.

Parameters

ParameterTypeDefault value
scopeSessionScopeundefined
limitnumber50

Returns

Promise&lt;readonly PendingConflictRow[]&gt;


listRecentDecisions()

ts
listRecentDecisions(scope, limit?): Promise<readonly {
  candidateId: string;
  decision: string;
  detectedAt: number;
  detectedBy: string;
  detectionZone: string | null;
  existingId: string | null;
  id: number;
  reason: string | null;
  similarity: number | null;
  stage: string;
}[]>;

Defined in: packages/store-sqlite/src/conflict-store.ts:267

Read-back helper used by the audit-replay surface (Phase 14c) and the test suite - returns up to limit recent rows for the scope.

Parameters

ParameterTypeDefault value
scopeSessionScopeundefined
limitnumber50

Returns

Promise<readonly { candidateId: string; decision: string; detectedAt: number; detectedBy: string; detectionZone: string | null; existingId: string | null; id: number; reason: string | null; similarity: number | null; stage: string; }[]>

Stable


markAttempted()

ts
markAttempted(id, attemptedAt?): Promise<void>;

Defined in: packages/store-sqlite/src/conflict-store.ts:254

Stamp attempted_at on a pending row whose deep-phase judge call failed (MCON-9). The deep phase closes the row as 'judge-unparseable' on the NEXT failure, bounding how often a poisoned row can be re-billed.

Parameters

ParameterType
idnumber
attemptedAt?number

Returns

Promise&lt;void&gt;

Stable


markResolved()

ts
markResolved(id, decision): Promise<void>;

Defined in: packages/store-sqlite/src/conflict-store.ts:237

Mark a pending row resolved (used by the deep phase in Phase 10c).

Parameters

ParameterType
idnumber
decisionConflictPipelineDecision

Returns

Promise&lt;void&gt;


recordDecision()

ts
recordDecision(input): Promise<ConflictAuditRow>;

Defined in: packages/store-sqlite/src/conflict-store.ts:147

Record a single decision row. Returns the autogenerated id.

Parameters

ParameterType
inputConflictAuditInput

Returns

Promise&lt;ConflictAuditRow&gt;