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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3148e-2b0e5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3148e-2b0e5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?