Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Database client

Matt Anger edited this page Mar 21, 2022 · 1 revision

Similar to the redis client, we provide a wrapper around r2dbc to make the integration a bit cleaner with the rest of the framework. Config and access is very similar to the redis side.

database:
  primary:
    driver: postgres
    hostname: localhost
    port: 5379
    database: test
    otherOptions:
      someSpecificOption: testValue

You will have to add the appropriate r2dbc drive in your own dependency list as we don't include any of them, as there are many possibilities and we don't want to bloat our own jars or dependency graph.

Accessing the wrapper containers is done similar to the redis container:

class MyClass(dbContainer: DbContainer) {
  private val dbClient = dbContainer.clients.get("primary")
}

The full list of config we support can be seen here.

As you can see we allow the generic otherOptions for config that may be driver specific.

Clone this wiki locally