Hi, while learning Exposed, I ended up building a ...
# exposed
d
Hi, while learning Exposed, I ended up building a bunch of features that I personally use all the time, even though they are not part of the official library. Most people probably already know Jackson2 and Jackson3. I also added support for Tink, which supports deterministic encryption unlike Crypt, so I was able to make encrypted columns searchable. I also added dialects for Trino, BigQuery, and DuckDB. On top of that, exposed-jdbc-lettuce and exposed-jdbc-redisson support various caching strategies like read-through, write-through, and write-behind. They also support not only remote cache, but near cache as well, so you can use them as a 2-tier cache. There are a few more things too, so feel free to check them out: https://github.com/bluetape4k/bluetape4k-projects/tree/develop/data
🙌 3
🙌🏼 1
o
It’d be nice to see exposed-r2dbc reactive connection pooling. This: https://github.com/r2dbc/r2dbc-pool or any other alternative if exists.
d
I already made an example using r2dbc-pool. Are you suggesting it would be better to support it directly? I had only been thinking of it as something configured through Spring Boot, but yeah, it would definitely be more convenient if it were built in. https://github.com/bluetape4k/exposed-r2dbc-workshop/blob/main/11-high-performance[…]otlin/exposed/r2dbc/examples/cache/config/ExposedR2dbcConfig.kt
👍 1
o
Are you suggesting it would be better to support it directly?
Yes, directly.
Copy code
/**
     * ConnectionFactory를 래핑하여 커넥션 풀을 구성합니다.
     * 모든 데이터베이스 유형에 공통으로 적용됩니다.
     */
    @Bean
    @Primary
    fun connectionPool(connectionFactoryOptions: ConnectionFactoryOptions): ConnectionPool {
        val connectionFactory = ConnectionFactories.get(connectionFactoryOptions)
        val poolConfig = ConnectionPoolConfiguration.builder(connectionFactory)
            .maxIdleTime(Duration.ofMinutes(10))
            .maxLifeTime(Duration.ofMinutes(30))
            .maxCreateConnectionTime(Duration.ofSeconds(10))
            .maxSize(maxOf(Runtimex.availableProcessors * 8, 100))
            .initialSize(8)
            .minIdle(8)
            .acquireRetry(3)
            .backgroundEvictionInterval(Duration.ofMinutes(1))
            .maxAcquireTime(Duration.ofSeconds(3))
            .build()

        return ConnectionPool(poolConfig)
    }
This is what I mean, yes.