# Detects missing connection pooling (new connection per request)
# Corpus claim: cache/connection/max_connections bounded true
# Pattern: get_multiplexed_async_connection() called per request
#
# Violation: Creating new connection in get/set/delete methods
# Correct: Use connection pool (r2d2, bb8) or reuse connection
#
# Consequence: Resource exhaustion - connection churn under load

[[extractors.declarative]]
name = "connection_pool_missing"
description = "Detects get_multiplexed_async_connection() per request (resource exhaustion)"
languages = ["rust"]
pattern = 'let\s+mut\s+conn\s*=\s*self\.client\.get_multiplexed_async_connection\(\)\.await'
claim.subject = "connection/pooling"
claim.predicate = "enabled"
claim.value = false
confidence = 0.85
