Skip to content

Add ILongVersioned (long) support + widen revision column to bigint #136

@jeremydmiller

Description

@jeremydmiller

Background

Polecat already consumes JasperFx.IRevisioned (int) — revision column is int, reads via GetInt32. This issue adds support for the new JasperFx.ILongVersioned (long) so documents projected from a MultiStreamProjection (where Version is the global event sequence number, exceeding Int32) can track a 64-bit revision.

Depends on jasperfx#348 (adds JasperFx.ILongVersioned).

What to change

  1. IRevisioned (int) — no change. Already works.

  2. Add ILongVersioned (long) support. Decision D2 = widen the revision column to bigint always (matches Marten; IRevisioned docs downcast on read). Touch points:

    • src/Polecat/Storage/DocumentTable.cs:30AddColumn("version", "int")bigint. Add a non-destructive widening migration for existing int revision columns.
    • Reader paths currently use reader.GetInt32(0) (e.g. UpdateOperation.cs:111, DocumentProvider.cs, QuerySession.cs, InsertOperation.cs, UpsertOperation.cs, AdvancedSqlResultReader.cs, DeserializingSelector.cs). Read as Int64; assign to IRevisioned.Version via downcast to int, or to ILongVersioned.Version directly.
    • _expectedRevision is int (UpdateOperation.cs:17); add a long path for ILongVersioned.
    • DocumentMapping.UseNumericRevisions (:92,134) already gates the int path — extend to recognize ILongVersioned as well.
    • DocumentSessionBase store path (:282) and Insert/Update/Upsert operations: handle both interfaces.
  3. Docs: document IRevisioned (int) vs ILongVersioned (long), recommending ILongVersioned for MultiStreamProjection-derived documents where Version is the event sequence number.

Acceptance

  • Revision column is bigint; non-destructive widening migration from existing int columns
  • IRevisioned (int) continues to work (downcast on read)
  • ILongVersioned (long) supported end-to-end (store, concurrency check, read-back)
  • Tests cover an ILongVersioned doc with Version > Int32.MaxValue
  • Docs updated

Refs

Depends on: jasperfx#348 · Pillar: JasperFx/jasperfx#214

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions