feat: add update() for bulk attribute updates - #78
Merged
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Artmann
pushed a commit
that referenced
this pull request
Jul 17, 2026
🤖 I have created a release *beep* *boop* --- ## [5.6.0](v5.5.1...v5.6.0) (2026-07-17) ### Features * add update() for bulk attribute updates ([#78](#78)) ([f90df2e](f90df2e)), closes [#44](#44) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
update(attributes)instance method toBaseModelso multiple attributes can be updated in one call instead of assigning fields one by one and callingsave():Object.assign(this, attributes)+save(), so all timestamp stamping and upsert behavior stays in one place — behaviorally identical to manual assign-then-save.Partial<this>, matching the existingcreate(attributes: Partial<T>)convention; unknown keys and wrong value types are compile errors.fill()method: without a mass-assignment guard concept it would just beObject.assign, which users can already write.Changes
packages/esix/src/base-model.ts— newupdate()method aftersave(), with JSDoc.packages/esix/src/base-model.spec.ts— unit tests: existing-model update (merged$set, stampedupdatedAt, upsert) and no-id insert (createdAt,wasRecentlyCreated).packages/esix/src/integration-test.spec.ts— end-to-end test against the mock adapter.packages/website/docs/inserting-and-updating-models.md— "Updating multiple attributes" docs section.Testing
yarn lint,yarn typecheck,yarn testall green (238 tests, +3 new).Closes #44
🤖 Generated with Claude Code