Skip to content

app: AddMany, a list of the entity's AddRequest in and its rows out - #3

Merged
lesomnus merged 2 commits into
mainfrom
add-many
Oct 17, 2026
Merged

lesomnus merged 2 commits into
mainfrom
add-many

Conversation

@lesomnus

Copy link
Copy Markdown
Member

protobuf-orm's add.many asks for AddMany beside an entity's Add (protobuf-orm/protobuf-orm#3). This writes it into the contract:

rpc AddMany(UserAddManyRequest) returns (UserAddManyResponse);

message UserAddManyRequest { repeated UserAddRequest items = 1; }
message UserAddManyResponse { repeated User items = 1; }
  • Each item is the entity's own AddRequest, not a message of its own. So an item is an Add's request field for field, and whatever reads one reads the other: a layer's rule about what an Add may write is also a rule about every item.
  • The rows come back in the order of the items.
  • The comment on the RPC states the most items one call carries. The option sets it, and it is 1000 when the option does not.
  • AddMany appears only where the entity asked for it. crud alone gives no AddMany. The user fixture asks for it, with a max of 200, and the README has a section on it.

Before merge

Tests

  • TestRpcAddMany: the user contract has AddMany, its two messages and its comment.
  • TestRpcAddManyIsAskedFor: no other fixture has one, though every one of them has an Add.
  • Locally: buf generate twice (nothing moved but this change), gofmt, go vet ./..., go test ./....

🤖 Generated with Claude Code

https://claude.ai/code/session_01KxtnpRW533bdErnW8QPhsk

protobuf-orm's `add.many` asks for AddMany beside an entity's Add
(protobuf-orm/protobuf-orm#3), and this writes it into the contract:

	rpc AddMany(UserAddManyRequest) returns (UserAddManyResponse);

	message UserAddManyRequest { repeated UserAddRequest items = 1; }
	message UserAddManyResponse { repeated User items = 1; }

An item is the entity's own AddRequest rather than a message of its
own, so that an item is an Add's request field for field and whatever
reads the one reads the other -- a layer's rule about what an Add may
write is a rule about every item. The rows come back in the order of
the items. The comment on the RPC says the most one call carries,
which the option sets and is 1000 when it does not.

Only where the entity asked: `crud` alone is no AddMany. The user
fixture asks, with a max of 200.

- The user contract has AddMany, its two messages and its comment.
- No other fixture has one, though every one of them has an Add.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KxtnpRW533bdErnW8QPhsk
protobuf-orm/protobuf-orm#3 is merged, and buf.build/orm/orm carries
`rpc.add.many` from that merge. The fixture that asks for an AddMany
compiles against the registry's module now, so the generation CI runs
is the one that was done here against the checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KxtnpRW533bdErnW8QPhsk
@lesomnus
lesomnus merged commit 5234846 into main Oct 17, 2026
1 check passed
@lesomnus
lesomnus deleted the add-many branch October 17, 2026 21:55
lesomnus added a commit to protobuf-orm/protoc-gen-orm-ent that referenced this pull request Oct 17, 2026
…bd3c068

protobuf-orm/protobuf-orm#3 (3430237), protobuf-orm/protoc-gen-orm-service#3
(5234846) and protobuf-orm/ent#11 (5460d90) are merged, and
buf.build/orm/orm carries `rpc.add.many`. The fixtures that ask for an
AddMany compile against the registry's module now; nothing generated
moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KxtnpRW533bdErnW8QPhsk
lesomnus added a commit to lesomnus/payday that referenced this pull request Oct 17, 2026
…: orm 6bd3c068

protobuf-orm/protobuf-orm#3 (3430237), protobuf-orm/ent#11 (5460d90),
protobuf-orm/protoc-gen-orm-service#3 (5234846) and
protobuf-orm/protoc-gen-orm-ent#11 (3d29dad) are merged, and
buf.build/orm/orm carries `rpc.add.many` (6bd3c068). So the apptest's
schema compiles against the registry's module, and what was generated
against the checkout is what `pd gen --check` finds: nothing moved but
the ent runtime's version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KxtnpRW533bdErnW8QPhsk
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