imodel-native icon indicating copy to clipboard operation
imodel-native copied to clipboard

IECSqlBinder and ECSqlStatement are missing a BindIdSet function

Open RohitPtnkr1996 opened this issue 3 months ago • 0 comments

Consider the ECSql: select id from IdSet(?)

Currently, there is no way in ECDb to bind an IdSet to an ECSql parameter using the IECSqlBinder or the ECSqlStatement directly. We do have a NativeECSqlBinder Api called BindIdSet, but that too is using a for loop to add array elements and bind ids individually, like so:

auto& binder = stmt->GetBinder(1);
for (const auto& id : idSet)
     binder.AddArrayElement().BindId(id)

Expected:

DgnElementIdSet idSet;
auto& binder = stmt->GetBinder(1);
binder.BindIdSet(std::make_shared<DgnElementIdSet>(idSet));

Also,

DgnElementIdSet idSet;
stmt->BindIdSet(1, std::make_shared<DgnElementIdSet>(idSet));

RohitPtnkr1996 avatar Oct 10 '25 15:10 RohitPtnkr1996