Documentation
¶
Overview ¶
Package mysql links the MySQL driver (go-sql-driver/mysql) for the ORM: blank-import it to Connect to "mysql". Connect reads the DSN as orm.MySQLDSN sets it: parseTime on, which the ORM's time fields need, and utf8mb4 in the server's default collation. It also teaches the ORM the driver's errors (deadlocks to retry, dropped connections) and how to put orm.Credentials into a DSN.
import _ "github.com/vuka-lang/orm/mysql"
db, err := orm.Connect("mysql", "user:pass@tcp(localhost:3306)/shop")
Click to show internal directories.
Click to hide internal directories.