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

in filter does not support obx_id #42

Open
black-inc-service opened this issue Jul 25, 2024 · 0 comments
Open

in filter does not support obx_id #42

black-inc-service opened this issue Jul 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@black-inc-service
Copy link

Describe the bug
Cannot use in filter with obx_id

Basic info (please complete the following information):

  • ObjectBox version: 4.0.0
  • C++ version: 17
  • Reproducibility: always
  • OS: Ubuntu 22.04

To Reproduce
Steps to reproduce the behavior:

  1. Create vector of obx_id
  2. Pass vector to "in" filter
  3. Compiler error

Expected behavior
Should be able to handle obx_id

Code

database.fbs - example
table Device {
    /// objectbox:id
    id                        : ulong;
    active                    : bool; 
} 
std::vector<obx_id> requestIDs = {1, 2, 9};
tableDevice_.query().with(Device_::id.in(requestIDs)).build().findUniquePtrs(); // Fails to compile

std::vector<int64_t> requestIDs = {1, 2, 9};
tableDevice_.query().with(Device_::id.in(requestIDs)).build().findUniquePtrs(); // Is ok

This is caused as the template implementation for uint64_t is missing and obx_id is unsigned 64bit

objectbox.h
typedef uint64_t obx_id;

For our system we do not have big obx_id values bigger than 9,223,372,036,854,775,807 but a unsigned/signed conversion must be made or implement our own template in objectbox.hpp

@black-inc-service black-inc-service added the bug Something isn't working label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant