Skip to content

Feat: change Create Api to a less verbose one, utilizing funcs - #39

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

Feat: change Create Api to a less verbose one, utilizing funcs#39
VoidClancy merged 1 commit into
masterfrom
codegen

Conversation

@VoidClancy

Copy link
Copy Markdown
Owner

1- Define {model}CreateBuilder that houses a pointer to the createBuilder generic, define Set{Field}() per field on the creates, to avoid writing package.Field.Set() each time, now it's just a chained func after declaring the Create()

2-Keep the delegate's Create(assignments ...FieldAssignment) variadic to ensure backward compatibility with existing single-creation call sites, at least for now

3- change CreateMany/AndReturn() to accept builders, easy for grouping creates to be in batches or constructing slices with data by looping

4- Fix Sqlite dialect's SupportBulkInsert() to return true as,, what do u know, it supports bulk inserts.

5- Define CreateBuilder Alias on model packages for ease of use on constructing slices for createMany/AndReturn()

6- Adapt test files to the new api

1- Define {model}CreateBuilder that houses a pointer to the createBuilder generic, define Set{Field}() per field on the creates, to avoid writing package.Field.Set() each time, now it's just a chained func after declaring the Create()

2-Keep the delegate's Create(assignments ...FieldAssignment) variadic to ensure backward compatibility with existing single-creation call sites, at least for now

3- change CreateMany/AndReturn() to accept builders, easy for grouping creates to be in batches or constructing slices with data by looping

4- Fix Sqlite dialect's SupportBulkInsert() to return true as,, what do u know, it supports bulk inserts.

5- Define CreateBuilder Alias on model packages for ease of use on constructing slices for createMany/AndReturn()

6- Adapt test files to the new api
@VoidClancy VoidClancy self-assigned this Jul 13, 2026
@VoidClancy
VoidClancy merged commit b26210f into master Jul 13, 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