Documentation ¶
Index ¶
Constants ¶
View Source
const ( Utf8mb4 Charset = "utf8mb4" TCP ConnectionType = "tcp" Unix ConnectionType = "unix" DefaultPort = 3306 DefaultMaxConnections = 32 DefaultConnMaxLifetime = 1 * time.Hour DefaultTimeout = 30 * time.Second DefaultReadTimeout = 30 * time.Second DefaultWriteTimeout = 30 * time.Second DefaultQueryTimeout = 60 * time.Second )
View Source
const MySQLDriver = "mysql"
Variables ¶
View Source
var MigrationFS embed.FS
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { mysql.Config TargetSchema string // here for schema-less conns, e.g. for create // contains filtered or unexported fields }
func (Config) ConnMaxLifetime ¶
func (Config) MaxConnections ¶
func (Config) QueryTimeout ¶
type ConnectionType ¶
type ConnectionType string
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
func (*MySQL) BeforeMigrateUp ¶
MySQL needs a pre-migration hook in order to create a database because Goose needs a schema to run migrations, and we can't connect with a schema name if the schema doesn't exist. The creation SQL must `USE` the schema name it creates, so that subsquent operations on the connection (whether or not those are running later migration stages), will be in the correct schema.
func (MySQL) DSNSource ¶
func (s MySQL) DSNSource() database.DataSource
func (MySQL) MigrationEnv ¶
func (MySQL) MigrationFS ¶
type Option ¶
func ForMigration ¶
func ForMigration() Option
func NetAddress ¶
func WithMaxConnections ¶
func WithQueryTimeout ¶
Click to show internal directories.
Click to hide internal directories.