Commit 088a1b8
committed
refactor(driver-sql): read the autonumber default from the contract, not a hardcoded fallback (#7263)
Execution half 3/3 of the route-3 ruling on #6555. `{0000}` is a declared
contract default now (`DEFAULT_AUTONUMBER_FORMAT` / `resolveAutonumberFormat`,
landed in `@objectstack/spec/data` by #7265), so this driver stops keeping its
own copy of it.
`initObjects` and the external-object registration path each spelled the same
four lines by hand — canonical `autonumberFormat`, then the `format` shorthand,
then `|| '{0000}'`. Both are now `resolveAutonumberFormat(field)`: one symbol
added to an import this file already had, no new dependency.
Behaviour-neutral by construction and by measurement. The resolver's precedence
and its non-empty-string test were taken from these very lines, so a
differential check over 484 field documents (both spellings x 22 value shapes)
returns the identical string in every case — `format: ''`,
`autonumberFormat: ''` and the non-string values included. All eight driver-sql
autonumber suites (64 tests) and the cross-side parity integration test stay
green unedited; the one test-file change is prose, re-pointing a comment at the
declared default while keeping true its note that the engine still emits a bare
counter until #7262.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TcsV4ES5JJjCZ9BLrfhTy81 parent 06be54e commit 088a1b8
3 files changed
Lines changed: 54 additions & 16 deletions
File tree
- .changeset
- packages/drivers/driver-sql/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
5353 | 5353 | | |
5354 | 5354 | | |
5355 | 5355 | | |
5356 | | - | |
5357 | | - | |
5358 | | - | |
5359 | | - | |
| 5356 | + | |
5360 | 5357 | | |
5361 | 5358 | | |
5362 | 5359 | | |
| |||
5433 | 5430 | | |
5434 | 5431 | | |
5435 | 5432 | | |
5436 | | - | |
5437 | | - | |
5438 | | - | |
5439 | | - | |
5440 | | - | |
5441 | | - | |
| 5433 | + | |
5442 | 5434 | | |
5443 | 5435 | | |
5444 | 5436 | | |
| |||
0 commit comments