#86 - Polishing.
Convert idents to tabs. Fix Kotlin extensions formatting. Original pull request: #86.
This commit is contained in:
committed by
Mark Paluch
parent
43a74cae31
commit
372f5f02d4
@@ -23,7 +23,7 @@ import kotlinx.coroutines.reactive.awaitFirstOrNull
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
suspend fun DatabaseClient.GenericExecuteSpec.await() {
|
||||
then().awaitFirstOrNull()
|
||||
then().awaitFirstOrNull()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,8 +32,8 @@ suspend fun DatabaseClient.GenericExecuteSpec.await() {
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
inline fun <reified T : Any> DatabaseClient.GenericExecuteSpec.asType(): DatabaseClient.TypedExecuteSpec<T>
|
||||
= `as`(T::class.java)
|
||||
inline fun <reified T : Any> DatabaseClient.GenericExecuteSpec.asType(): DatabaseClient.TypedExecuteSpec<T> =
|
||||
`as`(T::class.java)
|
||||
|
||||
/**
|
||||
* Extension for [DatabaseClient.GenericSelectSpec.as] providing a
|
||||
@@ -41,8 +41,8 @@ inline fun <reified T : Any> DatabaseClient.GenericExecuteSpec.asType(): Databas
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
inline fun <reified T : Any> DatabaseClient.GenericSelectSpec.asType(): DatabaseClient.TypedSelectSpec<T>
|
||||
= `as`(T::class.java)
|
||||
inline fun <reified T : Any> DatabaseClient.GenericSelectSpec.asType(): DatabaseClient.TypedSelectSpec<T> =
|
||||
`as`(T::class.java)
|
||||
|
||||
/**
|
||||
* Coroutines variant of [DatabaseClient.TypedExecuteSpec.then].
|
||||
@@ -50,7 +50,7 @@ inline fun <reified T : Any> DatabaseClient.GenericSelectSpec.asType(): Database
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
suspend fun <T> DatabaseClient.TypedExecuteSpec<T>.await() {
|
||||
then().awaitFirstOrNull()
|
||||
then().awaitFirstOrNull()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,8 +59,8 @@ suspend fun <T> DatabaseClient.TypedExecuteSpec<T>.await() {
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
inline fun <reified T : Any> DatabaseClient.TypedExecuteSpec<T>.asType(): DatabaseClient.TypedExecuteSpec<T>
|
||||
= `as`(T::class.java)
|
||||
inline fun <reified T : Any> DatabaseClient.TypedExecuteSpec<T>.asType(): DatabaseClient.TypedExecuteSpec<T> =
|
||||
`as`(T::class.java)
|
||||
|
||||
/**
|
||||
* Coroutines variant of [DatabaseClient.InsertSpec.then].
|
||||
@@ -68,7 +68,7 @@ inline fun <reified T : Any> DatabaseClient.TypedExecuteSpec<T>.asType(): Databa
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
suspend fun <T> DatabaseClient.InsertSpec<T>.await() {
|
||||
then().awaitFirstOrNull()
|
||||
then().awaitFirstOrNull()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,6 +77,6 @@ suspend fun <T> DatabaseClient.InsertSpec<T>.await() {
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
inline fun <reified T : Any> DatabaseClient.InsertIntoSpec.into(): DatabaseClient.TypedInsertSpec<T>
|
||||
= into(T::class.java)
|
||||
inline fun <reified T : Any> DatabaseClient.InsertIntoSpec.into(): DatabaseClient.TypedInsertSpec<T> =
|
||||
into(T::class.java)
|
||||
|
||||
|
||||
@@ -23,32 +23,32 @@ import kotlinx.coroutines.reactive.awaitSingle
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitOne(): T
|
||||
= one().awaitSingle()
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitOne(): T =
|
||||
one().awaitSingle()
|
||||
|
||||
/**
|
||||
* Nullable Coroutines variant of [RowsFetchSpec.one].
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitOneOrNull(): T?
|
||||
= one().awaitFirstOrNull()
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitOneOrNull(): T? =
|
||||
one().awaitFirstOrNull()
|
||||
|
||||
/**
|
||||
* Non-nullable Coroutines variant of [RowsFetchSpec.first].
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitFirst(): T
|
||||
= first().awaitSingle()
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitFirst(): T =
|
||||
first().awaitSingle()
|
||||
|
||||
/**
|
||||
* Nullable Coroutines variant of [RowsFetchSpec.first].
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitFirstOrNull(): T?
|
||||
= first().awaitFirstOrNull()
|
||||
suspend fun <T> RowsFetchSpec<T>.awaitFirstOrNull(): T? =
|
||||
first().awaitFirstOrNull()
|
||||
|
||||
// TODO Coroutines variant of [RowsFetchSpec.all], depends on [kotlinx.coroutines#254](https://github.com/Kotlin/kotlinx.coroutines/issues/254).
|
||||
// suspend fun <T> RowsFetchSpec<T>.awaitAll() = all()...
|
||||
|
||||
Reference in New Issue
Block a user