GeoLeaf Core API - v3.0.0
    Preparing search index...

    Public API of the features store.

    interface FeaturesDBInstance {
        put(record: FeatureRecord): Promise<void>;
        get(layerId: string, localId: string): Promise<FeatureRecord | null>;
        listByLayer(layerId: string): Promise<FeatureRecord[]>;
        listByState(state: string): Promise<FeatureRecord[]>;
        countByLayer(layerId: string): Promise<number>;
        remove(layerId: string, localId: string): Promise<void>;
        putManyPreservingLocal(
            records: readonly FeatureRecord[],
        ): Promise<PreservingPutTally>;
    }
    Index

    Methods

    • Writes a pulled batch in ONE transaction, skipping every record that holds unsynchronised local work.

      🛑 The rule lives here, and not in the caller, because get and put above open SEPARATE transactions: reading the state in the orchestrator and writing after it would leave a window in which the optimistic write of task 4.4 lands between the two — and property 1 of the sync contract ("a capture never silently disappears") would hold only by timing.

      A record is skipped when it already exists with syncState !== "synced". Everything else is inserted or refreshed.

      Parameters

      Returns Promise<PreservingPutTally>