Interface PooledDatabaseConfig

All Known Implementing Classes:
MariaDbConfig, PostgresConfig

public interface PooledDatabaseConfig

Interface for database configurations that support HikariCP connection pooling.

This interface provides a common contract for database configurations across different database dialects (MariaDB, PostgreSQL, etc.). Implementing this interface allows configurations to be used directly with SQLManager.

Example Usage

// MariaDbConfig implements PooledDatabaseConfig
MariaDbConfig config = new MariaDbConfig();

// Can be used directly with SQLManager
SQLManager sqlManager = SQLManager.create(config)
    .poolName("MyPlugin-Pool")
    .logger(logger)
    .build();
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the maximum number of connections in the pool.
    int
    Gets the minimum number of idle connections in the pool.
    Converts this configuration to database credentials.
  • Method Details

    • toCredentials

      DatabaseCredentials toCredentials()
      Converts this configuration to database credentials.
      Returns:
      the database credentials for connection
    • maxPoolSize

      int maxPoolSize()
      Gets the maximum number of connections in the pool.
      Returns:
      the maximum pool size
    • minIdle

      int minIdle()
      Gets the minimum number of idle connections in the pool.
      Returns:
      the minimum idle connections