title: How to execute a SQL query without any Dapper caching?
body: <p>As mentioned <a href="https://github.com/StackExchange/Dapper#limitations-and-caveats" rel="nofollow noreferrer">in Dapper docs</a>, Dapper uses a <code>ConcurrentDictionary</code> to store its own caches with information about the queries being executed.</p>
  
  <blockquote>
    <p>Dapper caches information about every query it runs, this allows it to materialize objects quickly and process parameters quickly. The current implementation caches this information in a <code>ConcurrentDictionary</code> object. Statements that are only used once are routinely flushed from this cache. Still, <strong>if you are generating SQL strings on the fly without using parameters it is possible you may hit memory issues</strong>.</p>
  </blockquote>
  
  <hr>
  
  <p><strong>Is there some way to execute some SQL queries so that they explicitly would not be cached by Dapper?</strong></p>
  
  <p>I have some queries that are very much dynamically assembled, use temporary tables with random identifiers in there, parameters inlined in the string, etc. I think it would be a good idea to execute those without any cache involved. I know that the <strong>ideal solution would be to rewrite the queries</strong> in a better way, but I'm looking for a short-term solution here while diagnosing some performance issues. One of the things I'm looking at is that the <code>ConcurrentDictionary</code> memory allocated by Dapper keeps growing over time and isn't released. I'd like to try some things to get it under control without having to rewrite lots of code.</p>
  
  <p>Is something like that possible in Dapper; just to execute some selected queries in a way that they don't end up in cache?</p>