mysql

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(opts *Provider)

Option configures the couchdb provider.

func WithDBPrefix

func WithDBPrefix(dbPrefix string) Option

WithDBPrefix option is for adding prefix to db name.

type Provider

type Provider struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Provider represents a MySQL DB implementation of the storage.Provider interface.

func NewProvider

func NewProvider(dbPath string, opts ...Option) (p *Provider, err error)

NewProvider instantiates Provider. Example DB Path root:my-secret-pw@tcp(127.0.0.1:3306)/. This provider's CreateStore(name) implementation creates stores that are backed by a table under a schema with the same name as the table. The fully qualified name of the table is thus `name.name`. The fully qualified name of the table needs to be used with the store's `Query()` method.

func (*Provider) Close

func (p *Provider) Close() error

Close closes the provider.

func (*Provider) CloseStore

func (p *Provider) CloseStore(name string) error

CloseStore closes a previously opened store.

func (*Provider) CreateStore

func (p *Provider) CreateStore(name string) (err error)

CreateStore creates a store with the given name.

func (*Provider) OpenStore

func (p *Provider) OpenStore(name string) (s storage.Store, openErr error)

OpenStore opens and returns a new DB with the given namespace.

Jump to

Keyboard shortcuts

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