Package org.ossreviewtoolkit.model.utils
Object DatabaseUtils
-
- All Implemented Interfaces:
public class DatabaseUtils
-
-
Field Summary
Fields Modifier and Type Field Description public final static DatabaseUtilsINSTANCE
-
Method Summary
Modifier and Type Method Description final Lazy<DataSource>createHikariDataSource(PostgresConnection config, String applicationNameSuffix, Integer maxPoolSize)Return a HikariDataSource for the given PostgresConnection. final UnitcheckDatabaseEncoding(Transaction $self, String expectedEncoding)Logs a warning in case the actual database encoding does not equal the expectedEncoding. final BooleantableExists(Transaction $self, String tableName)Return true if and only if a table named tableName exists. final <T extends Any> Ttransaction(Database $self, Function1<Transaction, T> statement)Start a new transaction to execute the given statement on this Database. final <T extends Any> Deferred<T>transactionAsync(Database $self, SuspendFunction1<Transaction, T> statement)Start a new asynchronous transaction to execute the given statement on this Database. -
-
Method Detail
-
createHikariDataSource
final Lazy<DataSource> createHikariDataSource(PostgresConnection config, String applicationNameSuffix, Integer maxPoolSize)
Return a HikariDataSource for the given PostgresConnection.
-
checkDatabaseEncoding
final Unit checkDatabaseEncoding(Transaction $self, String expectedEncoding)
Logs a warning in case the actual database encoding does not equal the expectedEncoding.
-
tableExists
final Boolean tableExists(Transaction $self, String tableName)
Return true if and only if a table named tableName exists.
-
transaction
final <T extends Any> T transaction(Database $self, Function1<Transaction, T> statement)
Start a new transaction to execute the given statement on this Database.
-
transactionAsync
final <T extends Any> Deferred<T> transactionAsync(Database $self, SuspendFunction1<Transaction, T> statement)
Start a new asynchronous transaction to execute the given statement on this Database.
-
-
-
-