All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- New
Response
type for transforming transaction state:TransactionStart
andTransactionEnd
. [#200]
- oid output for tags [#211]
- array type serialization [#212]
- Update MSRV to 1.74
- Breaking: Rewrite
NoopStartupHandler
to be a trait. You can provide an empty implementation to keep original behaviour. And it's now possible to customize some behaviour by adding apost_startup
implementation.
- Dead-loop when client connects without send packets or sending insufficient bytes [#206], [#207]
- Removed unneeded
Arc
for handler factory [#202] PgWireFrontendMessage::SslRequest
now carries an optionalSslRequest
message whereNone
indicates the client doesn't issueSslRequest
and starts directly. [#207]- Add
AwaitingSslRequest
state. [#207]
- Array encoding issues for date and time types [#194]
- String array quote and escape [#198]
- Codec error when decoding authentication messages [#190]
- Codec error when decoding parameters larger than 32767 [#192]
- Panic when client sends invalid authentication message type [#191]
ToSqlText
support forDecimal
[#186]- Direct SSL startup, a new feature introduced in PostgreSQL 17. It allows ssl handshake once tcp connected, which saves a roundtrip on secure connection startup. [#189]
- Improvement our API for COPY. [#185]
- Added
CopyInProgress
forPgWireConnectionState
to track connection in COPY - Changed
on_copy_fail
inCopyHandler
to return anError
as Postgres document specified. - Corrected behaviour for error handling when COPY is initialized via extended subprotocol.
- Added
- New
CopyHandler
API for processing postgresCOPY
-in operations.
- Updated the API of
pgwire::tokio::process_socket
to accept newPgWireHandlerFactory
instead of each subprotocol handler individually, to keep API clean, also reduce some of boilerplate code. MakeHandler
trait and its implementation are removed. You will need to implement those logic with newPgWireHandlerFactory
. For stateful handlers, like mostExtenededQueryHandler
implementations, it need to be created for every call toextended_query_handler
. For stateless ones, it can be cached.
- Include API usage on random nonce generate [#182]
- SCRAM authenticator is now an optional feature that is turned off by
default. To use SCRAM authenticator, add feature flag
scram
. [#180] aws-lc-rs
based crypto backend is the default when using TLS or SCRAM. Usedefault-features=false
andserver-api-ring
to use the ring backend. [#179]- Use
default-features=false
if you only uses message codecs from this library. [#177] - BREAKING CHANGE: ready state code is now presented in enum
TransactionStatus
. There is an update ofReadyForQuery
'snew
. [#176]
- panic when decoding SASL messages [#175]
- You can now customize command tag for
QueryResponse
. [#173]
- Text representation of NULL values in array, and bool values are now fixed to align with postgres. [#174]
- Changed
do_describe
API fromExtendedQueryHandler
to more specificdo_descirbe_statement
anddo_describe_portal
. This is a breaking change, see sqlite example for how to migrate. [#164] - Improved performance of
DataRowEncoder
, updated how we store data inDataRow
. Breaking change for message layer users. [#165] [#166]
- Error on
Parse
command when using pgcli client [#152] - Remove
'static
bound for handler implementations [#149]
- Simple query client blocks on error [#148]
- Updated
Tag
constructors for including ObjectID. [#147] - Removed some getters and setters, use direct field access. [#144]
- Message sequences fixes [#145] [#146]
- Associated
PortalStore
to client as how PostgreSQL is designed. This is a regression design issue introduced in0.8
.
- Added
SslRequest
andSslResponse
message [#116] [#117] - Added
NotificationResponse
message for PostgresLISTEN/NOTIFY
feature [#136] - Added encoding support for array data type [#130]
- Allow sending custom message from
SimpleQueryHandler
by changingClient
reference to mutable [#133] - Updated tokio-rustls to 0.25 [#135]
- Using
feed
for sending response [#128]
- Fixed message decode for
flush
[#113] - Add a fix for potential panic on
startup
. [#112]
- Changed
Portal::parameter
function to require a&Type
argument for deserialization. Previously we relies on client specified types but it doesn't work when the client driver requires type inference on server-side. The new function signature allows you to provide an type. [#106] - Changed
DefaultServerParameterProvider
API to allow modification of built-in parameters. [#97]
- Codecs for
Copy
messages. [#91]
- Made
parse_sql
fromQueryParser
an async function because some implementation requires async operation [#96]
- Corrected how server handler responds
Sync
message. Fixed compatibility with rust sqlx client. #90
- Exposed
send_describe_response
andsend_execution_response
as helper functions for customExtendedQueryHandler
implementation.
tcp_nodelay
is turned on by default within pgwire for performance consideration.- Changed getters of
QueryResponse
to return owned data.
- A new helper function
send_query_response
is added for convenience of custom query handler implementation
- Message
NoData
that sends from backend whenDescribe
sent on an empty query. - Add
EmptyQuery
toResponse
enum to represent response for empty query. - Add
no_data
constructor toDescribeResponse
for empty query.
- Improved empty query check for
SimpleQueryHandler
. #75
ToSqlText
trait and default implementation for some types. This trait is similar toToSql
frompostgres-types
package. It provide text format encoding whileToSql
are binary by default.
- Updated
DataRowEncoder
encode API with unifiedencode_field
for both binary and text encoding.DataRowEncoder::new
now acceptsArc<Vec<FieldInfo>>
instead of column count. The encoder now has type and format information for each column.encode_field
no longer requiresType
andFieldFormat
. A newencode_field_with_type_and_format
is provided for custom use-case. - Updated
do_describe
API fromExtendedQueryHandler
to include full information about requestedStatement
orPortal
. query_response
function is replaced byQueryResponse::new
- lifetime binding in
on_query
functions if the implementation has its own lifetime specifier
Further improve extended query support. Now the server can respond statement describe correctly.
- Add some docs.
- Add
integer_datetimes
parameter on startup so clients like jdbc will parse time types as integer. DescribeResponse
that contains information for bothParameterDescription
andRowDescription
.
- Update
do_describe
ofExtendedQueryHandler
. Add new bool argumentinference_parameters
to check if parameter types from statement is required to return. - Updated resultset
Response::QueryResponse
lifetime from'static
to portal or query string, this allows reference of portal in stream.
- The default implementation of
ExtendedQueryHandler
now correctly respondsClose
message withCloseComplete
- Correct SCRAM mechanism name in plain connection
This release reverts design to use MakeHandler
in process_socket
, since it
stops shared implementation between StartupHandler
and query handlers.
- Update
process_socket
to acceptStartupHandler
,SimpleQueryHandler
andExtendedQueryHandler
.MakeHandler
should be called upon new socket incoming. Check our updated examples for usage. - Removed
Password
,SASLInitialResponse
andSASLResponse
from frontend message enum to avoid confusion.PasswordMessageFamily
is now an enum that contains all these message forms and a raw form. This is because in postgres protocol, password message can only be decoded into concrete type when there is a context. See our MD5 and SCRAM authenticator for usage.
Fixes compatibility with rust-postgres client's prepared statement
implementation. It sends Parse-Describe-Sync on Client::prepare_typed
.
Parse
andBind
completion response is now fixed- Responding statement describe request with parameter description, and ready for query
- Updated
QueryParser
API to provide parameter types for implementation. - Updated
Portal
API, it now holdsArc
reference to relatedStoredStatement
. - Updated
ExtendedQueryHandler::do_describe
arguments, it now takes a borrowedStoredStatement
. Compared to previews API, parameter types are provided as well. - Renamed
StoredStatement::type_oids()
toparameter_types()
ExtendedQueryHandler
trait now has two new component:PortalStore
andQueryParser
.PortalStore
replaced statement and portal cache onClientInfo
, these data will now be cached withPortalStore
fromExtendedQueryHandler
implementation.- A default
PortalStore
implementation,MemPortalStore
, is provided for most usecase. Statement
API now renamed toStoredStatement
. The new API holds parsed statement fromQueryParser
implementation.Portal
API, like it's statement counterpart, no longer stores statement as string, it shares same statement type withStoredStatement
,QueryParser
andExtendedQueryHandler
.PasswordVerifier
andAuthDB
are now merged intoAuthSource
API. The new API asks developer to fetch password and an optional salt. The password can either be hashed or cleattext, depends on which authentication mechanism is used.
SCRAM-SHA-256-PLUS
authentication is supported when you provide server certificate.do_describe
is added toExtendedQueryHandler
, now it's possible toDescribe
a statement or portal without execution. The implementation is also required to be capable with this.DefaultServerParameterProvider
implementation is provided to include minimal parameters for JDBC and psycopg2 working.PlaceholderExtendedQueryHandler
to simplify example and demo when extended query is not supported.Flush
message added. @penberg