io.r2dbc.postgresql.PostgresqlConnectionFactoryProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of r2dbc-postgresql Show documentation
Show all versions of r2dbc-postgresql Show documentation
Reactive Relational Database Connectivity Driver Implementation for Postgresql
/*
* Copyright 2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.r2dbc.postgresql;
import io.netty.handler.ssl.SslContextBuilder;
import io.r2dbc.postgresql.client.DefaultHostnameVerifier;
import io.r2dbc.postgresql.client.SSLMode;
import io.r2dbc.postgresql.codec.Codecs;
import io.r2dbc.postgresql.codec.Json;
import io.r2dbc.postgresql.util.Assert;
import io.r2dbc.spi.ConnectionFactoryOptions;
import io.r2dbc.spi.ConnectionFactoryProvider;
import io.r2dbc.spi.Option;
import reactor.netty.resources.LoopResources;
import javax.net.ssl.HostnameVerifier;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.Function;
import static io.r2dbc.spi.ConnectionFactoryOptions.CONNECT_TIMEOUT;
import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE;
import static io.r2dbc.spi.ConnectionFactoryOptions.DRIVER;
import static io.r2dbc.spi.ConnectionFactoryOptions.HOST;
import static io.r2dbc.spi.ConnectionFactoryOptions.PASSWORD;
import static io.r2dbc.spi.ConnectionFactoryOptions.PORT;
import static io.r2dbc.spi.ConnectionFactoryOptions.SSL;
import static io.r2dbc.spi.ConnectionFactoryOptions.USER;
/**
* An implementation of {@link ConnectionFactoryProvider} for creating {@link PostgresqlConnectionFactory}s.
*/
public final class PostgresqlConnectionFactoryProvider implements ConnectionFactoryProvider {
/**
* Application name.
*/
public static final Option APPLICATION_NAME = Option.valueOf("applicationName");
/**
* Auto-detect extensions.
*/
public static final Option AUTODETECT_EXTENSIONS = Option.valueOf("autodetectExtensions");
/**
* Compatibility query mode for cursored query execution.
*
* @since 0.8.7
*/
public static final Option COMPATIBILITY_MODE = Option.valueOf("compatibilityMode");
/**
* Fetch Size.
*/
public static final Option FETCH_SIZE = Option.valueOf("fetchSize");
/**
* Force binary transfer.
*/
public static final Option FORCE_BINARY = Option.valueOf("forceBinary");
/**
* Event {@link LoopResources}.
*
* @since 0.8.5
*/
public static final Option LOOP_RESOURCES = Option.valueOf("loopResources");
/**
* Connection options which are applied once after the connection has been created.
*/
public static final Option