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

joaoh82 / rust_sqlite / 25674197154
69%

Build:
DEFAULT BRANCH: main
Ran 11 May 2026 01:52PM UTC
Jobs 1
Files 61
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

11 May 2026 01:47PM UTC coverage: 68.857%. Remained the same
25674197154

push

github

web-flow
feat(sdk:go): Phase 11.11c — cross-pool sibling shape via path registry (SQLR-22) (#134)

* feat(sdk:go): Phase 11.11c — cross-pool sibling shape via path registry (SQLR-22)

Closes the last open item from Phase 11's SDK arc. Pre-11.11c the Go
SDK took a real engine `Connection::open` for every `sql.Open(…)`
call — which deadlocked against itself on `flock(LOCK_EX)` whenever
two `*sql.DB` instances pointed at the same file, or a single pool
grew past one connection. The C / Python / Node SDKs already had
sibling-handle shapes since Phase 11.8; Go was the holdout because
`database/sql`'s pool model expects `driver.Open` to be cheap +
idempotent and SQLRite's exclusive flock collided with that contract.

The fix: a process-level path registry in `sdk/go/sqlrite.go` keyed
by canonical absolute path (`filepath.Abs` + `filepath.Clean`). For
file-backed read-write opens:

1. First opener pays for a real `sqlrite_open` → handle stored as a
   hidden "primary" in the registry, refcount = 0.
2. Subsequent openers mint a sibling via the FFI's
   `sqlrite_connect_sibling(primary)` (shipped in 11.8). Each
   `*conn` owns its own sibling; refcount++.
3. Close: refcount--. When 0, the registry closes the primary and
   removes the entry.

Lock order: `c.mu` → `registryMu`, never the reverse. `newConn`
holds only `registryMu` (the `*conn` doesn't exist yet); `conn.Close`
takes `c.mu` first, then `registryMu`.

Scope (v0):
- `:memory:` opens bypass the registry — each is its own DB by
  design (matches SQLite).
- Read-only opens (`sqlrite.OpenReadOnly`) bypass too — they take
  a shared `flock(LOCK_SH)` that already coexists with other
  readers.
- Symlinks are NOT resolved; the key is lexical. Callers needing
  symlink-equality canonicalize via `os.EvalSymlinks`.

Tests (`sdk/go/sqlrite_test.go`):
- `TestTwoSqlOpenOnSameFileShareState` — two `*sql.DB`s on the
  same path see each other's writes immediately, bidirectional.
- `TestBeginConcurrentAcrossSqlOpenInstances... (continued)

11148 of 16190 relevant lines covered (68.86%)

1.24 hits per line

Jobs
ID Job ID Ran Files Coverage
1 25674197154.1 11 May 2026 01:52PM UTC 61
68.86
GitHub Action Run
Source Files on build 25674197154
  • Tree
  • List 61
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 786f3790 on github
  • Prev Build on main (#25672443658)
  • Next Build on main (#25685215370)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc