Update to latest sfackler - #4
Closed
halfmatthalfcat wants to merge 83 commits into
Closed
Conversation
…config-file Upgrade to GitHub-native Dependabot
Updates the requirements on [hmac](https://github.com/RustCrypto/MACs) to permit the latest version. - [Release notes](https://github.com/RustCrypto/MACs/releases) - [Commits](RustCrypto/MACs@hmac-v0.10.0...hmac-v0.11.0) Signed-off-by: dependabot[bot] <support@github.com>
…mac-0.11 Update hmac requirement from 0.10 to 0.11
When executing statements in parallel there is a race where we prepare the type info queries multiple times, and so insert into the type info caches multiple times. This resulted in any existing cached `Statement` to be dropped, running its destructor which attempts to take out the state lock that is already being held, resulting in a deadlock. Fixes rust-postgres#772.
There is no reason for the buffer and typeinfo caches to share the same lock. By splitting them it means we a) get slightly better performance, but more importantly b) it makes it harder to accidentally deadlock.
Fix deadlock when pipelining statements.
The current implementation forwards all read requests to the operating system through the socket causing excessive system calls. The effect is magnified when the underlying Socket is wrapped around a TLS implementation. This commit changes the underlying socket to be read-buffered by default with a buffer size of 16K, following the implementation of the official client. Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
tokio-postgres: buffer sockets to avoid excessive syscalls
…-row-getter expose SimpleQueryRow's column names
Add support for eui48 version 1.0
…e explicit in the documentation.
Making Postgres Types Documentation More Explict For Feature Flags
This is feature-gated because those impls require Rust 1.51.
We needed to bump the version because the `array-impls` feature requires const generics.
…-sql-arrays Add `FromSql` and `ToSql` impls for arrays (guarded behind feature)
Updates the requirements on [env_logger](https://github.com/env-logger-rs/env_logger) to permit the latest version. - [Release notes](https://github.com/env-logger-rs/env_logger/releases) - [Changelog](https://github.com/env-logger-rs/env_logger/blob/main/CHANGELOG.md) - [Commits](rust-cli/env_logger@v0.8.0...v0.9.0) --- updated-dependencies: - dependency-name: env_logger dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
…nv_logger-0.9 Update env_logger requirement from 0.8 to 0.9
Update hash crates
- Box<dyn ToSql + Sync> - Box<dyn ToSql + Sync + Send>
Implement `ToSql` & `FromSql` for `Box<str>`
…sparent Derive transparent
Boxed owned query parameters
Updates the requirements on [parking_lot](https://github.com/Amanieu/parking_lot) to permit the latest version. - [Release notes](https://github.com/Amanieu/parking_lot/releases) - [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md) - [Commits](Amanieu/parking_lot@0.11.0...0.12.0) --- updated-dependencies: - dependency-name: parking_lot dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
…arking_lot-0.12 Update parking_lot requirement from 0.11 to 0.12
Updates the requirements on [tokio-util](https://github.com/tokio-rs/tokio) to permit the latest version. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/commits) --- updated-dependencies: - dependency-name: tokio-util dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
…okio-util-0.7 Update tokio-util requirement from 0.6 to 0.7
Add ToSql / FromSql for IpInet and IpCidr from cidr crate
Add ltree, lquery and ltxtquery support
This enables usage with pgBouncer's transaction mode. Typically when
using the transaction mode, a client gets a new connection from
pgBouncer for every new transaction. It's quite useful and allows one to
use prepared statements in this mode. The workflow goes:
```sql
-- start a new transaction
BEGIN
-- deallocate all stored statements from the server to prevent
-- collisions
DEALLOCATE ALL
-- run the queries here
-- ..
-- ..
COMMIT -- or ROLLBACK
```
Now in a case where the query uses custom types such as enums, what
tokio-postgres does is it fetches the type info for the given type,
stores the info to the cache and also caches the statements for
fetching the info to the client. Now when we have two tables with
different custom types in both of them, we can imagine the following
workflow:
```rust
// first query
client.simple_query("BEGIN")?;
client.simple_query("DEALLOCATE ALL")?;
let stmt = client.prepare("SELECT \"public\".\"User\".\"id\", \"public\".\"User\".\"userType\" FROM \"public\".\"User\" WHERE 1=1 OFFSET $1")?;
dbg!(client.query(&stmt, &[&0i64])?);
client.simple_query("COMMIT")?;
// second query
client.simple_query("BEGIN")?;
client.simple_query("DEALLOCATE ALL")?;
let stmt = client.prepare("SELECT \"public\".\"Work\".\"id\", \"public\".\"Work\".\"workType\" FROM \"public\".\"Work\" WHERE 1=1 OFFSET $1")?;
dbg!(client.query(&stmt, &[&0i64])?);
client.simple_query("COMMIT")?;
```
The `userType` and `workType` are both enums, and the preparing of the
second query will give an error `prepared statement "s1" does not
exist`, where `s1` is the query to the `pg_catalog` for the type info.
The change here gives an extra flag for the client to disable caching
of statements.
halfmatthalfcat
marked this pull request as ready for review
March 23, 2022 04:22
Author
|
@pimeys - You might want to enable Actions on your fork to run the tests from this PR to validate. I'm going to continue the conversation with Jan here: prisma/orm#12306 (comment) |
Owner
|
Merged and tested manually. |
pimeys
added a commit
that referenced
this pull request
Nov 7, 2023
Enable transactional pool mode configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates
pimeys/rust-postgres/pgbouncer-modeto the latestsfackler/rust-postgres/masterin order to leverage updates and my newltree,lqueryandltxtqueryfunctionality into quaint and Prisma proper.