Repository navigation
Make the defaults of strict graphs explicit and their comparisons exact (#429) - #532
Merged
Merged
Conversation
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.
Follow-up for #429 before 4.3.0: strict graphs get explicit defaults and exact comparisons. Strict mode is unreleased, so this changes its semantics without breaking anything that was released.
added: 'throw'is now a value and the default ofupsertGraph(), for relations and root. It names what an unsetaddeddid before (theNotFoundErrorwith its hints), and a later entry can now narrow an earlier'*': { added: 'relate' }for one relation.insertGraph()keeps the default'insert'and accepts'throw'to stop inserting rows with ids.removedhas no default. Every relation that a strict graph contains, at any depth and also when given asnullor[], needs aremovedsetting from some entry. Otherwise the call throws aValidationErrorof typeInvalidGraphthat lists the relations, before anything is loaded or written. Relations inside rows marked#deleteor#unrelateare exempt, since they're ignored.BelongsToOneRelationare alwaysaddedrows. The special case that letcreateddecide whenaddedwasn't set is gone.kept: 'preserve'and the strict placement checks no longer use==, so'',' 'andfalsedon't equal0. Numbers match numeric strings ('1.50'and1.5), booleans match1/0, dates compare by time, Buffers by bytes and bigints exactly.