Giter VIP home page Giter VIP logo

Comments (5)

djc avatar djc commented on May 30, 2024

Might be nice to have a look at other pooling solutions (r2d2, deadpool, sqlx) and see if/how they support this.

(Note that previously we recommended that LISTEN queries should probably be issued on non-pooled connections, through Pool::dedicated_connection().)

from bb8.

jakajancar avatar jakajancar commented on May 30, 2024

PgBouncer has it configurable (server_reset_query) but it defaults to DISCARD ALL. PgBouncer is probably the gold standard when it comes to Postgres pooling.

It’s really not about the LISTEN, but all (currently 9) resources this releases. Another nice thing is that it fails if the connection is inside a transaction, so it helps automatically check that you’re closing them correctly.

I think it needs to be configurable, otherwise you loose the ability to share use prepared statements etc. Choose your own isolation level...

from bb8.

djc avatar djc commented on May 30, 2024

I was referring mostly to Rust crates.

I'm unlikely to have time for this any time soon unless someone is willing to pay for it. Will review hooks for this in the connection manager trait, though.

from bb8.

jakajancar avatar jakajancar commented on May 30, 2024

Yes, I think hooks are key rather than supporting every single possible reset query. Then one can subclass the postgres manager and do what they want.

from bb8.

djc avatar djc commented on May 30, 2024

#89 added a way to customize connections at the start of the lifetime rather than the end, which should help with this.

from bb8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.