Skip to content

in filter does not support obx_id #42

Open
@black-inc-service

Description

@black-inc-service

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions