Last active
December 15, 2015 19:39
-
-
Save derekgates/5313170 to your computer and use it in GitHub Desktop.
Replace non-disposed SQLiteCommands to wrapped commands in using statements (covers .ExecuteNonQuery)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^[^\S\r\n]*[^using](?<sql>new SQLiteCommand\((.*), (.*)\))\.ExecuteNonQuery\(\); | |
replace with: | |
using (var c = ${sql})\nc.ExecuteNonQuery(); | |
Finding any SQLiteCommand that is wrapped in a using statement: | |
^.*[^using](?<sql>new SQLiteCommand\((.*), (.*)\))\.(.*)\(\); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment