Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[documentation]: Relations reordering #15894

Merged
merged 17 commits into from Feb 27, 2023
Merged

[documentation]: Relations reordering #15894

merged 17 commits into from Feb 27, 2023

Conversation

Marc-Roig
Copy link
Contributor

What does it do?

Document relations reordering internals in the database layer.

@Marc-Roig Marc-Roig added source: docs Documentation changes pr: doc This PR contributes to the documentation in this repository (READMEs or Comments) labels Feb 23, 2023
@Marc-Roig Marc-Roig self-assigned this Feb 23, 2023
@Marc-Roig Marc-Roig changed the title add relations reordering docs [documentation]: Relations reordering docs Feb 23, 2023
@Marc-Roig Marc-Roig changed the title [documentation]: Relations reordering docs [documentation]: Relations reordering Feb 23, 2023
Copy link
Member

@joshuaellis joshuaellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit picks, but great writing 💪🏼 I added value after order when discussing it because i found it clearer to understand what we're talking about :)

docs/docs/core/database/intro.md Outdated Show resolved Hide resolved
docs/docs/core/database/intro.md Outdated Show resolved Hide resolved
docs/docs/core/database/relations/reordering.mdx Outdated Show resolved Hide resolved
docs/docs/core/database/relations/reordering.mdx Outdated Show resolved Hide resolved
docs/docs/core/database/relations/reordering.mdx Outdated Show resolved Hide resolved
docs/docs/core/database/relations/reordering.mdx Outdated Show resolved Hide resolved
docs/docs/core/database/relations/reordering.mdx Outdated Show resolved Hide resolved
docs/docs/core/database/relations/reordering.mdx Outdated Show resolved Hide resolved
docs/docs/core/database/relations/reordering.mdx Outdated Show resolved Hide resolved
docs/docs/core/database/relations/reordering.mdx Outdated Show resolved Hide resolved
1. `before`:
1. Place **before** the element with that **id** in the list
1. If placing before an init relation: **order = beforeRelation.order -0.5**
_(0.5 is based on the “gap” between the init relation and the one before, so it is placed in between them)_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that the value might not always be 0.5? But is computed as the gap divided by 2?

If so maybe we should make that clearer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should always be 0.5 in this step.

Placing a new relation between
{id: 1, order: 1}
{id: 2, order: 2}

Will result in
{id: 1, order: 1}
{id: 3, order: 1.5}
{id: 2, order: 2}

Saying that, I have rephrased the algo steps hoping it's a little bit clearer. wdyt?

Marc-Roig and others added 10 commits February 23, 2023 20:33
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Marc-Roig and others added 5 commits February 23, 2023 20:59
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
@Marc-Roig Marc-Roig added this to the 4.7.0 milestone Feb 27, 2023
@Marc-Roig Marc-Roig merged commit 3998baf into main Feb 27, 2023
@Marc-Roig Marc-Roig deleted the documentation/reordering branch February 27, 2023 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: doc This PR contributes to the documentation in this repository (READMEs or Comments) source: docs Documentation changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants