Skip to content

Conversation

erizocosmico
Copy link
Contributor

@erizocosmico erizocosmico commented Apr 20, 2017

Fixes #117

Before, inverses were being treated as any other relationship, thus being saved/updated after the model. If the model had any inverses, that had not been previously saved, the operation would fail, as the inverse is not saved but required to exist in the database.
Now, inverses are saved first, then the model, and, finally, the other relationships.

Before, inverses were being treated as any other relationship, thus
being saved/updated after the model. If the model had any inverses,
that had not been previously saved, the operation would fail, as the
inverse is not saved but required to exist in the database.
Now, inverses are saved first, then the model, and, finally, the other
relationships.
@codecov
Copy link

codecov bot commented Apr 20, 2017

Codecov Report

Merging #126 into master will increase coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
+ Coverage   80.13%   80.24%   +0.11%     
==========================================
  Files          15       15              
  Lines        2743     2759      +16     
==========================================
+ Hits         2198     2214      +16     
  Misses        374      374              
  Partials      171      171
Impacted Files Coverage Δ
generator/types.go 86.82% <100%> (+0.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 403a959...aa26abf. Read the comment docs.

Copy link
Contributor

@dpordomingo dpordomingo left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@smola smola left a comment

Choose a reason for hiding this comment

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

As far as I understood, relationship updates are not atomic. Maybe the documentation should clarify that, so that people is aware that they might need to use a transaction even for a single Save.

@erizocosmico
Copy link
Contributor Author

@smola the transaction is automatically done by kallax if it has to save more than one record (the case of relationships, for example)

@erizocosmico erizocosmico merged commit d558b78 into src-d:master Apr 20, 2017
@erizocosmico erizocosmico deleted the feature/save-relationships-order branch April 20, 2017 10:22
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.

4 participants