DBFlow icon indicating copy to clipboard operation
DBFlow copied to clipboard

Using .count() for scalar query returns like sums, etc

Open jesseiqmi opened this issue 10 years ago • 1 comments

DBFlow Version: 3.0 Issue Kind (Bug, Question, Feature): Question

Please note if you are using Instant Run, there may be bugs where generated classes are not created. Ensure you are using the apt or kapt plugins and that incremental compilation is off.

Description: When using working with a simple scalar return, usually from a sum or even count in the select block, .count() is to be used here which doesn't jive ultimately jive with what the expected return should be.

Are you considering renaming this or providing an alias or (...?) so that it's more in line with what people would expect when they want to work with a simple scalar return value of any type (int, float, string, etc)?

Maybe in the meantime the documentation could be updated to indicate that .count() is to be used anytime for scalar return values as it's not very clear at the moment. Maybe a dedicated sub section on Scalars in "Select" on https://github.com/Raizlabs/DBFlow/blob/0596f942432a80baf995bf2bab3ab121acb5c08e/usage2/SQLiteWrapperLanguage.md

Thoughts? Just want to make sure that we're using DBFlow as it's intended - all good here otherwise and a fine job you've been doing on it, and great work on 3.0!

jesseiqmi avatar Jun 13 '16 18:06 jesseiqmi

use executeUpdateDelete() for when 4.0.0-beta1 is released, currently in develop. There might be breaking changes based on implementation so upgrade wisely until first beta released.

agrosner avatar Oct 02 '16 15:10 agrosner