3 ms·
> You only need to explicitly create a prepared statement if you're reusing it It does prepare statements internally, but they're not reused, which is the main
by lobster_johnson 11y ago
> You only need to explicitly create a prepared statement if you're reusing it
It does prepare statements internally, but they're not reused, which is the main point of prepared statements: I know I'll run this thing a bazillion times, so I want to prepare it once and then just execute it with new parameters from now on.
As far as I can see, no caching is done [1]. There's a TODO note about maybe adding caching in the future.
[1] https://golang.org/src/database/sql/sql.go https://golang.org/src/database/sql/sql.go
- draaglom 11y agoYeah, I remember reading about them planning it a couple years ago and just kinda assumed someone would've done it by now.