Closed aloha1003 closed 6 years ago
import please the mysql driver
https://github.com/go-sql-driver/mysql look at the usage...
So, there's three problems here:
sql.Open
on each request, as each call to that opens a pool of connections (not just one), so it's much more efficient to simply call sql.Open
one time and store the db
on a struct somewhere and re-use it.Thx , I fix it .
If you're having a generation problem please answer these questions before submitting your issue. Thanks!
What version of SQLBoiler are you using (
sqlboiler --version
)?SQLBoiler v2.6.0
If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)
If this happened at runtime what code produced the issue? (if not applicable leave blank)
What is the output of the command above with the
-d
flag added to it? (Provided you are comfortable sharing this, it contains a blueprint of your schema)Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)
Further information. What did you do, what did you expect?
My Problem code is here
I got models , but I call model in app.go , I got below error message
does not compile: cannot convert db (type *sql.DB) to type models.BonusMissio