ru.tinkoff.kora.database.r2dbc.R2dbcDatabaseModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of database-r2dbc Show documentation
Show all versions of database-r2dbc Show documentation
Kora database-r2dbc module
The newest version!
package ru.tinkoff.kora.database.r2dbc;
import io.r2dbc.spi.ConnectionFactoryOptions;
import ru.tinkoff.kora.application.graph.All;
import ru.tinkoff.kora.config.common.Config;
import ru.tinkoff.kora.config.common.extractor.ConfigValueExtractor;
import ru.tinkoff.kora.database.common.telemetry.DataBaseTelemetryFactory;
import java.util.function.Function;
public interface R2dbcDatabaseModule extends R2dbcModule {
default R2dbcDatabaseConfig r2dbcConfig(Config config, ConfigValueExtractor extractor) {
var value = config.get("db");
return extractor.extract(value);
}
default R2dbcDatabase r2dbcDatabase(R2dbcDatabaseConfig config, All> customizers, DataBaseTelemetryFactory telemetryFactory) {
return new R2dbcDatabase(
config,
customizers,
telemetryFactory
);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy