mysql

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseType = "mysql"
)

Variables

This section is empty.

Functions

func GoquDialectOptions added in v1.10.0

func GoquDialectOptions() *sqlgen.SQLDialectOptions

func GoquExpressions added in v1.10.0

func GoquExpressions() *base.Expressions

Types

type Config

type Config struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	DBName   string `json:"dbname"`
	User     string `json:"user"`
	Password string `json:"password"`
	SSLMode  string `json:"sslmode"`

	TunnelInfo *sshtunnel.Config `json:"tunnel_info,omitempty"`

	// SkipHostValidation is used to skip host validation during tests
	SkipHostValidation bool `json:"skipHostValidation"`
	UseLegacyMappings  bool `json:"useLegacyMappings"`
}

func (Config) ConnectionString

func (c Config) ConnectionString() (string, error)

ConnectionString builds the go-sql-driver DSN from typed fields.

Do not rewrite this to format the DSN by hand. Every value here comes from caller-supplied connection config, and the driver reads part of the DSN as connection parameters, so an unescaped field can change the settings the driver ends up with. FormatDSN escapes each field for us.

func (*Config) Parse

func (c *Config) Parse(input json.RawMessage) error

func (Config) TLS

func (c Config) TLS() (string, error)

type DB

type DB struct {
	*base.DB
}

func NewDB

func NewDB(configJSON json.RawMessage) (*DB, error)

NewDB creates a new mysql db client

func (*DB) CurrentCatalog added in v1.1.0

func (db *DB) CurrentCatalog(ctx context.Context) (sqlconnect.CatalogRef, error)

CurrentCatalog returns an error because it is not supported by MySQL

func (*DB) ListCatalogs added in v1.24.0

func (db *DB) ListCatalogs(ctx context.Context) ([]sqlconnect.CatalogRef, error)

ListCatalogs returns an error because it is not supported by MySQL

Jump to

Keyboard shortcuts

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