Go mysql operation, is there any way to use short connection

the github.com/go-sql-driver/mysql+database/sql, used in the class library does not use other ORM, but it is found that the links established are all long links. Is there any way to build short links

Mar.06,2021

close, can also implement connection pooling to manage existing connections


what problem do you want to solve with short links?


you open a DB connection every time you operate the database, and then turn it off after using it. This is a short connection.


Why short connections? It doesn't cost much to reopen one client at a time.

Menu