com.clickhouse.r2dbc.connection.ClickHouseConnectionFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clickhouse-r2dbc Show documentation
Show all versions of clickhouse-r2dbc Show documentation
R2DBC driver for ClickHouse
package com.clickhouse.r2dbc.connection;
import java.util.function.Function;
import com.clickhouse.client.ClickHouseNode;
import com.clickhouse.client.ClickHouseNodeSelector;
import io.r2dbc.spi.Connection;
import io.r2dbc.spi.ConnectionFactory;
import io.r2dbc.spi.ConnectionFactoryMetadata;
import reactor.core.publisher.Mono;
public class ClickHouseConnectionFactory implements ConnectionFactory {
private final Function nodes;
ClickHouseConnectionFactory(Function nodes) {
this.nodes = nodes;
}
@Override
public Mono extends Connection> create() {
return Mono.just(new ClickHouseConnection(nodes));
}
@Override
public ConnectionFactoryMetadata getMetadata() {
return ClickHouseConnectionFactoryMetadata.INSTANCE;
}
}