mysql

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package mysql provides a MySQL database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sql.DB
}

DB is a struct that contains the settings for the MySQL database.

func NewDB

func NewDB(config *mysql.Config) (*DB, error)

NewDB returns a new DB struct.

func (*DB) BeginReadOnlyTx

func (db *DB) BeginReadOnlyTx(ctx context.Context) (repository.Tx, error)

BeginReadOnlyTx begins a read-only transaction.

func (*DB) BeginTx

func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (repository.Tx, error)

BeginTx begins a transaction.

func (*DB) Close

func (db *DB) Close() error

Close closes the database and prevents new queries from starting.

Directories

Path Synopsis
Package mock is a package for mocking MySQL.
Package mock is a package for mocking MySQL.

Jump to

Keyboard shortcuts

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