objectbox / objectbox-java

Android Database - first and fast, lightweight on-device vector database
https://objectbox.io
Apache License 2.0
4.42k stars 304 forks source link

data browser not showing the values of byte[] type #1033

Closed LeoXJ978 closed 2 years ago

LeoXJ978 commented 3 years ago

When model has a field of byte[], though the values seem correctly persisted, data browser shows blank for the field

Basic info (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Put a field of byte[]
  2. assign some values, then persist the model
  3. check the field in data browser

Expected behavior the values should be shown

greenrobot-team commented 2 years ago

Confirmed, thanks for reporting!

The values are actually returned from the database, but not in a format that can be displayed. Example:

http://localhost:8090/api/query?entity_name=Note&offset=0&limit=50
{ "data":
 {
 "offset": 0,
 "fields": ["id", "text", "date", "bytes", "authorId"],

 "count": 3, "objects": [
  ["1", "This is a note for Bob", "1638789338241", "\u0001\u0002\u0003", "1"],
  ["2", "Write a demo app for ObjectBox", "1638789338242", "\u0001\u0002\u0003", "1"],
  ["3", "Thanks for your note, Alice", "1638789338242", "\u0001\u0002\u0003", "2"]
 ]
}
}
greenrobot-team commented 2 years ago

This is fixed in the 3.1.0 release. Byte arrays are now shown as Base64 encoded values.