Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database/sql: add getters for connection pool configuration settings in DB struct #44372

Open
tomaszjonak opened this issue Feb 18, 2021 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@tomaszjonak
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.15.1 linux/amd64

Does this issue reproduce with the latest release?

This is a interface extension proposal for database/sql.DB struct.

What do you want to do?

I want to inspect state of DB instance configuration set via

    func (db *DB) SetConnMaxIdleTime(d time.Duration)
    func (db *DB) SetConnMaxLifetime(d time.Duration)
    func (db *DB) SetMaxIdleConns(n int)
    func (db *DB) SetMaxOpenConns(n int)

What did you expect to see?

Methods returning current values, i.e

    func (db *DB) ConnMaxIdleTime() time.Duration
    func (db *DB) ConnMaxLifetime() time.Duration
    func (db *DB) MaxIdleConns() int
    func (db *DB) MaxOpenConns() int

or additional fields in DBStats struct, currently there's just MaxOpenConnections.

@tomaszjonak tomaszjonak changed the title Add getters for database/sql.DB connection pool configuration settings database/sql: add getters for connection pool configuration settings in DB struct Feb 18, 2021
@toothrot toothrot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 18, 2021
@toothrot toothrot added this to the Backlog milestone Feb 18, 2021
@toothrot
Copy link
Contributor

/cc @kardianos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants