- Added support for
uuid1.0 via thewith-uuid-1feature.
- Added
SimpleQueryRow::columns. - Added support for
eui481.0 via thewith-eui48-1feature. - Added
FromSqlandToSqlimplementations for arrays via thearray-implsfeature. - Added support for
time0.3 via thewith-time-0_3feature.
- Added support for
geo-types0.7 viawith-geo-types-0_7feature. - Added
Client::clear_type_cache.
- Upgraded to
tokio-postgres0.7. - Methods taking iterators of
ToSqlvalues can now take both&dyn ToSqlandT: ToSqlvalues.
- Added
Client::is_validwhich can be used to check that the connection is still alive with a timeout.
- Restored the
Sendimplementation forClient.
- Upgraded to
tokio-postgres0.6.
- Added
Config::notice_callback, which can be used to provide a custom callback for notices.
- Fixed client shutdown to explicitly terminate the database session.
- Fixed transactions to roll back immediately on drop.
- Added support for
geo-types0.6.
- Errors sent by the server will now be returned from
Clientmethods rather than just being logged.
- Added
Transaction::savepoint, which can be used to create a savepoint with a custom name. - Added
Client::notifications, which returns an interface to the notifications sent by the server.
- Added
Debugimplementations forClient,Row, andColumn. - Added
time0.2 support.
- Added
Client::build_transactionto allow configuration of various transaction options. - Added
Client::cancel_token, which returns a separate owned object that can be used to cancel queries. - Added accessors for
Configfields. - Added a
GenericClienttrait implemented forClientandTransactionand covering shared functionality.
- Each
Clientnow has its own non-threaded tokioRuntimerather than sharing a global threadedRuntime. This significantly improves performance by minimizing context switches and cross-thread synchronization. Client::copy_innow returns a writer rather than taking in a reader.Client::query_rawnow returns a named type.Client::copy_inandClient::copy_outno longer take query parameters as PostgreSQL doesn't support them in COPY queries.
- Removed support for
uuid0.7.
- Added
Client::query_optfor queries that are expected to return zero or one rows. - Added binary copy support in the
binary_copymodule. - The
fallible-iteratorcrate is now publicly reexported.
- Changed
Config::executortoConfig::spawner.
- Added support for
uuid0.8. - Added
Transaction::query_one.
- Updated
tokio-postgresto 0.5.0-alpha.1.
- Documentation fixes
-
Connectionhas been renamed toClient. -
The
Clienttype is now a thin wrapper around the tokio-postgres nonblocking client. By default, this is handled transparently by spawning connections onto an internal tokioRuntime, but this can also be controlled explicitly. -
The
ConnectParamstype andIntoConnectParamstrait have been replaced by a builder-styleConfigtype.Before:
let params = ConnectParams::builder() .user("postgres", None) .build(Host::Tcp("localhost".to_string())) .build(); let conn = Connection::connect(params, &TlsMode::None)?;
After:
let client = Client::configure() .user("postgres") .host("localhost") .connect(NoTls)?;
-
The TLS connection mode (e.g.
prefer) is now part of the connection configuration instead of being passed in separately.Before:
let conn = Connection::connect("postgres://postgres@localhost", &TlsMode::Prefer(connector))?;
After:
let client = Client::connect("postgres://postgres@localhost?sslmode=prefer", connector)?;
-
ClientandTransactionmethods take&mut selfrather than&self, and correct use of the active transaction is verified at compile time rather than runtime. -
Rowno longer borrows any data. -
Statementis now a "token" which is passed into methods onClientandTransactionand does not borrow the client:Before:
let statement = conn.prepare("SELECT * FROM foo WHERE bar = $1")?; let rows = statement.query(&[&1i32])?;
After:
let statement = client.prepare("SELECT * FROM foo WHERE bar = $1")?; let rows = client.query(&statement, &[1i32])?;
-
Statement::lazy_queryhas been replaced withTransaction::bind, which returns aPortaltype that can be used withTransaction::query_portal. -
Statement::copy_inandStatement::copy_outhave been moved toClientandTransaction. -
Client::copy_outandTransaction::copy_outnow return aReader rather than consuming in aWriter. -
Connection::batch_executeandTransaction::batch_executehave been replaced withClient::simple_queryandTransaction::simple_query. -
The Cargo features enabling
ToSqlandFromSqlimplementations for external crates are now versioned. For example,with-uuidis nowwith-uuid-0_7. This enables us to add support for new major versions of the crates in parallel without breaking backwards compatibility.
- Connection string configuration now more fully mirrors libpq's syntax, and supports both URL-style and key-value style strings.
FromSqlimplementations can now borrow from the data buffer. In particular, this means that you can deserialize values as&str. TheFromSqlOwnedtrait can be used as a bound to restrict code to deserializing owned values.- Added support for channel binding with SCRAM authentication.
- Added multi-host support in connection configuration.
- Added support for simple query requests returning row data.
- Added variants of query methods which return fallible iterators of values and avoid fully buffering the response in memory.
- The
with-opensslandwith-native-tlsCargo features have been removed. Use thetokio-postgres-opensslandtokio-postgres-native-tlscrates instead. - The
with-rustc_serializeandwith-timeCargo features have been removed. UseserdeandSystemTimeorchronoinstead. - The
Transaction::set_commitandTransaction::set_rollbackmethods have been removed. The only way to commit a transaction is to explicitly consume it viaTransaction::commit. - The
Rowstype has been removed; methods now returnVec<Row>instead. Connection::prepare_cachehas been removed, asStatementis now'staticand can be more easily cached externally.- Some other slightly more obscure features have been removed in the initial release. If you depended on them, please file an issue and we can find the right design to add them back!
Look at the release tags for information about older releases.