mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-03 15:19:44 +00:00
all deprecations were removed
This commit is contained in:
@@ -5,26 +5,6 @@ import dev.inmo.micro_utils.pagination.utils.doForAllWithNextPaging
|
||||
import dev.inmo.micro_utils.pagination.utils.getAllWithNextPaging
|
||||
import dev.inmo.micro_utils.repos.ReadStandardCRUDRepo
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy. Can be replaced with other doForAll extensions")
|
||||
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.doForAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
crossinline methodCaller: suspend REPO.(Pagination) -> PaginationResult<T>,
|
||||
crossinline block: (List<T>) -> Unit
|
||||
) {
|
||||
doForAllWithNextPaging {
|
||||
methodCaller(it).also {
|
||||
block(it.results)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy. Can be replaced with other doForAll extensions")
|
||||
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.doForAll(
|
||||
crossinline block: (List<T>) -> Unit
|
||||
) = doForAllWithNextPaging {
|
||||
getByPagination(it).also { block(it.results) }
|
||||
}
|
||||
|
||||
suspend inline fun <T, ID, REPO : ReadStandardCRUDRepo<T, ID>> REPO.getAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
crossinline methodCaller: suspend REPO.(Pagination) -> PaginationResult<T>
|
||||
|
@@ -4,24 +4,6 @@ import dev.inmo.micro_utils.pagination.*
|
||||
import dev.inmo.micro_utils.pagination.utils.getAllWithNextPaging
|
||||
import dev.inmo.micro_utils.repos.ReadStandardKeyValueRepo
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy")
|
||||
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>,
|
||||
block: (List<Pair<Key, Value>>) -> Unit
|
||||
) {
|
||||
doWithPagination {
|
||||
methodCaller(it).also { keys ->
|
||||
block(keys.results.mapNotNull { key -> get(key) ?.let { value -> key to value } })
|
||||
}.nextPageIfNotEmpty()
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy")
|
||||
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||
block: (List<Pair<Key, Value>>) -> Unit
|
||||
) = doForAll({ keys(it, false) }, block)
|
||||
|
||||
suspend inline fun <Key, Value, REPO : ReadStandardKeyValueRepo<Key, Value>> REPO.getAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
crossinline methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>
|
||||
|
@@ -4,34 +4,6 @@ import dev.inmo.micro_utils.pagination.*
|
||||
import dev.inmo.micro_utils.pagination.utils.getAllWithNextPaging
|
||||
import dev.inmo.micro_utils.repos.ReadOneToManyKeyValueRepo
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy")
|
||||
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>,
|
||||
block: (List<Pair<Key, List<Value>>>) -> Unit
|
||||
) {
|
||||
doWithPagination {
|
||||
methodCaller(it).also { keys ->
|
||||
block(
|
||||
keys.results.mapNotNull { key ->
|
||||
val values = mutableListOf<Value>()
|
||||
doWithPagination {
|
||||
get(key, it).also {
|
||||
values.addAll(it.results)
|
||||
}.nextPageIfNotEmpty()
|
||||
}
|
||||
key to values
|
||||
}
|
||||
)
|
||||
}.nextPageIfNotEmpty()
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Will be removed soon due to redundancy")
|
||||
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.doForAll(
|
||||
block: (List<Pair<Key, List<Value>>>) -> Unit
|
||||
) = doForAll({ keys(it, false) }, block)
|
||||
|
||||
suspend inline fun <Key, Value, REPO : ReadOneToManyKeyValueRepo<Key, Value>> REPO.getAll(
|
||||
@Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE")
|
||||
crossinline methodCaller: suspend REPO.(Pagination) -> PaginationResult<Key>
|
||||
|
@@ -24,9 +24,7 @@ abstract class AbstractExposedWriteCRUDRepo<ObjectType, IdType, InputValueType>(
|
||||
override val updatedObjectsFlow: Flow<ObjectType> = updateObjectsChannel.asSharedFlow()
|
||||
override val deletedObjectsIdsFlow: Flow<IdType> = deleteObjectsIdsChannel.asSharedFlow()
|
||||
|
||||
@Deprecated("Will be removed in near major update. Override open fun with the same name instead")
|
||||
abstract val InsertStatement<Number>.asObject: ObjectType
|
||||
protected open fun InsertStatement<Number>.asObject(value: InputValueType): ObjectType = asObject
|
||||
protected abstract fun InsertStatement<Number>.asObject(value: InputValueType): ObjectType
|
||||
abstract val selectByIds: SqlExpressionBuilder.(List<IdType>) -> Op<Boolean>
|
||||
|
||||
protected abstract fun insert(value: InputValueType, it: InsertStatement<Number>)
|
||||
|
@@ -1,8 +0,0 @@
|
||||
package dev.inmo.micro_utils.repos.ktor.common.one_to_many
|
||||
|
||||
@Deprecated("Replaced", ReplaceWith("keyParameterName", "dev.inmo.micro_utils.repos.ktor.common.keyParameterName"))
|
||||
const val keyParameterName = dev.inmo.micro_utils.repos.ktor.common.keyParameterName
|
||||
@Deprecated("Replaced", ReplaceWith("valueParameterName", "dev.inmo.micro_utils.repos.ktor.common.valueParameterName"))
|
||||
const val valueParameterName = dev.inmo.micro_utils.repos.ktor.common.valueParameterName
|
||||
@Deprecated("Replaced", ReplaceWith("reversedParameterName", "dev.inmo.micro_utils.repos.ktor.common.reversedParameterName"))
|
||||
const val reversedParameterName = dev.inmo.micro_utils.repos.ktor.common.reversedParameterName
|
Reference in New Issue
Block a user