Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

r2dbc-postgresql

> 前端框架
Open source

Postgresql R2DBC Driver

1.1K stars0 likes0 views
WebsiteGitHub

About

Postgresql R2DBC Driver

PostgreSQL R2DBC Driver

This project contains the PostgreSQL implementation of the R2DBC SPI. This implementation is not intended to be used directly, but rather to be used as the backing implementation for a humane client library to delegate to.

This driver provides the following features:

  • Implements R2DBC 1.0
  • Login with username/password (MD5, SASL/SCRAM) or implicit trust
  • Supports credential rotation by providing Supplier or Publisher
  • SCRAM authentication
  • Unix Domain Socket transport
  • Connection Fail-over supporting multiple hosts
  • TLS
  • Explicit transactions
  • Notifications
  • Logical Decode
  • Binary data transfer
  • Execution of prepared statements with bindings
  • Execution of batch statements without bindings
  • Read and write support for a majority of data types (see Data Type Mapping for details)
  • Fetching of REFCURSOR using io.r2dbc.postgresql.api.RefCursor
  • Extension points to register Codecs to handle additional PostgreSQL data types

Next steps:

  • Multi-dimensional arrays

Code of Conduct

This project is governed by the Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected].

Getting Started

Here is a quick teaser of how to use R2DBC PostgreSQL in Java:

URL Connection Factory Discovery

ConnectionFactory connectionFactory = ConnectionFactories.get("r2dbc:postgresql://:5432/");

Publisher connectionPublisher = connectionFactory.create();

Programmatic Connection Factory Discovery

…

Supported ConnectionFactory Discovery Options

Option Description
ssl Enables SSL usage (SSLMode.VERIFY_FULL).
driver Must be postgresql.
protocol Protocol specifier. Empty to use single-host operations. Supported: failover for multi-server failover operations. (Optional)
host Server hostname to connect to. May contain a comma-separated list of hosts with ports when using the failover protocol.
port Server port to connect to. Defaults to 5432. (Optional)
socket Unix Domain Socket path to connect to as alternative to TCP. (Optional)
username Login username. Can be a plain String, Supplier, or Publisher.
password Login password. Can be a plain CharSequence, Supplier, or Publisher. (Optional when using TLS Certificate authentication)
database Database to select. (Optional)
applicationName The name of the application connecting to the database. Defaults to r2dbc-postgresql. (Optional)
autodetectExtensions Whether to auto-detect and register Extensions from the class path. Defaults to true. (Optional)
channelBinding Channel binding mode for SCRAM (SASL) authentication, see ChannelBindingMode enum. Supported values: disable, prefer, require. Defaults to prefer. Use require to fail authentication unless the connection is encrypted and the server offers SCRAM-SHA-256-PLUS, preventing a silent downgrade. (Optional)
compatibilityMode Enable compatibility mode for cursored fetching. Required when using newer pgpool versions. Defaults to false. (Optional)
errorResponseLogLevel Log level for error responses. Any of OFF, DEBUG, INFO, WARN or ERROR Defaults to DEBUG. (Optional)
extensions Collection of Extension to provide additional extensions when creating a connection factory. Defaults to empty. (Optional)
fetchSize The default number of rows to return when fetching results. Defaults to 0 for unlimited. (Optional)
forceBinary Whether to force binary transfer. Defaults to false. (Optional)
hostRecheckTime Host status recheck time when using multi-server operations. Defaults to 10 seconds. (Optional)
loadBalanceHosts Whether to shuffle the list of given hostnames before connect when using multi-server operations. Defaults to true. (Optional)
loopResources TCP/Socket LoopResources (depends on the endpoint connection type). (Optional)
lockWaitTimeout Lock wait timeout. (Optional)
maxMessageSize Maximum size (in bytes) of a single protocol message/frame received from the server. Frames whose announced length exceeds this fail the connection instead of being buffered. Defaults to effectively unbounded. Keep it above the largest expected row or COPY chunk (field values may reach 1 GB). (Optional)
noticeLogLevel Log level for error responses. Any of OFF, DEBUG, INFO, WARN or ERROR Defaults to DEBUG. (Optional)
preferAttachedBuffers Configure whether codecs should prefer attached data buffers. The default is false, meaning that codecs will copy data from the input buffer into a byte array. Enabling attached buffers requires consumption of values such as Json to avoid memory leaks.
preparedStatementCacheQueries Determine the number of queries that are cached in each connection. The default is -1, meaning there's no limit. The value of 0 disables the cache. Any other value specifies the cache size.
options A Map of connection parameters. These are applied to each database connection created by the ConnectionFactory. Useful for setting generic [PostgreSQL connection parameters][psql-runtime-config]. (Optional)
schema The search path to set. (Optional)

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javadatabasejavapostgresqlreactive

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架