Skip to content

feat(generator): generate one top-level row record per table - #49

Merged
omer-cengel merged 3 commits into
masterfrom
feature/shared-top-level-row-records
Sep 28, 2026
Merged

omer-cengel merged 3 commits into
masterfrom
feature/shared-top-level-row-records

Conversation

@omer-cengel

Copy link
Copy Markdown
Member

Summary

Repositories that return the complete row of the same table now share one generated record. Each <TableName>Row is generated once per package as a top-level public record in its own file. Before this change, every repository nested its own copy, so two repositories over the same schema returned unrelated AuthorsRow types.

Changes

  • Generate one <TableName>Row.java per table whose complete row any configured entry returns. It sits in java.package, imports only the JDK types of its components, and has the same name, components, component order, and Java types as the former nested record.
  • Repositories return that top-level record and keep their own private row mapper. Query-specific <QueryName>Result records stay nested.
  • Reject, before any file is written, two entries that return one row type of the same table from different columns, and row types of different tables that are equal ignoring case. Both are reported against the later entry with the existing Invalid query group prefix.
  • List row files in sqlcj-manifest.txt and delete a row file on regeneration once no entry returns that row.
  • Update the external sample, the release verification script, the README, and the configuration, query, and quickstart documentation for the top-level record and the new diagnostics.
  • Add generator and compiler tests covering the exact row file, two entries over one migration directory that return the same compiled AuthorsRow class, stale row deletion, and both cross-entry diagnostics.

Scope and non-goals

  • No change to SQL analysis, type mapping, the runtime, or configuration.
  • Row mappers stay in their repositories, and query-specific result records are not deduplicated.
  • An entry that never returns a table's complete row generates no row record for it and is not compared.

feat(generator): generate one top-level row record per table

Every repository of the package that returns the complete row of a table
now returns one top-level <TableName>Row record generated into its own
file, instead of nesting its own copy. Each repository keeps its row
mapper. Two entries that define a shared row from different columns, or
whose row types are equal ignoring case, fail before any output is
written. Row files are listed in the manifest and deleted once no entry
returns them.
@omer-cengel
omer-cengel merged commit d4b2da1 into master Sep 28, 2026
6 checks passed
@omer-cengel
omer-cengel deleted the feature/shared-top-level-row-records branch September 28, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant