1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
|
# Change Log
## Unreleased
## v0.19.9 - 2024-09-15
### Added
* Added support for `jiff` 0.1 via the `with-jiff-01` feature.
## v0.19.8 - 2024-07-21
### Added
* Added `{Client, Transaction, GenericClient}::query_typed`.
## v0.19.7 - 2023-08-25
## Fixed
* Defered default username lookup to avoid regressing `Config` behavior.
## v0.19.6 - 2023-08-19
### Added
* Added support for the `hostaddr` config option to bypass DNS lookups.
* Added support for the `load_balance_hosts` config option to randomize connection ordering.
* The `user` config option now defaults to the executing process's user.
## v0.19.5 - 2023-03-27
### Added
* Added `keepalives_interval` and `keepalives_retries` config options.
* Added the `tcp_user_timeout` config option.
* Added `RowIter::rows_affected`.
### Changed
* Passing an incorrect number of parameters to a query method now returns an error instead of panicking.
## v0.19.4 - 2022-08-21
### Added
* Added `ToSql` and `FromSql` implementations for `[u8; N]` via the `array-impls` feature.
* Added support for `smol_str` 0.1 via the `with-smol_str-01` feature.
* Added `ToSql::encode_format` to support text encodings of parameters.
## v0.19.3 - 2022-04-30
### Added
* Added support for `uuid` 1.0 via the `with-uuid-1` feature.
## v0.19.2 - 2021-09-29
### Added
* Added `SimpleQueryRow::columns`.
* Added support for `eui48` 1.0 via the `with-eui48-1` feature.
* Added `FromSql` and `ToSql` implementations for arrays via the `array-impls` feature.
* Added support for `time` 0.3 via the `with-time-0_3` feature.
## v0.19.1 - 2021-04-03
### Added
* Added support for `geo-types` 0.7 via `with-geo-types-0_7` feature.
* Added `Client::clear_type_cache`.
## v0.19.0 - 2020-12-25
### Changed
* Upgraded to `tokio-postgres` 0.7.
* Methods taking iterators of `ToSql` values can now take both `&dyn ToSql` and `T: ToSql` values.
### Added
* Added `Client::is_valid` which can be used to check that the connection is still alive with a
timeout.
## v0.18.1 - 2020-10-19
### Fixed
* Restored the `Send` implementation for `Client`.
## v0.18.0 - 2020-10-17
### Changed
* Upgraded to `tokio-postgres` 0.6.
### Added
* Added `Config::notice_callback`, which can be used to provide a custom callback for notices.
### Fixed
* Fixed client shutdown to explicitly terminate the database session.
## v0.17.5 - 2020-07-19
### Fixed
* Fixed transactions to roll back immediately on drop.
## v0.17.4 - 2020-07-03
### Added
* Added support for `geo-types` 0.6.
## v0.17.3 - 2020-05-01
### Fixed
* Errors sent by the server will now be returned from `Client` methods rather than just being logged.
### Added
* 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.
## v0.17.2 - 2020-03-05
### Added
* Added `Debug` implementations for `Client`, `Row`, and `Column`.
* Added `time` 0.2 support.
## v0.17.1 - 2020-01-31
### Added
* Added `Client::build_transaction` to 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 `Config` fields.
* Added a `GenericClient` trait implemented for `Client` and `Transaction` and covering shared functionality.
## v0.17.0 - 2019-12-23
### Changed
* Each `Client` now has its own non-threaded tokio `Runtime` rather than sharing a global threaded `Runtime`. This
significantly improves performance by minimizing context switches and cross-thread synchronization.
* `Client::copy_in` now returns a writer rather than taking in a reader.
* `Client::query_raw` now returns a named type.
* `Client::copy_in` and `Client::copy_out` no longer take query parameters as PostgreSQL doesn't support them in COPY
queries.
### Removed
* Removed support for `uuid` 0.7.
### Added
* Added `Client::query_opt` for queries that are expected to return zero or one rows.
* Added binary copy support in the `binary_copy` module.
* The `fallible-iterator` crate is now publicly reexported.
## v0.17.0-alpha.2 - 2019-11-27
### Changed
* Changed `Config::executor` to `Config::spawner`.
### Added
* Added support for `uuid` 0.8.
* Added `Transaction::query_one`.
## v0.17.0-alpha.1 - 2019-10-14
### Changed
* Updated `tokio-postgres` to 0.5.0-alpha.1.
## v0.16.0-rc.2 - 2019-06-29
### Fixed
* Documentation fixes
## v0.16.0-rc.1 - 2019-04-06
### Changed
* `Connection` has been renamed to `Client`.
* The `Client` type is now a thin wrapper around the tokio-postgres nonblocking client. By default, this is handled
transparently by spawning connections onto an internal tokio `Runtime`, but this can also be controlled explicitly.
* The `ConnectParams` type and `IntoConnectParams` trait have been replaced by a builder-style `Config` type.
Before:
```rust
let params = ConnectParams::builder()
.user("postgres", None)
.build(Host::Tcp("localhost".to_string()))
.build();
let conn = Connection::connect(params, &TlsMode::None)?;
```
After:
```rust
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:
```rust
let conn = Connection::connect("postgres://postgres@localhost", &TlsMode::Prefer(connector))?;
```
After:
```rust
let client = Client::connect("postgres://postgres@localhost?sslmode=prefer", connector)?;
```
* `Client` and `Transaction` methods take `&mut self` rather than `&self`, and correct use of the active transaction is
verified at compile time rather than runtime.
* `Row` no longer borrows any data.
* `Statement` is now a "token" which is passed into methods on `Client` and `Transaction` and does not borrow the
client:
Before:
```rust
let statement = conn.prepare("SELECT * FROM foo WHERE bar = $1")?;
let rows = statement.query(&[&1i32])?;
```
After:
```rust
let statement = client.prepare("SELECT * FROM foo WHERE bar = $1")?;
let rows = client.query(&statement, &[1i32])?;
```
* `Statement::lazy_query` has been replaced with `Transaction::bind`, which returns a `Portal` type that can be used
with `Transaction::query_portal`.
* `Statement::copy_in` and `Statement::copy_out` have been moved to `Client` and `Transaction`.
* `Client::copy_out` and `Transaction::copy_out` now return a `Read`er rather than consuming in a `Write`r.
* `Connection::batch_execute` and `Transaction::batch_execute` have been replaced with `Client::simple_query` and
`Transaction::simple_query`.
* The Cargo features enabling `ToSql` and `FromSql` implementations for external crates are now versioned. For example,
`with-uuid` is now `with-uuid-0_7`. This enables us to add support for new major versions of the crates in parallel
without breaking backwards compatibility.
### Added
* Connection string configuration now more fully mirrors libpq's syntax, and supports both URL-style and key-value style
strings.
* `FromSql` implementations can now borrow from the data buffer. In particular, this means that you can deserialize
values as `&str`. The `FromSqlOwned` trait 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.
### Removed
* The `with-openssl` and `with-native-tls` Cargo features have been removed. Use the `tokio-postgres-openssl` and
`tokio-postgres-native-tls` crates instead.
* The `with-rustc_serialize` and `with-time` Cargo features have been removed. Use `serde` and `SystemTime` or `chrono`
instead.
* The `Transaction::set_commit` and `Transaction::set_rollback` methods have been removed. The only way to commit a
transaction is to explicitly consume it via `Transaction::commit`.
* The `Rows` type has been removed; methods now return `Vec<Row>` instead.
* `Connection::prepare_cache` has been removed, as `Statement` is now `'static` and 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!
## Older
Look at the [release tags] for information about older releases.
[release tags]: https://github.com/sfackler/rust-postgres/releases
|