public interface DatabaseConfiguration
Represents the configuration for a database connection, including
both basic database settings and HikariCP connection pool settings.
-
Method Summary
String
Returns the address of the database server.
long
Returns the maximum time to wait for a connection from the pool (in milliseconds).
long
Returns the maximum time to wait for a database query (in milliseconds).
long
Returns the maximum amount of time that a connection is allowed to sit idle in the pool (in milliseconds).
default String
int
Returns the maximum number of connections in the HikariCP connection pool.
long
Returns the maximum lifetime of a connection in the HikariCP pool (in milliseconds).
int
Returns the minimum number of idle connections in the HikariCP pool.
String
Returns the name of the database.
String
Returns the password for database authentication.
int
Returns the port on which the database server is listening.
default String
String
Returns the prefix to use for table names.
String
Returns the database type (e.g., "MYSQL", "SQLITE").
String
Returns the username for database authentication.
Returns a default SQLite database configuration.
-
Method Details
-
sqlite
Returns a default SQLite database configuration.
The default configuration uses:
- Type: "SQLITE"
- Address: "localhost"
- Database name: "phoenixtest_db"
- Port: 3306
- Maximum pool size: 10
- Minimum idle connections: 5
- Idle timeout: 300,000 ms
- Maximum lifetime: 1,700,000 ms
- Connection timeout: 30,000 ms
- Returns:
- a
DatabaseConfiguration instance with default SQLite settings
-
getType
String getType()
Returns the database type (e.g., "MYSQL", "SQLITE").
- Returns:
- the type of the database
-
getAddress
String getAddress()
Returns the address of the database server.
- Returns:
- the database server address
-
getName
String getName()
Returns the name of the database.
- Returns:
- the database name
-
getPort
int getPort()
Returns the port on which the database server is listening.
- Returns:
- the database port
-
getUsername
String getUsername()
Returns the username for database authentication.
- Returns:
- the database username
-
getPassword
String getPassword()
Returns the password for database authentication.
- Returns:
- the database password
-
getTablePrefix
String getTablePrefix()
Returns the prefix to use for table names.
- Returns:
- the table name prefix
-
getJdbcUrlOptions
default String getJdbcUrlOptions()
-
getSqliteFile
default String getSqliteFile()
-
getMaximumPoolSize
int getMaximumPoolSize()
Returns the maximum number of connections in the HikariCP connection pool.
- Returns:
- the maximum pool size
-
getMinimumIdle
int getMinimumIdle()
Returns the minimum number of idle connections in the HikariCP pool.
- Returns:
- the minimum number of idle connections
-
getIdleTimeout
long getIdleTimeout()
Returns the maximum amount of time that a connection is allowed to sit idle in the pool (in milliseconds).
- Returns:
- the idle timeout in milliseconds
-
getMaxLifetime
long getMaxLifetime()
Returns the maximum lifetime of a connection in the HikariCP pool (in milliseconds).
- Returns:
- the maximum connection lifetime in milliseconds
-
getConnectionTimeout
long getConnectionTimeout()
Returns the maximum time to wait for a connection from the pool (in milliseconds).
- Returns:
- the connection timeout in milliseconds
-
getFetchTimeout
long getFetchTimeout()
Returns the maximum time to wait for a database query (in milliseconds).
- Returns:
- the fetch timeout in milliseconds