Open prasad83 opened 3 years ago
This sets the parameter on the open connection; if you have more than one connection then you need to set it for all connections.
The go-sqlite driver has a ConnectHook to run commands whenever a new connection is opened; I don't know if the MySQL driver has something similar but it probably does.
Issue description
I'm running create-table commands in parallel threads using db.MustExec before spawning the threads I do db.MustExec ("SET FOREIGN_KEY_CHECKS=0") but looks like this fails when db.SetMaxOpenConns is > 1
Example code
How can I ensure (FOREIGN_KEY_CHECKS) is holding until all waitGroup function completes?