mysql

package
v0.47.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDataSourceName

func BuildDataSourceName(url, database, usernameFile, passwordFile string) (string, error)

BuildDataSourceName returns source name to make connection to database.

Types

type Iterator

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

Iterator for MySQL result set

func (*Iterator) Cursor

func (it *Iterator) Cursor() (string, error)

Cursor builds a base64 string (encode from string in map[string]interface{} format). The cursor contains only values attached with the fields used as ordering fields.

func (*Iterator) Next

func (it *Iterator) Next(dst interface{}) error

Next implementation for MySQL Iterator

type MySQL

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

MySQL client wrapper

func NewMySQL

func NewMySQL(url, database string, opts ...Option) (*MySQL, error)

NewMySQL returns new MySQL instance

func (*MySQL) Close

func (m *MySQL) Close() error

Close implementation for MySQL

func (*MySQL) Create

func (m *MySQL) Create(ctx context.Context, col datastore.Collection, id string, entity interface{}) error

Create implementation for MySQL

func (*MySQL) Find

Find implementation for MySQL

func (*MySQL) Get

func (m *MySQL) Get(ctx context.Context, col datastore.Collection, id string, v interface{}) error

Get implementation for MySQL

func (*MySQL) Ping added in v0.34.1

func (m *MySQL) Ping() error

Ping implementation for MySQL

func (*MySQL) Update

func (m *MySQL) Update(ctx context.Context, col datastore.Collection, id string, updater datastore.Updater) error

Update implementation for MySQL

type Option

type Option func(*MySQL)

Option for create MySQL typed instance

func WithAuthenticationFile

func WithAuthenticationFile(usernameFile, passwordFile string) Option

WithAuthenticationFile returns auth info setup function

func WithLogger

func WithLogger(logger *zap.Logger) Option

WithLogger returns logger setup function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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