Interface Extension

All Known Subinterfaces:
CodecRegistrar
All Known Implementing Classes:
BuiltinDynamicCodecs

public interface Extension
Marker interface for all extensions.

An Extension can be registered programmatically through PostgresqlConnectionConfiguration or automatically using the ServiceLoader mechanism.

The global extension registration through Java's ServiceLoader mechanism, allows third-party extensions to be auto-detected and automatically registered based on what is available in the classpath.

Specifically, a custom extension can be registered by supplying its fully qualified class name in a file named io.r2dbc.postgresql.extension.Extension within the /META-INF/services directory in its enclosing JAR file.

Configuring Automatic Extension Detection

Auto-detection is enabled by default. To disable it, simply set the PostgresqlConnectionConfiguration.Builder.autodetectExtensions(boolean) parameter to false.

Constructor Requirements

Extension implementations must have a default constructor if registered via the ServiceLoader. When registered through PostgresqlConnectionConfiguration the default constructor is not required to be public. When registered via the ServiceLoader the default constructor must be public.