Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapWithIndexCheckingDatastoreProxyIfApplicable ¶
WrapWithIndexCheckingDatastoreProxyIfApplicable wraps the provided datastore with an index-checking proxy if the datastore is an SQLDatastore.
Delegation stays on the datastore as given. Only the Explainable is taken from the unwrapped SQLDatastore, because that is all index checking needs.
Delegating to the unwrapped datastore instead would silently discard every proxy wrapped around it - in particular NewSeparatingContextDatastoreProxy, which the SQL datastores apply to themselves. That proxy severs cancellation on reads so that a caller going away cannot kill an in-flight query; pgx reacts to a cancelled context by setting an immediate deadline on the connection. Without it, the dispatcher cancelling losing subproblems - thousands of times in a run - churns pooled connections, and a read can come back with "timeout: read tcp ...: i/o timeout" having nothing to do with the query that reported it.
Types ¶
This section is empty.