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(engine): json protocol #1035

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ProgramRipper
Copy link

@ProgramRipper ProgramRipper commented Sep 28, 2024

closed #707, #748

Change Summary

A naive implementation of JSON protocol based on #748.

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.

# FieldNotFoundError,
# match=r'Field \'foo_field\' not found in enclosing type \'Post\'',
# ):
# await CustomPost.prisma().find_first()
Copy link
Author

Choose a reason for hiding this comment

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

Caution

test_field_not_found_error_selection skipped

JSON protocol does not explicitly select all fields, so it won't raise a FieldNotFoundError here.

However we could:

  • explicitly select all fields (cons: this could be hard to impl and bring overhead to serializer, prisma-engine and maybe even db); or...
  • leave it to pydantic as it will raise validation errors if data doesn't match the model.

@ProgramRipper ProgramRipper marked this pull request as ready for review September 29, 2024 12:14
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.

Refactor internal query builder to use the JSON protocol
1 participant