xdbutils_mysql

package
v0.0.0-...-587cc14 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 0 Imported by: 1

README

xdbutils_mysql

Dependencies

  • None

Documents

Types
  • type DSNFormatter interface
  • type MySQLExtraConfig struct
Variables
  • None
Constants
  • None
Functions
  • None
Methods
  • func (m MySQLExtraConfig) ToParams() map[string]string

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DSNFormatter

type DSNFormatter interface {
	FormatDSN() string
}

DSNFormatter is an interface for types which implement FormatDSN method, such as mysql.Config, xdbutils_sqlite.SQLiteConfig and xdbutils_postgres.PostgreSQLConfig.

type MySQLExtraConfig

type MySQLExtraConfig struct {
	AllowFallbackToPlaintext *bool  // True allowFallbackToPlaintext acts like a --ssl-mode=PREFERRED MySQL client as described
	Charset                  string // Sets the charset used for client-server interaction, prefer "utf8mb4,utf8"
	Autocommit               *bool  // In MySQL, autocommit is default to true
	TimeZone                 string // such as: Europe/Paris, https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html
	TransactionIsolation     string // such as: REPEATABLE-READ, https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_transaction_isolation
	SQLMode                  string // such as: TRADITIONAL, https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html.
	SysVar                   string // such as: esc@ped

	OtherParams map[string]string // more custom params
}

MySQLExtraConfig is an extra configuration for MySQL, can be used to generate mysql.Config.Params by ToParams method.

Please visit the follow links for more information: - https://github.com/go-sql-driver/mysql#dsn-data-source-name - https://dev.mysql.com/doc/refman/8.0/en/connecting-using-uri-or-key-value-pairs.html

func (*MySQLExtraConfig) ToParams

func (m *MySQLExtraConfig) ToParams() map[string]string

ToParams generates a parameter map for mysql.Config.Params from MySQLExtraConfig.

Jump to

Keyboard shortcuts

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