Commit 4013ecb
authored
Add ability to pass cache_statement per operation (#352)
Previously ecto_sql used pre-defined cache_statement value for all
types of queries. This commit adds ability to use user specified
cache statement as it could improve performance in certain situations
like multiple `insert_all` queries with fixed size batch and so on.
Besides this the commit adds length of parameters to the default
cache_statement name. In other way set of queries like this:
App.Repo.insert(%MyModel{name: "test_1", field_id: nil})
App.Repo.insert(%MyModel{name: "test_2", field_id: "test"})
App.Repo.insert(%MyModel{name: "test_3", field_id: nil})
will lead to situation when the previous prepared statement will be
closed when next query from the set will be executed and new one will
be created because `nil` values are not get into resulted query.1 parent 92a4a5c commit 4013ecb
2 files changed
+16
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
260 | 264 | | |
261 | 265 | | |
262 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
660 | 664 | | |
661 | 665 | | |
662 | 666 | | |
| |||
789 | 793 | | |
790 | 794 | | |
791 | 795 | | |
792 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
793 | 801 | | |
794 | | - | |
| 802 | + | |
795 | 803 | | |
796 | 804 | | |
797 | 805 | | |
| |||
0 commit comments