mysql

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SampleMain added in v0.4.0

func SampleMain(yml []byte) error

Types

type Book added in v0.4.0

type Book struct {
	ID          int32
	Title       string
	Author      *string
	Publisher   *string
	Price       *int32
	ReleaseDate *time.Time
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type Mysql

type Mysql struct {
	// contains filtered or unexported fields
}

func NewMysql

func NewMysql(dsn string) (*Mysql, error)

func (*Mysql) Begin

func (m *Mysql) Begin(ctx context.Context) (*sql.Tx, error)

func (*Mysql) BeginReadOnly

func (m *Mysql) BeginReadOnly(ctx context.Context) (*sql.Tx, error)

func (*Mysql) Close

func (m *Mysql) Close()

func (*Mysql) CreateDatabase

func (m *Mysql) CreateDatabase(ctx context.Context, dbname string) error

func (*Mysql) CreateDatabaseIfNotExists

func (m *Mysql) CreateDatabaseIfNotExists(ctx context.Context, dbname string) error

func (*Mysql) CreateOrReplaceDatabase

func (m *Mysql) CreateOrReplaceDatabase(ctx context.Context, dbname string) error

func (*Mysql) DropDatabase

func (m *Mysql) DropDatabase(ctx context.Context, dbname string) error

func (*Mysql) DropDatabaseIfExists

func (m *Mysql) DropDatabaseIfExists(ctx context.Context, dbname string) error

func (*Mysql) Ping

func (m *Mysql) Ping(ctx context.Context) error

Jump to

Keyboard shortcuts

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