• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dal-go / dalgo / 32634003152
100%

Build:
DEFAULT BRANCH: main
Ran 23 Aug 2026 10:33AM UTC
Jobs 1
Files 126
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Aug 2026 10:31AM UTC coverage: 99.962% (-0.004%) from 99.966%
32634003152

push

github

web-flow
feat(dalgo2memory): add opt-in optimistic-concurrency transactions (#114)

RunReadwriteTransaction serializes every read-write transaction behind one
whole-database lock, so two transactions can never actually contend. That
makes a test like "two concurrent claims of a unique slug, exactly one wins"
pass trivially, proving nothing about a database (Firestore, say) whose
transactions really do contend — production code such as
sneat-co/bookius's facade4bookius/booking.go relies on exactly that
guarantee via Get-then-Insert inside a transaction.

WithOptimisticConcurrency() opts a database into a mode where transactions
run concurrently instead: each buffers the keys it reads and the writes it
makes locally, touching no shared storage until it commits, and fails with
the new ErrTransactionConflict (test via IsTransactionConflict) if another
transaction committed a write to a key this one read or wrote in the
meantime. Buffering rather than writing through immediately is what lets the
losing side of a race get the conflict error specifically instead of some
other error that depends on write ordering.

dal and record (and dalgo2mysql/dalgo2sql/dalgo2postgres/dalgo2sqlite) were
checked first for an existing conflict/retryable/aborted error or predicate
to reuse; none exists, so this adds one following the package's own
ErrReadAfterWriteInTransaction / record.ErrRecordNotFound+IsNotFound idiom.

The default (no option) is untouched: every existing test still exercises
the same whole-database-lock path as before. Kept out of dalgotest's shared
conformance suite deliberately — that suite proves record-validation
invariants every adapter can be held to uniformly, and optimistic-concurrency
contention isn't such a capability (a real backend already has its own).

Deterministic interleaving for the required read-write-conflict test needs
no dedicated hook: a transaction callback can already block on a channel
without holding any lock, so an ordinary channel give... (continued)

283 of 283 new or added lines in 3 files covered. (100.0%)

7800 of 7803 relevant lines covered (99.96%)

1.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 32634003152.1 23 Aug 2026 10:33AM UTC 126
99.96
GitHub Action Run
Source Files on build 32634003152
  • Tree
  • List 126
  • Changed 123
  • Source Changed 0
  • Coverage Changed 123
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 9444cb2f on github
  • Prev Build on main (#32414514168)
  • Next Build on main (#32635406319)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc