mysql

package
v0.0.0-...-73466f7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 11 Imported by: 0

README

MySQL driver for Go

This is a MySQL driver for Go.

Docs

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidDSN indicates an invalid MySQL DSN.
	ErrInvalidDSN = errors.New("invalid MySQL DSN")
	// ErrClientConnection indicates a failure to connect to MySQL.
	ErrClientConnection = errors.New("failed to connect to MySQL server")
	// ErrInvalidDatabase indicates an invalid database name.
	ErrInvalidDatabase = errors.New("invalid database name")
	// ErrInvalidCredentials indicates invalid authentication credentials.
	ErrInvalidCredentials = errors.New("invalid MySQL credentials")
)

Error variables for wrapping underlying errors.

Functions

This section is empty.

Types

type Config

type Config struct {
	URI string
}

Config - configuration

type PingConnectionError

type PingConnectionError struct {
	Err error
}

PingConnectionError - error ping connection

func (*PingConnectionError) Error

func (e *PingConnectionError) Error() string

type Store

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

Store implementation of db interface

func New

func New(tracer trace.TracerProvider, metrics *metric.MeterProvider) *Store

func (*Store) GetConn

func (s *Store) GetConn() any

GetConn - get connect

func (*Store) Init

func (s *Store) Init(ctx context.Context) error

Init - initialize

type StoreError

type StoreError struct {
	Op      string
	Err     error
	Details string
}

StoreError is a custom error type for Store operations with added details.

func (*StoreError) Error

func (e *StoreError) Error() string

Error implements the error interface.

func (*StoreError) Unwrap

func (e *StoreError) Unwrap() error

Unwrap allows errors.Is and errors.As to work with StoreError.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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