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

add support for returning to insert #564

Merged
merged 11 commits into from
Jul 18, 2022
Merged

Conversation

dantownsend
Copy link
Member

@dantownsend dantownsend commented Jul 18, 2022

Supersedes this PR: #203

Fixes #171

Adds support for the returning clause with Insert:

>>> await Manager.insert(
...    Manager(name="Maz"),
...    Manager(name="Guido")
... ).returning(Manager.id, Manger.name)
[{'id': 1, 'name': 'Maz'}, {'id': 2, 'name': 'Guido'}]

@dantownsend dantownsend added the enhancement New feature or request label Jul 18, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2022

Codecov Report

Merging #564 (40e1ecc) into master (55bde6e) will decrease coverage by 0.01%.
The diff coverage is 93.75%.

@@            Coverage Diff             @@
##           master     #564      +/-   ##
==========================================
- Coverage   90.85%   90.84%   -0.02%     
==========================================
  Files         105      105              
  Lines        7166     7174       +8     
==========================================
+ Hits         6511     6517       +6     
- Misses        655      657       +2     
Impacted Files Coverage Δ
piccolo/querystring.py 91.13% <ø> (ø)
piccolo/engine/base.py 74.13% <50.00%> (-0.87%) ⬇️
piccolo/engine/postgres.py 91.34% <50.00%> (-0.41%) ⬇️
piccolo/engine/sqlite.py 97.02% <100.00%> (+0.02%) ⬆️
piccolo/query/methods/insert.py 100.00% <100.00%> (ø)
piccolo/query/mixins.py 95.50% <100.00%> (ø)
piccolo/table.py 95.59% <100.00%> (ø)

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 55bde6e...40e1ecc. Read the comment docs.

@dantownsend dantownsend merged commit d3a056c into master Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Insert & get
2 participants