Simplify: batch M2O, deduplicate formatting, clean dead code

Code reuse:
- formatRecordsForWeb() consolidates 4-call formatting sequence
  (was duplicated in handleWebSearchRead + handleWebRead)
- ToRecordID() public alias for cross-package ID extraction

Performance:
- M2O NameGet now batched: collect all FK IDs per field, single
  NameGet per comodel instead of per-record (N+1 → 1)

Quality:
- normalizeNullFields: 30-line switch (all returning false) → 5 lines
- domain.go: remove unused _ = subParams assignment
- Net -14 lines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marc
2026-04-03 01:24:13 +02:00
parent 24dee3704a
commit 70320b6b29
3 changed files with 66 additions and 80 deletions

View File

@@ -198,11 +198,10 @@ func (dc *DomainCompiler) compileNodes(domain Domain, pos int) (string, error) {
case domainGroup:
// domainGroup wraps a sub-domain as a single node.
// Compile it recursively as a full domain.
subSQL, subParams, err := dc.compileDomainGroup(Domain(n))
subSQL, _, err := dc.compileDomainGroup(Domain(n))
if err != nil {
return "", err
}
_ = subParams // params already appended inside compileDomainGroup
return subSQL, nil
}