objectbox / objectbox-dart

Flutter database for super-fast Dart object persistence
https://docs.objectbox.io/getting-started
Apache License 2.0
927 stars 115 forks source link

WIP - Property query #51

Closed Buggaboo closed 4 years ago

Buggaboo commented 4 years ago

48 I need help with the tests, and some feedback wrt to the design.

My count test is broken. What am I doing wrong?

Please, don't merge yet.

vaind commented 4 years ago

My count test is broken. What am I doing wrong?

Couldn't find anything... current dart v2.5.2 still fails to properly show capture the exception (issue #1) and the lib doesn't compile with the latest dev v2.6 which should have the issue resolved and show you the proper error. I'll try to have a look at the errors given by 2.6 tomorrow and let you know.

vaind commented 4 years ago

Regarding the design, I'll have a better look tomorrow. Just one thing that occurred to me would be nice:

final queryInt = query.property(tLong); // lose the type in the method name
int sum = queryInt.sum();

Maybe we could handle it with the type system somehow - using generics on QueryProperty and getting the generic type out of it in the declaration of property() method

vaind commented 4 years ago

I'll try to have a look at the errors given by 2.6 tomorrow and let you know.

Upgrading to 2.6 is not going to be that straightforward, quite a few things changed: #54 I've had another look at your code and it really seems OK, I don't see why it's throwing.

Buggaboo commented 4 years ago

Regarding the design, I'll have a better look tomorrow. Just one thing that occurred to me would be nice:

final queryInt = query.property(tLong); // lose the type in the method name
int sum = queryInt.sum();

Maybe we could handle it with the type system somehow - using generics on QueryProperty and getting the generic type out of it in the declaration of property() method

Done.

Buggaboo commented 4 years ago

My count test is broken. What am I doing wrong?

Couldn't find anything... current dart v2.5.2 still fails to properly show capture the exception (issue #1) and the lib doesn't compile with the latest dev v2.6 which should have the issue resolved and show you the proper error. I'll try to have a look at the errors given by 2.6 tomorrow and let you know.

It might be a bug wrt to signedness (e.g. UintX vs IntX), but I'm not sure.

vaind commented 4 years ago

With all the errors you're getting, it seems something is fundamentally wrong. I'd maybe wait for 2.6 before spending too much time trying to debug it. With a proper error message, it should be straightforward.

Buggaboo commented 4 years ago

With all the errors you're getting, it seems something is fundamentally wrong. I'd maybe wait for 2.6 before spending too much time trying to debug it. With a proper error message, it should be straightforward.

Ugh. Can you please start a dev-2.6 branch? I'll start hacking that instead. This is driving me crazy.

Buggaboo commented 4 years ago

I retraced my steps and reimplemented the cstructs used in the find calls without Struct, like we used to with OBX_array_ids. And I still have the same error. Something is fundamentally broken.

@vaind If you have time, could you take a look? Maybe there are issues wrt memory alignment, padding (anything smaller than the 64-bit word size) etc.

Buggaboo commented 4 years ago

Since 2.6 is the new stable version. I'm closing this one.