Package com.io7m.idstore.database.postgres.internal

# Class IdDatabase

java.lang.Object
com.io7m.idstore.database.postgres.internal.IdDatabase

All Implemented Interfaces:
  `IdDatabaseType`, `IdServiceType`, `AutoCloseable`

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IdDatabase(io.opentelemetry.api.OpenTelemetry inOpenTelemetry, Clock inClock, com.zaxxer.hikari.HikariDataSource inDataSource)`
  The default postgres server database implementation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Clock`
  `clock()`
  `void`
  `close()`
  `String`
  `description()`
  `IdDatabaseConnectionType`
  `openConnection(IdDatabaseRole role)`
  Open a database connection using the given role.
  `org.jooq.conf.Settings`
  `settings()`
  `String`
  `toString()`
  `io.opentelemetry.api.trace.Tracer`
  `tracer()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## 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 `IdServiceType`
    Returns:
      The service description

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`