mariadb

package
v0.0.74 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolTCP        = "tcp"
	ProtocolUNIXSocket = "unix"
)

Protocol = UNIXSocket, Address = "/tmp/mysql.sock" Protocol = TCP, Address = "localhost:5555"

View Source
const ErrorsIdent = "MariaDB"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Protocol string
	Address  string
	Schema   string
	User     string
	Password string
	Charset  string
}

Start Config -------------------------------------------------

func (*Config) GetDSN

func (cfg *Config) GetDSN() string

type Conn

type Conn struct {
	*sql.DB
	*types.DBLog
}

type DBQuery

type DBQuery interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	Query(query string, args ...interface{}) (*sql.Rows, error)
	QueryRow(query string, args ...interface{}) *sql.Row
	Begin() (*sql.Tx, error)
	BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
	Close() error
	types.SQLLogger
}

Start Connect -------------------------------------------------

func New

func New(cfg *Config, log types.SQLLoggerFunc) (DBQuery, error)

Jump to

Keyboard shortcuts

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