docs: fix spread order in defineRelationsPart Rule 1 example - #699
Open
rivaldorose wants to merge 1 commit into
Open
docs: fix spread order in defineRelationsPart Rule 1 example#699rivaldorose wants to merge 1 commit into
rivaldorose wants to merge 1 commit into
Conversation
The "Why it's important?" callout compares two spread orders, but both
sentences read `{ ...relations, ...part }`. The second one shows the
result of the opposite order, where the empty `posts: {}` placeholder
from `relations` overwrites the relations defined in `part`.
Change the second sentence to `{ ...part, ...relations }` so the two
examples actually differ, in the pg, mysql and sqlite versions.
Closes drizzle-team#629
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.
Closes #629
Problem
In the Rule 1 warning for
defineRelationsPart, the collapsed "Why it's important?" callout compares two spread orders — but both sentences say the same thing:The second block shows the outcome of the opposite order —
posts: {}, with the comment "posts relations information will be lost" — because the empty placeholder fromrelationsoverwrites whatpartdefined. As written, the reader can't see which order causes that.The code sample directly above already labels the orders correctly, so only the prose is wrong.
Change
Second sentence becomes
{ ...part, ...relations }. One line per dialect:src/content/docs/pg/relations.mdxsrc/content/docs/mysql/relations.mdxsrc/content/docs/sqlite/relations.mdxThe issue mentions one page; the same paragraph is duplicated across these three, so all three are updated.
cockroach,mssqlandsinglestoredon't contain this passage.Verification
pnpm test— 29/29 passingpnpm build(astro check && astro build) — clean, 769 pages{ ...relations, ...part }and one{ ...part, ...relations }, and the "correct order" sentence above is unchanged