Skip to content

Commit

Permalink
mysql: always import driver (#22)
Browse files Browse the repository at this point in the history
When under `GOOS=wasip1`, the `github.com/go-sql-driver/mysql` driver is
imported and automatically registered with the `database/sql` package.
When not under `GOOS=wasip1`, the driver package isn't imported and so
isn't registered.

This commit updates the mysql package to always import the driver and
always register it with `database/sql`.
  • Loading branch information
chriso authored Aug 25, 2023
2 parents 91bc694 + fc6d88f commit 3846e0f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
// When compiling to other targets than GOOS=wasip1, importing this package has
// no effect.
package mysql

import _ "github.com/go-sql-driver/mysql"

0 comments on commit 3846e0f

Please sign in to comment.