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

Fixes #3 - Issues related to Blob/Binary data type #4

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

richan-fongdasen
Copy link
Owner

Changes In Code

Update the way of passing and retrieving the binary/blob data type, referring to the official documentation:
https://github.com/tursodatabase/libsql/blob/main/docs/HRANA_3_SPEC.md#values

Issue ticket number / Business Case

[Bug]: Blob data storage not working

Checklist before requesting a review

  • I have written PHP tests.
  • I have updated the documentation in the readme where needed.
  • I have checked code styles, PHPStan etc. pass.
  • I have provided an issue/business case.

@richan-fongdasen richan-fongdasen self-assigned this Apr 23, 2024
Copy link

codecov bot commented Apr 23, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

'type' => 'blob',
'value' => base64_encode($value),
'type' => 'blob',
'base64' => base64_encode(base64_encode($value)),
Copy link
Owner Author

Choose a reason for hiding this comment

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

Passing the binary/blob data with a single base64 encoding produces an intermittent error. I've reported this issue to the Turso development team. As a quick fix to avoid the error, we will send the binary/blob data by encoding it in base64 format twice.

Choose a reason for hiding this comment

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

That's kinda wild

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah, this is only a quick fix. I will update the approach as soon as the Turso dev team fixes the issue. There's also a workaround to store binary data as a base64-encoded string in the database using Laravel's custom attribute casting.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Anyway.. Do you have any suggestions about this?

Choose a reason for hiding this comment

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

If it works, it works. Interested to hear what Turso have to say .

Copy link
Owner Author

Choose a reason for hiding this comment

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

They're currently investigating the issue. You can find the issue report I've submitted on Turso's Discord server in the help channel.

@richan-fongdasen richan-fongdasen merged commit 420bf40 into main Apr 23, 2024
17 checks passed
@richan-fongdasen richan-fongdasen deleted the issue-3 branch April 23, 2024 07:49
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