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 @bytes #179

Merged
merged 16 commits into from
May 20, 2024
Merged

Add support for @bytes #179

merged 16 commits into from
May 20, 2024

Conversation

pnwpedro
Copy link
Collaborator

Ticket(s): BT-4852

Problem

Fauna supports a Bytes data type, which is represented as a base64-encoded string. However, the driver does not currently handle this data type over the wire.

{ "@bytes": "..." }

Solution

  • Introduce handling for the @bytes tag
  • For decoding, decode the base64 string into a bytearray by default. A bytearray is a mutable representation of bytes.
  • For encoding, accept bytes or bytearray, encode to base64, and write the string.

Testing

Unit and integ test.


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

@pnwpedro pnwpedro requested review from cynicaljoy and ptpaterson May 17, 2024 16:58
ptpaterson
ptpaterson previously approved these changes May 17, 2024
Copy link
Contributor

@ptpaterson ptpaterson left a comment

Choose a reason for hiding this comment

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

LGTM! Typings for query args don't need updated, right?

@pnwpedro
Copy link
Collaborator Author

pnwpedro commented May 17, 2024

Typings for query args don't need updated, right?

nope! we accept Any

@pnwpedro pnwpedro requested a review from cynicaljoy May 20, 2024 13:24
cynicaljoy
cynicaljoy previously approved these changes May 20, 2024
Base automatically changed from update-readme to main May 20, 2024 16:43
@pnwpedro pnwpedro dismissed stale reviews from cynicaljoy and ptpaterson May 20, 2024 16:43

The base branch was changed.

@pnwpedro pnwpedro requested a review from cynicaljoy May 20, 2024 16:44
@pnwpedro pnwpedro merged commit 3dc74c4 into main May 20, 2024
7 checks passed
@pnwpedro pnwpedro deleted the bytes-support branch May 20, 2024 16:47
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.

5 participants