Hi, is there an example that uses r2dbc, Coroutine...
# spring
k
Hi, is there an example that uses r2dbc, CoroutineCrudRepository and ManyToOne/ManyToMany relationships?
🚫 1
j
Of what I remember, it isn't supported yet
thank you color 1
d
You could create your own manyToMany relationship (or anyone) by yourself using DataBase Client. And then you can even run queries in parallel. Look at this fully functional demo: https://github.com/danygiguere/spring-boot-3-reactive-with-kotlin-coroutines/blob/main/src/main/kotlin/com/example/demo/post/PostService.kt
Copy code
// oneToMany relationship query example
    suspend fun findByIdWithImages(id: Long): PostWithImagesDto? = coroutineScope {
        val post = async{findById(id)}
        val images = async{imageRepository.findByPostId(id)?.toList()}
        return@coroutineScope post.await()?.toPostWithImagesDto()?.copy(images = images.await())
    }
thank you color 1