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

feat(client): add connect_or_create #997

Merged
merged 7 commits into from
Aug 8, 2024
Merged

Conversation

AdeelK93
Copy link
Contributor

@AdeelK93 AdeelK93 commented Aug 7, 2024

Change Summary

Adds connectOrCreate to support #754

Please let me know if I should make write tests (and where to put them). Thanks @RobertCraigie for your work on this great library!

Checklist

  • Unit tests for the changes exist
  • Tests pass without significant drop in coverage
  • Documentation reflects changes where applicable
  • Test snapshots have been updated if applicable

Agreement

By submitting this pull request, I confirm that you can use, modify, copy and redistribute this contribution, under the terms of your choice.

@AdeelK93 AdeelK93 changed the title Support connectOrCreate feat(generator): Support connectOrCreate Aug 7, 2024
Copy link
Owner

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

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

Thanks @AdeelK93!

r.e. testing, you should add tests to databases/tests/test_create.py and databases/sync_tests/test_create.py. See these docs for information on the database testing setup and let me know if you need any help, I don't think all the setup there is particularly well documented right now.

src/prisma/generator/templates/types.py.jinja Outdated Show resolved Hide resolved
@RobertCraigie RobertCraigie changed the title feat(generator): Support connectOrCreate feat(client): Support connectOrCreate Aug 7, 2024
@AdeelK93 AdeelK93 requested a review from RobertCraigie August 7, 2024 18:32
@AdeelK93 AdeelK93 changed the title feat(client): Support connectOrCreate feat(client): Support connect_or_create Aug 7, 2024
@AdeelK93
Copy link
Contributor Author

AdeelK93 commented Aug 7, 2024

thanks @RobertCraigie - I moved the tests to the files you mentioned, and renamed the function to snake case. Any other feedback?

@AdeelK93
Copy link
Contributor Author

AdeelK93 commented Aug 8, 2024

hi @RobertCraigie, looks like one test failed, but it’s a transient error (incomplete read while downloading node binary). the tests all passed on my fork, could we please retry?

Copy link
Owner

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

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

Awesome, thanks! Great work :)

@RobertCraigie RobertCraigie changed the title feat(client): Support connect_or_create feat(client): add connect_or_create Aug 8, 2024
@RobertCraigie RobertCraigie enabled auto-merge (squash) August 8, 2024 14:37
@RobertCraigie RobertCraigie merged commit f1ab3b1 into RobertCraigie:main Aug 8, 2024
32 checks passed
github-actions bot added a commit that referenced this pull request Aug 8, 2024
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.

2 participants