Skip to content

Graphorin API reference v0.4.0


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

Class: SqliteConflictStore

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

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:136

Parameters

ParameterType
connSqliteConnection

Returns

SqliteConflictStore

Methods

enqueuePending()

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

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

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:192

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:246

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


markResolved()

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

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

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:141

Record a single decision row. Returns the autogenerated id.

Parameters

ParameterType
inputConflictAuditInput

Returns

Promise&lt;ConflictAuditRow&gt;