Skip to content

refactor(update pipeline & builders): standardize Update struct, hooks, and fluent builder chaining - #78

Merged
VoidClancy merged 2 commits into
masterfrom
validation
Jul 30, 2026
Merged

refactor(update pipeline & builders): standardize Update struct, hooks, and fluent builder chaining#78
VoidClancy merged 2 commits into
masterfrom
validation

Conversation

@VoidClancy

Copy link
Copy Markdown
Owner

1- Add {Model}Update struct with optional pointer fields and assignmentsToUpdate converter for type-safe validation

2- Refactor executeUpdate(), runUpdate(), executeUpdateMany(), and executeUpdateManyAndReturn() to parse assignments upfront into Update and pass cols/vals down to statement runners

3- Unify predicates into allWhere inside executeUpdate() to pass down as a single slice to extension hooks and statement execution

4- Update CreateBuilder and CreateManyAndReturnBuilder to store selects/omits on the builder struct directly and return self pointer on Select() and Omit(), removing unnecessary wrapper structs for 0-allocation method chaining

5- Add model-specific Select() and Omit() on CreateBuilder and CreateManyAndReturnBuilder for order-independent builder chaining

6- Move loadRelation and relation SQL compilers from builders_create.gotpl into relations_runtime.gotpl to modularize runtime relation helpers

…s, and fluent builder chaining

1- Add <Model>Update struct with optional pointer fields and assignmentsTo<Model>Update converter for type-safe validation

2- Refactor executeUpdate(), runUpdate(), executeUpdateMany(), and executeUpdateManyAndReturn() to parse assignments upfront into <Model>Update and pass cols/vals down to statement runners

3- Unify predicates into allWhere inside executeUpdate() to pass down as a single slice to extension hooks and statement execution

4- Update CreateBuilder and CreateManyAndReturnBuilder to store selects/omits on the builder struct directly and return self pointer on Select() and Omit(), removing unnecessary wrapper structs for 0-allocation method chaining

5- Add model-specific Select() and Omit() on <Model>CreateBuilder and <Model>CreateManyAndReturnBuilder for order-independent builder chaining

6- Move loadRelation and relation SQL compilers from builders_create.gotpl into relations_runtime.gotpl to modularize runtime relation helpers
@VoidClancy VoidClancy self-assigned this Jul 30, 2026
@VoidClancy
VoidClancy merged commit e576478 into master Jul 30, 2026
11 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