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

dal-go / dalgo2sql / 38756694612
100%

Build:
DEFAULT BRANCH: main
Ran 15 Oct 2026 03:02PM UTC
Jobs 1
Files 33
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

15 Oct 2026 03:01PM UTC coverage: 100.0%. Remained the same
38756694612

push

github

web-flow
fix(sql): record keys are unique within a read; SQLite keys by catalog primary key (#226)

Record keys are unique within a read, on every read path.

- The constant `__dalgo_record_id` is no longer any record's key (it stays only as the internal helper column alias). Reads with no key configured are keyed by ordinal (row position from 0, decimal text), unique by construction.
- SQLite dialect, nothing declared: the reader asks `pragma_table_xinfo` for the primary key and keys by that column when it is exactly one INTEGER/TEXT column that cannot be NULL (NOT NULL or the rowid alias). No PK, composite, view, nullable/untyped PK, GROUP BY, aggregate, and joins: ordinal. Declared `Recordsets` / `PrimaryKey` still win. PostgreSQL behavior is unchanged apart from the constant becoming an ordinal.
- Invariant test: `unique_keys_test.go` is table-driven over providers and read paths (real SQLite: 412-row Invoice regression, composite/no-PK/view/quoted name/nullable and untyped PK/GROUP BY/aggregate/joins/declared key/recordset/legacy emitter; PostgreSQL via scripted catalog) and applies `dalgotest.AssertUniqueKeys` (dalgo v0.95.0).
- Doc comments in `reader_records.go` and `database_options.go` state the rule and what "no key" means.
- Known limit, documented: a join with a declared key (or PostgreSQL's catalog key) keys each record by the base row, so a one-to-many join repeats it. Existing tests pin that design.
- Behavior change for consumers: SQLite reads with no key declared send one extra catalog statement first. Ten existing tests that pinned the constant key or exact statement sequence were updated.

Coverage 100%; `go test ./...` and `end2end` pass.

Source commits:

- 71fe8a6ff7c6 fix(sql): record keys are unique within a read; SQLite keys by catalog primary key
- 56469293d2ad fix(sql): never key by a SQLite column that accepts NULL (INTEGER PRIMARY KEY DESC) or holds a BLOB

Pull request: dal-go/dalgo2sql#226
Review: https://github.com/dal-go/dalgo... (continued)

99 of 99 new or added lines in 2 files covered. (100.0%)

5813 of 5813 relevant lines covered (100.0%)

1.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 38756694612.1 15 Oct 2026 03:02PM UTC 33
100.0
GitHub Action Run
Source Files on build 38756694612
  • Tree
  • List 33
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 38397a24 on github
  • Prev Build on main (#38643494643)
  • Next Build on main (#39256853624)
  • Delete
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