mysql

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 5 Imported by: 0

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

func Dialect

func Dialect() dbcleaner.Dialect

Dialect is the MySQL dialect.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL