ryanrolds / sqlclosecheck

Linter that confirms DB rows and statements are closed properly.
MIT License
80 stars 14 forks source link

Allow for skipping prepared statements. #13

Open thezerobit opened 3 years ago

thezerobit commented 3 years ago

Prepared statements can live as long as the connection and be reused over and over and then closed much later. In that scenario, it would be nice to be able to allow prepared statements to not be closed in the same function that they are created in.

ryanrolds commented 1 year ago

Sorry about not responding sooner. Please provide a test case (example), and I will look into it.

thezerobit commented 1 year ago

I've changed jobs since I filed this ticket and no longer have access to the source code. From memory, I think we close the statements on program exit, which is to say, not a simple defer. If you don't care about this case, feel free to close this ticket. I'm not really working in Go at this point, so I'm not going to be able to contribute here.