Hey there, I’m wondering if someone has a comment ...
# exposed
a
Hey there, I’m wondering if someone has a comment on “what is the right way to set a schema” in a Exposed, Hikari, Postgres - Setup. I did it in various ways (per transaction, in hikari config) and i finally start to understand that i broke other stuff with it (e.g. transaction_isolation…) so the last thing i found was this Issue on the Hikari Repo. Therefore i tried to set the schema via the database url like this. Maybe someone faced something similar?
Copy code
private fun hikari(envVars: Env.DataSource): HikariDataSource {
        val hikariConfig = HikariConfig().apply {
            driverClassName = "org.postgresql.Driver"
            jdbcUrl = "${envVars.url}?currentSchema=${envVars.schema}"
            username = envVars.username
            password = envVars.password
            transactionIsolation = TRANSACTION_SERIALIZABLE
        }
        hikariConfig.validate()
        return HikariDataSource(hikariConfig)
    }