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

Integrate Bytes value #554

Merged
merged 18 commits into from
Sep 7, 2023
Merged

Integrate Bytes value #554

merged 18 commits into from
Sep 7, 2023

Conversation

sandreae
Copy link
Member

@sandreae sandreae commented Sep 7, 2023

rebased from #552

  • store Bytes in the database as a hexadecimal string still in the operation_field_v1 "value" column
    • we considered moving it to a new "bytes_value" field and storing as a BLOB but this would break compatibility with Postgres and in any case we are likely to stream the bytes directly to and from the filesystem in a later optimisation
  • in the GraphQL api bytes are represented by HexBytesScalar

📋 Checklist

  • Add tests that cover your changes
  • Add this PR to the Unreleased section in CHANGELOG.md
  • Link this PR to any issues it closes
  • New files contain a SPDX license header

@sandreae sandreae mentioned this pull request Sep 7, 2023
4 tasks
@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Patch coverage: 89.94% and project coverage change: -0.10% ⚠️

Comparison is base (3760e20) 92.55% compared to head (416eff8) 92.45%.

Additional details and impacted files
@@               Coverage Diff               @@
##           development     #554      +/-   ##
===============================================
- Coverage        92.55%   92.45%   -0.10%     
===============================================
  Files              105      106       +1     
  Lines            17988    18039      +51     
===============================================
+ Hits             16648    16678      +30     
- Misses            1340     1361      +21     
Files Changed Coverage Δ
aquadoggo/src/graphql/scalars/hex_bytes_scalar.rs 40.00% <40.00%> (ø)
...quadoggo/src/graphql/input_values/fields_filter.rs 80.00% <80.00%> (ø)
aquadoggo/src/db/models/utils.rs 99.59% <100.00%> (-0.01%) ⬇️
aquadoggo/src/db/stores/blob.rs 98.39% <100.00%> (ø)
aquadoggo/src/db/stores/document.rs 98.72% <100.00%> (ø)
aquadoggo/src/db/stores/query.rs 96.13% <100.00%> (+<0.01%) ⬆️
aquadoggo/src/graphql/queries/collection.rs 99.60% <100.00%> (+<0.01%) ⬆️
aquadoggo/src/graphql/queries/next_args.rs 97.00% <100.00%> (ø)
aquadoggo/src/graphql/schema.rs 92.85% <100.00%> (+0.06%) ⬆️
aquadoggo/src/graphql/tests.rs 100.00% <100.00%> (ø)
... and 3 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.

📢 Have feedback on the report? Share it here.

@sandreae sandreae linked an issue Sep 7, 2023 that may be closed by this pull request
@sandreae sandreae marked this pull request as ready for review September 7, 2023 18:10
@@ -385,6 +387,7 @@ mod tests {
("artist", "David Bowie".into(), None),
("title", "Speed Of Life".into(), None),
("release_year", 1977.into(), None),
("audio", vec![8, 9, 10, 11][..].into(), None),
Copy link
Member

Choose a reason for hiding this comment

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

Haha cool!

@adzialocha adzialocha merged commit 9bbcd08 into development Sep 7, 2023
10 checks passed
@adzialocha adzialocha deleted the integrate-bytes-value-v2 branch September 7, 2023 19:17
adzialocha added a commit that referenced this pull request Sep 8, 2023
* development:
  Make sure `/tmp` directory does not run out of scope before application ends (#557)
  Integrate `Bytes` value (#554)
  Stream blob data in chunks to files to not occupy too much memory (#551)
  Blobs directory configuration (#549)
  Use correct MAX_BLOB_PIECE_LENGTH from p2panda_rs
  Build a byte buffer over paginated pieces when assembling blobs (#547)
  HTTP routes to serve files with correct content type and etag headers (#544)
  Task for automatic garbage collection of unused documents and views (#500)
  Refactor tmp blob dir creation after rebase
  Fix after rebase
  "blob" materializer task (#493)
  Add static file server to `http` service (#483)
  Enable deletion of dangling `document_views` and related `document_view_fields` from db  (#491)
  BlobStore for retrieving raw blob data from the db (#484)
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.

Support Bytes operation value
2 participants