Skip to content

Commit 5927c66

Browse files
yvesmhNickCraver
authored andcommitted
Mention how to use user defined variables (#1149)
Fixes #620 Added a section to indicate Dapper works well with User Defined Variables.
1 parent b4c6d5e commit 5927c66

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Readme.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,14 @@ using (var reader = connection.ExecuteReader("select * from Shapes"))
370370
}
371371
```
372372

373+
User Defined Variables in MySQL
374+
---------------------
375+
In order to use Non-parameter SQL variables with MySql Connector, you have to add the following option to your connection string:
376+
377+
`Allow User Variables=True`
378+
379+
Make sure you don't provide Dapper with a property to map.
380+
373381
Limitations and caveats
374382
---------------------
375383
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 `ConcurrentDictionary` object. Statements that are only used once are routinely flushed from this cache. Still, if you are generating SQL strings on the fly without using parameters it is possible you may hit memory issues.

0 commit comments

Comments
 (0)