mysql

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

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
)

Variables

This section is empty.

Functions

func Factory

func Factory(options ...Option) store.Factory

Types

type Charset

type Charset string

type Collation

type Collation string

type Config

type Config struct {
	mysql.Config
	// contains filtered or unexported fields
}

func (Config) ConnMaxLifetime

func (c Config) ConnMaxLifetime() time.Duration

func (Config) DSN

func (c Config) DSN() string

func (Config) MaxConnections

func (c Config) MaxConnections() int

func (Config) QueryTimeout

func (c Config) QueryTimeout() time.Duration

func (Config) String

func (c Config) String() string

type ConnectionType

type ConnectionType string

type Location

type Location string

type Option

type Option func(*Config) error

func NetAddress

func NetAddress(addr string) Option

func Password

func Password(password string) Option

func Schema

func Schema(name string) Option

func Username

func Username(username string) Option

func WithQueryTimeout

func WithQueryTimeout(timeout time.Duration) Option

func WithoutSchema

func WithoutSchema() Option

type Store

type Store struct {
	*storage.SQLStorage
}

func New

func New(options ...Option) (*Store, error)

func (*Store) Create

func (s *Store) Create() error

func (*Store) Maintain

func (s *Store) Maintain() error

Jump to

Keyboard shortcuts

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