Skip to content

Refactor: parameterless Create(), Prisma numeric upserts & type-safe FieldAssignmentOf[M]#63

Merged
VoidClancy merged 3 commits into
masterfrom
remove-set-from-create-builders
Jul 23, 2026
Merged

Refactor: parameterless Create(), Prisma numeric upserts & type-safe FieldAssignmentOf[M]#63
VoidClancy merged 3 commits into
masterfrom
remove-set-from-create-builders

Conversation

@VoidClancy

Copy link
Copy Markdown
Owner

1- Refactor Create() to be parameterless across, returning the ModelcreateBuilder

2- Standardize atomic numeric upsert operators to match Prisma's, replace Add(), Sub(), Inc(), and Dec() with Increment(val T) and Decrement(val T) on numericFieldUpsert[T]

3- Introduce FieldAssignmentOf[M] struct to model-tag assignments generated by .Set(val) on field types (Field[M, T], StringField[M], etc.)

4- Define .Assignments(assignments ...FieldAssignmentOf[M]) on CreateBuilder to take a spread of model-specific assignments and enforce compile-time model isolation and prevent cross-model field assignment errors, allow bulk assignments in the style of the old API

5- Update all callsites and test suites to use the parameterless Create() builder and type-safe FieldAssignmentOf[M]

…FieldAssignmentOf[M]

- Refactor Create() to be parameterless across, returning the ModelcreateBuilder

- Standardize atomic numeric upsert operators to match Prisma's, replace Add(), Sub(), Inc(), and Dec() with Increment(val T) and Decrement(val T) on numericFieldUpsert[T]

- Introduce FieldAssignmentOf[M] struct to model-tag assignments generated by .Set(val) on field types (Field[M, T], StringField[M], etc.)

- Define .Assignments(assignments ...FieldAssignmentOf[M]) on CreateBuilder to take a spread of model-specific assignments and enforce compile-time model isolation and prevent cross-model field assignment errors, allow bulk assignments in the style of the old API

- Update all callsites and test suites to use the parameterless Create() builder and type-safe FieldAssignmentOf[M]
…) builder and type-safe FieldAssignmentOf[M]
@VoidClancy VoidClancy self-assigned this Jul 23, 2026
Repository owner deleted a comment from gitguardian Bot Jul 23, 2026
@VoidClancy
VoidClancy merged commit 2be49e0 into master Jul 23, 2026
7 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