contentHashOfconstno test imports itconst contentHashOf: (i: Readonly<IssueSpec>) => stringThe hash of what the code says of an issue; a change of anything of it changes the hash.
Keeps the records of the issues model in step with the issues in the code (commons data 0045-issues-model): each issue is a record by its scope and number with a hash of what the code says, so that a sync adds what is new, rewrites what changed, marks what the code no longer has as withdrawn (never deleting it) and brings back what returns. All of it is one transaction and is recorded in a ledger; where the records already match the code nothing is written.
contentHashOfconstno test imports itconst contentHashOf: (i: Readonly<IssueSpec>) => stringThe hash of what the code says of an issue; a change of anything of it changes the hash.
syncIssuesfunctionfunction syncIssues(driver: Driver, schema: LogicalSchema, dialect: Dialect, sets: readonly IssueSet[], options?: SyncOptions): Promise<Result<readonly SyncReport[], SyncError>>Brings the records of the issues of some scopes in step with the code.
| Parameter | What it is |
|---|---|
driver | the database |
schema | the logical schema that has the issues model |
dialect | how the engine writes SQL |
sets | the issues of each scope, as the code has them |
options | the naming, the schema, the clock |
Returns: what each scope's sync did, or why nothing changed
SyncErrortypeno test imports ittype SyncError = { readonly kind: "schema"; readonly errors: readonly RefError[] } | { readonly kind: "database"; readonly message: string };Why a sync changed nothing.
SyncOptionsinterfaceno test imports itinterface SyncOptionsWhat a sync is given besides the issues.
| Member | Type | What it is |
|---|---|---|
naming? | Naming | |
schema? | string | The schema the tables are in. |
now? | (() => string) | |
newId? | (() => string) | |
recordUnchanged? | boolean | Whether to record a run that found nothing to do; by default it writes nothing. |
SyncReportinterfaceno test imports itinterface SyncReportWhat one scope's sync did.
| Member | Type | What it is |
|---|---|---|
scope | string | |
outcome | "synced" | "unchanged" | |
inserted | number | |
updated | number | |
withdrawn | number | |
reopened | number | |
unchanged | number | |
sourceHash | string | A hash of the issues of the code. |