java.lang.Object
com.io7m.idstore.database.postgres.internal.IdDatabase
All Implemented Interfaces:
IdDatabaseType, com.io7m.repetoir.core.RPServiceType, AutoCloseable

public final class IdDatabase extends Object implements IdDatabaseType
The default postgres server database implementation.
  • Constructor Details

    • IdDatabase

      public IdDatabase(io.opentelemetry.api.OpenTelemetry inOpenTelemetry, Clock inClock, com.zaxxer.hikari.HikariDataSource inDataSource)
      The default postgres server database implementation.
      Parameters:
      inOpenTelemetry - A telemetry interface
      inClock - The clock
      inDataSource - A pooled data source
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface IdDatabaseType
    • tracer

      public io.opentelemetry.api.trace.Tracer tracer()
      Returns:
      The OpenTelemetry tracer
    • openConnection

      public IdDatabaseConnectionType openConnection(IdDatabaseRole role) throws IdDatabaseException
      Description copied from interface: IdDatabaseType
      Open a database connection using the given role.
      Specified by:
      openConnection in interface IdDatabaseType
      Parameters:
      role - The role
      Returns:
      A database connection
      Throws:
      IdDatabaseException - On errors
    • settings

      public org.jooq.conf.Settings settings()
      Returns:
      The jooq SQL settings
    • clock

      public Clock clock()
      Returns:
      The clock used for time-related queries
    • description

      public String description()
      Specified by:
      description in interface com.io7m.repetoir.core.RPServiceType
    • toString

      public String toString()
      Overrides:
      toString in class Object