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.
- APIs on
Portalto support cursor operations. [#433]
- Changed default PID generate use sequential number [#431]
- Switch pg_interval crate to original [#432]
Syncmessage will no longer clear all portals but unnamed portal. [#433]
- New
ConnectionManager,PidSecretKeyGeneratorand newDefaultCancelHandlerfor our high-level query cancellation support. By configuringConnectionManagerandDefaultCancelHandler, we will provide default implementation for query cancel. Seeexamples/cancel.rsfor instance. [#427] - Add
Anytrait toPortalStoretrait to allow downcast and usage inSimpleQueryHandler[#421] - Add more error fields [#423]
- Add
session_extensionmechanism for extendingClientInfo[#409] - Experimental client API for extended query [#250]
- Make
StoredStatement::parsepublic for writing customExtendedQueryHandler[#425]
- Cleanup portals on SYNC message [#424]
- Removed size limit for ParameterDescription message [#418]
- Client API: SCRAM authentication [#414]
- Added more ISO datetime string format for timestamp, timestamptz and date types [#417]
- Panic when parsing non null terminated cstring [#407]
- CopyEncoder, PGCOPY protocol and full Copy out API support [#403]
- TLS handshake in client API [#400]
- ClientConfig compilation on Windows [#392]
- Resetting DecodeContext fields [#394]
FromSqlTextis no longer implemented forVec<T>, useVec<Option<T>>instead [#395]standard_string_conformingis always on now [#388]
- Issue with
postgresDateStyle [#387]
- Add auto
FromSqlTextimplementation forVec<Option<T>>where T isFromSqlText. We are going to removeFromSqlTextforVec<T>in next breaking release due to conflicts and lack of NULL semantic. [#385]
- New data type supported: PostGIS types [#382]
- New data type supported: Interval [#383]
- UDS server and client socket support [#381] [#379]
- Postgres 18 OAuth Authentication support [#349]
- More
ToSqlTextimplementations [#364]
- Deprecated
finish()and makeDataRowEncoderreusable for a massive performance gain [#366] - Parameter type and result schema functions added to
QueryParsertrait, for default implementation of describe statement and portal in ExtendedQueryHandler. This change allow us to provide postgres compatible default behavior for describing statement.[#356]
ToSqlTextfor String array with backslash and empty strings [#361]FromSqlTextfor timestamps [#363]
FromSqlTextimplementation for text and bytea arrays, with backslash or empty string [#361]FromSqlTextimplementation for date time when JDBC encode.0in timestamp string [#363]
FromSqlTextimplementation for timestamp array and timestamptz array. [#363]
- Fixed text decoding for
NaiveTimeandSystemTime. [#358]
- Add and correct more implements of
FromSqlText: new implementations are added forVec<Option<T>>where T isFromSqlText. Corrected parsing for timestamp and date types. [#353]
- Client provided parameter types are now stored as
Vec<Option<Type>>. If the OID of client provided type is 0, we useNonehere. Previously we will default toUNKNOWNtype but it has different semantics. [#350] - Extended query parameter parsing now respects format code, we will use
FromSqlTextto parse those types encoded as text. More type to be supported forFromSqlText. [#351] - Unnamed portal is automatically dropped when execution finished [#348]
- Issue with client-api when decoding data [#347]
- Customisible
DateStyle,IntervalStyle,extra_float_digitssupport.
- Updated
ToSqlTextandFromSqlTextinterface to include a newFormatOptionsfor postgres' additional options on text representation of some types.
- Exposed more functions from
pgwire::tokio::server. [#333]
- Removed
BufReaderwrapper on socket [#332]
- Update
pg_type_*feature flags topg-type-*following our previous naming pattern. [#331]
- Access SNI server name from
ClientInfo[#323] - Added encode API for
serde_json::Value/json in postgres [#321] - Added
DebugtoResponseenum [#325]
- No-op handlers now returns error [#319]
- Make
pgwire::tokio::serverpublic [#329]
- Potential busy loop with peeking data [#330]
- Portal suspension support, aka server-side cursor in extended query. This
feature allows client to send
Executewith amax_rowproperty to limit how many rows to return. Client can send furtherExecuteagainst the same portal until all rows returned. [#303]
- Simplified and removed lifetime specifier from
ResponseandQueryResponse. Breaking change. - Changed SCRAM authentication implementation. SASL is now a framework to support multiple authentication mechanisms. Breaking change. [#302]
- Added
Sendto client inStartupHandler. - Added
Debugrequirement forAuthSource.
scramfeature is removed, it's enabled with either ofringoraws-lc-rsis on.
- Correct packet length check [#295]
- Potential panic on direct TLS when it is not configured [#296]
- Timeout on getting startup message on Windows [#297]
- Added support for GSSAPI handshake. This fixes connection issue with psql 14 homebrew on Mac. [#290]
- Added authentication timeout (60s). Unauthenticated connection will be dropped after timeout. [#293]
- Added validation on packet length. [#292]
- Corrected typo for
MESSAGE_TYPE_BYTE_PASSWORD_MESSAGE_FAMILY
- The default implementation of
SimpleQueryHandler#on_query,ExtendedQueryHandler#on_executeandExtendedQueryHandler#on_describeand moved toSimpleQueryHandler#_on_query,ExtendedQueryHandler#_on_executeandExtendedQueryHandler#_on_describe. This allows you to reuse the implementation in your ownon_query/on_execute/on_describewithout copying the code. [#287]
NegotiateProtocolVersioncode and member visibility [#288]
- Initial support for Postgres 18 new proptocol version 3.2, and protocol negotiation for future protocol upgrades [#281]
- CancelRequest message and initial (unstable) API, made backend key and secret key configurable by user [#266] [#267]
- Updated
PgWireServerHandlersto useimpl traitstyle return value, this allow us to define default implementation easier, which requires less boilerplate code. [#269] - Updated message decode functions to take an additional
DecodeContext. It provides some state information like protocol version, connection state, with which we can not decodeSslRequest,Startupmessages in thedecodefunction. [#282] - Using
arrow-pgcrate for duckdb example [#273]
- Add
QUOTE_CHECKandQUOTE_ESCAPEback to types public APIs [#264]
- Set chrono version to
0.4as we don't require features in0.4.40
- Lifetime specifier of do_query methods in query handlers, it doesn't have to be same with query input at all [#260]
- Provide
ClientInfotoQueryParserfor context-aware parsing [#263]
- Scram authentication failure error [#257]
- Released version restrictions on chrono [#259]
- New API
client_certificatesinClientInfofor retrieving clietn certificate information. [#255] - A few unfinished client API. These APIs are disabled with feature gate by default.
- Reverted API change for optional TLS feature introduced in 0.27. Now the API
signature stays unchanged when TLS disabled, you will still need to pass
NoneasTlsAcceptorinprocess_socket. [#228] - Previously we treat all error as fatal internal error but some of them are due
to client invalid input. This version corrected this and return
ERRORfor these type of errors. [#240] - For direct SSL negotiation, we now check ALPN strictly. [#243]
- Changed default server_version format for compatibility. [#233]
- Avoid panic for
get_stringon empty buffer [#247]
ErrorHandlerfor centralized error processing [#222]
PgWireHandlerFactoryis renamed toPgWireServerHandlersto avoid confusion. This trait doesn't require generating new instance for each call. [#226]
- Text encoding for bytea type [#224]
on_flushhandler for extended query handler [#220]
Parsemessage encoding [#219]
- MSRV to 1.75
- Made TLS an optional feature.
server-apinow provides no TLS functionality [#218]
- New
Responsetype for transforming transaction state:TransactionStartandTransactionEnd. [#200]
- oid output for tags [#211]
- array type serialization [#212]
- Update MSRV to 1.74
- Breaking: Rewrite
NoopStartupHandlerto 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_startupimplementation.
- Dead-loop when client connects without send packets or sending insufficient bytes [#206], [#207]
- Removed unneeded
Arcfor handler factory [#202] PgWireFrontendMessage::SslRequestnow carries an optionalSslRequestmessage whereNoneindicates the client doesn't issueSslRequestand starts directly. [#207]- Add
AwaitingSslRequeststate. [#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]
ToSqlTextsupport 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
CopyInProgressforPgWireConnectionStateto track connection in COPY - Changed
on_copy_failinCopyHandlerto return anErroras Postgres document specified. - Corrected behaviour for error handling when COPY is initialized via extended subprotocol.
- Added
- New
CopyHandlerAPI for processing postgresCOPY-in operations.
- Updated the API of
pgwire::tokio::process_socketto accept newPgWireHandlerFactoryinstead of each subprotocol handler individually, to keep API clean, also reduce some of boilerplate code. MakeHandlertrait and its implementation are removed. You will need to implement those logic with newPgWireHandlerFactory. For stateful handlers, like mostExtenededQueryHandlerimplementations, 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-rsbased crypto backend is the default when using TLS or SCRAM. Usedefault-features=falseandserver-api-ringto use the ring backend. [#179]- Use
default-features=falseif 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_describeAPI fromExtendedQueryHandlerto more specificdo_descirbe_statementanddo_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
Parsecommand when using pgcli client [#152] - Remove
'staticbound for handler implementations [#149]
- Simple query client blocks on error [#148]
- Updated
Tagconstructors for including ObjectID. [#147] - Removed some getters and setters, use direct field access. [#144]
- Message sequences fixes [#145] [#146]
- Associated
PortalStoreto client as how PostgreSQL is designed. This is a regression design issue introduced in0.8.
- Added
SslRequestandSslResponsemessage [#116] [#117] - Added
NotificationResponsemessage for PostgresLISTEN/NOTIFYfeature [#136] - Added encoding support for array data type [#130]
- Allow sending custom message from
SimpleQueryHandlerby changingClientreference to mutable [#133] - Updated tokio-rustls to 0.25 [#135]
- Using
feedfor sending response [#128]
- Fixed message decode for
flush[#113] - Add a fix for potential panic on
startup. [#112]
- Changed
Portal::parameterfunction to require a&Typeargument 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
DefaultServerParameterProviderAPI to allow modification of built-in parameters. [#97]
- Codecs for
Copymessages. [#91]
- Made
parse_sqlfromQueryParseran async function because some implementation requires async operation [#96]
- Corrected how server handler responds
Syncmessage. Fixed compatibility with rust sqlx client. #90
- Exposed
send_describe_responseandsend_execution_responseas helper functions for customExtendedQueryHandlerimplementation.
tcp_nodelayis turned on by default within pgwire for performance consideration.- Changed getters of
QueryResponseto return owned data.
- A new helper function
send_query_responseis added for convenience of custom query handler implementation
- Message
NoDatathat sends from backend whenDescribesent on an empty query. - Add
EmptyQuerytoResponseenum to represent response for empty query. - Add
no_dataconstructor toDescribeResponsefor empty query.
- Improved empty query check for
SimpleQueryHandler. #75
ToSqlTexttrait and default implementation for some types. This trait is similar toToSqlfrompostgres-typespackage. It provide text format encoding whileToSqlare binary by default.
- Updated
DataRowEncoderencode API with unifiedencode_fieldfor both binary and text encoding.DataRowEncoder::newnow acceptsArc<Vec<FieldInfo>>instead of column count. The encoder now has type and format information for each column.encode_fieldno longer requiresTypeandFieldFormat. A newencode_field_with_type_and_formatis provided for custom use-case. - Updated
do_describeAPI fromExtendedQueryHandlerto include full information about requestedStatementorPortal. query_responsefunction is replaced byQueryResponse::new
- lifetime binding in
on_queryfunctions 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_datetimesparameter on startup so clients like jdbc will parse time types as integer. DescribeResponsethat contains information for bothParameterDescriptionandRowDescription.
- Update
do_describeofExtendedQueryHandler. Add new bool argumentinference_parametersto check if parameter types from statement is required to return. - Updated resultset
Response::QueryResponselifetime from'staticto portal or query string, this allows reference of portal in stream.
- The default implementation of
ExtendedQueryHandlernow correctly respondsClosemessage 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_socketto acceptStartupHandler,SimpleQueryHandlerandExtendedQueryHandler.MakeHandlershould be called upon new socket incoming. Check our updated examples for usage. - Removed
Password,SASLInitialResponseandSASLResponsefrom frontend message enum to avoid confusion.PasswordMessageFamilyis 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.
ParseandBindcompletion response is now fixed- Responding statement describe request with parameter description, and ready for query
- Updated
QueryParserAPI to provide parameter types for implementation. - Updated
PortalAPI, it now holdsArcreference to relatedStoredStatement. - Updated
ExtendedQueryHandler::do_describearguments, it now takes a borrowedStoredStatement. Compared to previews API, parameter types are provided as well. - Renamed
StoredStatement::type_oids()toparameter_types()
ExtendedQueryHandlertrait now has two new component:PortalStoreandQueryParser.PortalStorereplaced statement and portal cache onClientInfo, these data will now be cached withPortalStorefromExtendedQueryHandlerimplementation.- A default
PortalStoreimplementation,MemPortalStore, is provided for most usecase. StatementAPI now renamed toStoredStatement. The new API holds parsed statement fromQueryParserimplementation.PortalAPI, like it's statement counterpart, no longer stores statement as string, it shares same statement type withStoredStatement,QueryParserandExtendedQueryHandler.PasswordVerifierandAuthDBare now merged intoAuthSourceAPI. 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-PLUSauthentication is supported when you provide server certificate.do_describeis added toExtendedQueryHandler, now it's possible toDescribea statement or portal without execution. The implementation is also required to be capable with this.DefaultServerParameterProviderimplementation is provided to include minimal parameters for JDBC and psycopg2 working.PlaceholderExtendedQueryHandlerto simplify example and demo when extended query is not supported.Flushmessage added. @penberg