-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
Spawned by the discussion here: knex/knex#802
Use case: prepared statements are connection-specific; the capabilities function could be used to request connections from the pool which have a given prepared statement available.
For this to work, a few things are needed:
- "strong" and "weak" capabilities requests: A strong request would return a resource from the pool that can fulfill the capability or wait until one is available; a weak request would return a resource from the pool that can fulfill the capability if available, otherwise return any available resource
- Ability to dynamically manipulate a resource's capabilities, primarily to "upgrade" plain connections to connections that have the query prepared
Also worth considering:
- affinity / anti-affinity?
- pool prioritization? (try to serve allocation requests with the "least-capable" resource, to leave more specialized resources idle as much as possible?)
- potential use case for hooks? (allow client to prepare statements on new resources when they are requested or when they become idle, for example)
Questions:
- Is the additional complexity worth implementing the feature?
- What would the API look like?
Reactions are currently unavailable