Skip to content

Chore: change AfterCreate hook signature to expose a slice of model instead of a single model, so it fires once per batch, not per creation, in the bulk inserts#29

Merged
VoidClancy merged 1 commit into
masterfrom
codegen
Jul 9, 2026

Conversation

@VoidClancy

Copy link
Copy Markdown
Owner

1- change afterCreate signature from func(ctx, *Model) to func(ctx, []*Model) so single create wraps the result in a 1 element slice and CreateManyAndReturn passes the full results array, firing the hook once per batch instead of per-record

…nstead of a single model, so it fires once per batch, not per creation, in the bulk inserts

1- change afterCreate signature from func(ctx, *Model) to func(ctx, []*Model) so single create wraps the result in a 1-element slice and CreateManyAndReturn passes the full results array, firing the hook once per batch instead of per-record
@VoidClancy VoidClancy merged commit f601471 into master Jul 9, 2026
3 checks passed
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