Documentation
¶
Overview ¶
Package mysql is the MySQL (and MariaDB) dialect of dbcleaner, on the go-sql-driver/mysql driver. The driver's DSN is not a URL (user:pass@tcp(host:3306)/app_test), so there is no scheme to register it for: pass Dialect to dbcleaner.WithDialect.
dbcleaner.New("root@tcp(127.0.0.1:3306)/app_test", dbcleaner.WithDialect(mysql.Dialect()))
MySQL commits implicitly before and after DDL, so a test running under dbcleaner.Transaction must not create or alter tables. It does not support dbcleaner.WithTemplate: MySQL cannot clone a database.
Foreign keys are switched off while dbcleaner.Truncation runs, and while dbcleaner.Deletion empties a table that references itself: a table that is kept and references a cleaned one is left with dangling rows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.