jZenith Logo

An opinionated approach to building modern Java Microservices

View project on GitHub

Postgres Plugin


The Postgres Plugin gives you

  • jOOQ
  • running with reactive-pg-client
  • Flyway for db setup and migration

The Postgres Plugin can be enabled by calling


Typical DAO implements look like

    public Maybe<User> getById(@NonNull UUID id) {
        final Select<?> select = dslContext.select(ID_FIELD, NAME_FIELD)

        return client.executeForSingleRow(select)

Where DSLContext dslContext and PostgresClient client are injectable.

DB Setup and migration

jZenith uses Flyway to do DB migrations. A file in


with the naming scheme


is enough to get the DB schema created on startup.

Configuration properties

defined in PostgresqlConfiguration

  • postgresql.port: The port PostgreSQL listens to
  • postgresql.host: The host to connect to
  • postgresql.database: The database to connect to
  • postgresql.username: The username to use for authentication
  • postgresql.password: The password to use for authentication
  • postgresql.pool.size: The pool size for the connection pool.