-
Notifications
You must be signed in to change notification settings - Fork 307
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
Additional Kotlin extensions #446
Labels
help wanted
Looking for insight or contributors
Comments
My suggestions:
// Regular
val query = box.query().run {
equal(property, value)
order(property)
build()
}
// With extension
val query = box.query {
equal(property, value)
order(property)
}
// Regular
toMany.apply {
reset()
add(entity)
removeById(id)
applyChangesToDb()
}
// With extension
toMany.applyChangesToDb(resetFirst = true) { // default is false
add(entity)
removeById(id)
}
// Regular
val liveData = ObjectBoxLiveData(query)
// With extension
val liveData = query.toLiveData() -ut |
The first two suggestions are released as part of |
An upcoming release will add extensions that are shortcuts for query methods that accept // Regular
queryBuilder.equal(Model_.type, typeId.toLong())
// With extension
queryBuilder.equal(Model_.type, typeId) -ut |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ObjectBox already provides some minimal Kotlin extensions:
This issue is to track what other Kotlin extensions may be added.
Some ground rules:
Things to look out for:
-ut
The text was updated successfully, but these errors were encountered: