sql

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const ErrDupEntry = 1062

ErrDupEntry MySQL Error 1062 indicates a duplicate primary key i.e. the row already exists, so we don't do the insert and return a ConditionalUpdate error.

Variables

This section is empty.

Functions

func NewSQLMatchingPersistence

func NewSQLMatchingPersistence(db *sqlx.DB, logger bark.Logger, shardID int) (p.ExecutionStore, error)

NewSQLMatchingPersistence creates an instance of ExecutionStore

Types

type Factory

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

Factory vends store objects backed by MySQL

func NewFactory

func NewFactory(cfg config.SQL, clusterName string, logger bark.Logger) *Factory

NewFactory returns an instance of a factory object which can be used to create datastores backed by any kind of SQL store

func (*Factory) Close

func (f *Factory) Close()

Close closes the factory

func (*Factory) NewExecutionStore

func (f *Factory) NewExecutionStore(shardID int) (p.ExecutionStore, error)

NewExecutionStore returns an ExecutionStore for a given shardID

func (*Factory) NewHistoryStore

func (f *Factory) NewHistoryStore() (p.HistoryStore, error)

NewHistoryStore returns a new history store

func (*Factory) NewMetadataStore

func (f *Factory) NewMetadataStore() (p.MetadataStore, error)

NewMetadataStore returns a new metadata store

func (*Factory) NewMetadataStoreV1

func (f *Factory) NewMetadataStoreV1() (p.MetadataStore, error)

NewMetadataStoreV1 returns the default metadatastore

func (*Factory) NewMetadataStoreV2

func (f *Factory) NewMetadataStoreV2() (p.MetadataStore, error)

NewMetadataStoreV2 returns the default metadatastore

func (*Factory) NewShardStore

func (f *Factory) NewShardStore() (p.ShardStore, error)

NewShardStore returns a new shard store

func (*Factory) NewTaskStore

func (f *Factory) NewTaskStore() (p.TaskStore, error)

NewTaskStore returns a new task store

func (*Factory) NewVisibilityStore

func (f *Factory) NewVisibilityStore() (p.VisibilityStore, error)

NewVisibilityStore returns a visibility store

type TestCluster

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

TestCluster allows executing cassandra operations in testing.

func NewTestCluster

func NewTestCluster(port int, dbName string, schemaDir string, driverName string) *TestCluster

NewTestCluster returns a new SQL test cluster

func (*TestCluster) Config

func (s *TestCluster) Config() config.Persistence

Config returns the persistence config for connecting to this test cluster

func (*TestCluster) CreateDatabase

func (s *TestCluster) CreateDatabase()

CreateDatabase from PersistenceTestCluster interface

func (*TestCluster) CreateSession

func (s *TestCluster) CreateSession()

CreateSession from PersistenceTestCluster interface

func (*TestCluster) DatabaseName

func (s *TestCluster) DatabaseName() string

DatabaseName from PersistenceTestCluster interface

func (*TestCluster) DropDatabase

func (s *TestCluster) DropDatabase()

DropDatabase from PersistenceTestCluster interface

func (*TestCluster) LoadSchema

func (s *TestCluster) LoadSchema(fileNames []string, schemaDir string)

LoadSchema from PersistenceTestCluster interface

func (*TestCluster) LoadVisibilitySchema

func (s *TestCluster) LoadVisibilitySchema(fileNames []string, schemaDir string)

LoadVisibilitySchema from PersistenceTestCluster interface

func (*TestCluster) SetupTestDatabase

func (s *TestCluster) SetupTestDatabase()

SetupTestDatabase from PersistenceTestCluster interface

func (*TestCluster) TearDownTestDatabase

func (s *TestCluster) TearDownTestDatabase()

TearDownTestDatabase from PersistenceTestCluster interface

Jump to

Keyboard shortcuts

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