adb_mysql

package module
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADAPTERTYPE_MYSQL        aconns.AdapterType = "mysql"
	ADAPTERTYPE_MARIA        aconns.AdapterType = "maria"
	MYSQL_DEFAULT_PORT                          = 3306
	MYSQL_CONNECTION_TIMEOUT                    = 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ADBMysql

type ADBMysql struct {
	aconns.ADBAdapterBase

	ConnectionTimeout int `json:"connectionTimeout,omitempty"`
	// contains filtered or unexported fields
}

ADBMysql represents a MySQL database adapter.

func (*ADBMysql) CloseConnection

func (cn *ADBMysql) CloseConnection() error

CloseConnection closes the connection to the MySQL database.

func (*ADBMysql) DB

func (cn *ADBMysql) DB() *bun.DB

DB returns the bun.DB instance.

func (*ADBMysql) GetAddress

func (cn *ADBMysql) GetAddress() string

GetAddress returns the address of the MySQL server.

func (*ADBMysql) GetConnectionTimeout

func (cn *ADBMysql) GetConnectionTimeout() int

GetConnectionTimeout returns the connection timeout.

func (*ADBMysql) GetSandboxAdapter

func (cn *ADBMysql) GetSandboxAdapter() (aconns.ISBAdapter, error)

GetSandboxAdapter returns a sandbox adapter for the MySQL database. It ensures that the ADBMysql instance and its SQLDB are properly initialized.

func (*ADBMysql) OpenConnection

func (cn *ADBMysql) OpenConnection() error

OpenConnection opens a connection to the MySQL database.

func (*ADBMysql) SQLDB

func (cn *ADBMysql) SQLDB() *sql.DB

SQLDB returns the sql.DB instance.

func (*ADBMysql) Test

func (cn *ADBMysql) Test() (bool, aconns.TestStatus, error)

Test attempts to validate the ADBMysql, open a connection if necessary, and test the connection.

func (*ADBMysql) Validate

func (cn *ADBMysql) Validate() error

Validate checks if the ADBMysql object is valid.

type ADBMysqls

type ADBMysqls []*ADBMysql

ADBMysqls represents a slice of ADBMysql pointers.

Jump to

Keyboard shortcuts

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