Connection pool
Provide a mechanism to create a connection pool to re-use existing connections.
From the review: prepared statements are allocated at the connection level. When taking a connection from the pool, preparing some statements, using them and then returning a connection to the pool without closing it, those statements may be leaked if prepared_statement::close is not called. When implementing this, we should create some mechanism that stores which statements have been prepared by which connection, so they can be closed when the connection is returned to the pool. We may want to close those statements by server-side ID (as returned by prepared_statement::id(), vs. by using the prepared_statement object), and in batch.
Connections that are iddle for too long are automatically closed by MySQL (see #161). The pool should provide an option for auto-keepalives after a certain period has elapsed.
Is there any plan to support connection pooling in the future? Will this feature be implemented only after 'std:: execution' is supported?
Sorry for the late reply. Yes, there is. I hope to get it in 1.84.
That's great!
Closed by bc5577ede56204770fb35c296cdeb21c3c772a36 (typo in commit message prevented auto close).