Help us shape the future of Go! Take the 2026 Go Developer Survey

testmysql

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package testmysql gives tests an admin connection to a MySQL 8 server from the DSN in AICODED_TEST_MYSQL_DSN. Without it a test is skipped, or fails when AICODED_E2E_MYSQL is "required". Nothing here prints the DSN, which holds a password.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Admin

func Admin(t testing.TB) *sql.DB

Admin returns an admin connection, closed when the test ends.

func Config

func Config(t testing.TB) *mysql.Config

Config returns the parsed admin DSN.

func DSN

func DSN(t testing.TB) string

DSN returns the admin DSN.

func User

func User(t testing.TB, admin *sql.DB, plugin string) (user, password, database string)

User creates a database and a user identified with plugin that may use only that database, drops both when the test ends, and returns them with the user's password. The account's host is '%', since a server in Docker sees clients at the bridge address.

Types

This section is empty.

Jump to

Keyboard shortcuts

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