Skip to content

docs: fix spread order in defineRelationsPart Rule 1 example - #699

Open
rivaldorose wants to merge 1 commit into
drizzle-team:mainfrom
rivaldorose:docs/fix-relations-part-spread-order
Open

docs: fix spread order in defineRelationsPart Rule 1 example#699
rivaldorose wants to merge 1 commit into
drizzle-team:mainfrom
rivaldorose:docs/fix-relations-part-spread-order

Conversation

@rivaldorose

Copy link
Copy Markdown

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:

Having { ...relations, ...part } will result in […]

and having { ...relations, ...part } will result in […]

The second block shows the outcome of the opposite order — posts: {}, with the comment "posts relations information will be lost" — because the empty placeholder from relations overwrites what part defined. 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.mdx
  • src/content/docs/mysql/relations.mdx
  • src/content/docs/sqlite/relations.mdx

The issue mentions one page; the same paragraph is duplicated across these three, so all three are updated. cockroach, mssql and singlestore don't contain this passage.

Verification

  • pnpm test — 29/29 passing
  • pnpm build (astro check && astro build) — clean, 769 pages
  • Checked the built HTML for all three dialects: each now renders one { ...relations, ...part } and one { ...part, ...relations }, and the "correct order" sentence above is unchanged

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
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.

Typo in defineRelationsPart docs: Incorrect spread syntax in explanation

1 participant