forked from mirror/go-sqlite3
Add example using driverName
This commit is contained in:
parent
c0fa5ea6d6
commit
671e666c2e
|
@ -0,0 +1,12 @@
|
||||||
|
TARGET = custom_driver_name
|
||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
TARGET := $(TARGET).exe
|
||||||
|
endif
|
||||||
|
|
||||||
|
all : $(TARGET)
|
||||||
|
|
||||||
|
$(TARGET) : main.go
|
||||||
|
go build -ldflags="-X 'github.com/mattn/go-sqlite3.driverName=my-sqlite3'"
|
||||||
|
|
||||||
|
clean :
|
||||||
|
rm -f $(TARGET)
|
|
@ -0,0 +1,13 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"database/sql"
|
||||||
|
|
||||||
|
_ "github.com/mattn/go-sqlite3"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
for _, driver := range sql.Drivers() {
|
||||||
|
println(driver)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue