We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 529a1ab commit 518f06fCopy full SHA for 518f06f
README.md
@@ -460,12 +460,18 @@ func main() {
460
A custom driver name can be set via build options: `-ldflags '-X "github.com/go-mysql-org/go-mysql/driver.driverName=gomysql"'`.
461
462
This can be useful when using [GORM](https://gorm.io/docs/connecting_to_the_database.html#Customize-Driver):
463
+
464
```go
-mysql.Config{
465
- DriverName: "gomysql",
466
- ...
467
-}
+import (
+ _ "github.com/go-mysql-org/go-mysql/driver"
+ "gorm.io/driver/mysql"
468
+ "gorm.io/gorm"
469
+)
470
471
+db, err := gorm.Open(mysql.New(mysql.Config{
472
+ DriverName: "gomysql",
473
+ DSN: "gorm:[email protected]:3306/test",
474
+}))
475
```
476
477
### Custom NamedValueChecker
0 commit comments