From fc6d88f1c614f10dbd4bd552fcf7794179b60a52 Mon Sep 17 00:00:00 2001 From: Chris O'Hara Date: Fri, 25 Aug 2023 13:17:48 +1000 Subject: [PATCH] mysql: always import driver When under GOOS=wasip1, the github.com/go-sql-driver/mysql driver is imported and registered with the database/sql package. When not under GOOS=wasip1, the 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. --- mysql/mysql.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql/mysql.go b/mysql/mysql.go index fd618dc..3b48e65 100644 --- a/mysql/mysql.go +++ b/mysql/mysql.go @@ -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"