uniqueconstraint

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVDictionaryStore

type CSVDictionaryStore struct {
	FilePath   string
	FileReader FileReader
}

CSVDictionaryStore local csv as source of unique constraint CSV files separated by semicolon(;) rather than comma(,) with or without header, header is not required project.dataset.tablename;id,status

func NewCSVDictionaryStore

func NewCSVDictionaryStore(filePath string, fileReader FileReader) *CSVDictionaryStore

NewCSVDictionaryStore is constructor of CSVUniqueConstraintDictionaryStore

func (*CSVDictionaryStore) Get

func (l *CSVDictionaryStore) Get() (map[string][]string, error)

Get to read csv file and parse into unique constraint dictionary

type CachedDictionaryStore

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

CachedDictionaryStore is unique constrain source that cached

func NewCachedDictionaryStore

func NewCachedDictionaryStore(cacheExpirationSeconds int, source DictionaryStore) *CachedDictionaryStore

NewCachedDictionaryStore create CachedDictionaryStore cacheExpiration is in seconds

func (*CachedDictionaryStore) Get

func (c *CachedDictionaryStore) Get() (map[string][]string, error)

Get to get unique constraints

type DictionaryStore

type DictionaryStore interface {
	Get() (map[string][]string, error)
}

DictionaryStore is store that contains of unique constraint dictionary

type DictionaryStoreFactory

type DictionaryStoreFactory struct {
}

DictionaryStoreFactory is factory

func NewDictionaryStoreFactory

func NewDictionaryStoreFactory() *DictionaryStoreFactory

NewDictionaryStoreFactory is constructor

func (*DictionaryStoreFactory) CreateDictionaryStore

func (u *DictionaryStoreFactory) CreateDictionaryStore(URL string) (DictionaryStore, error)

CreateDictionaryStore to create dictionary store

type FileReader

type FileReader interface {
	ReadFile(filePath string) ([]byte, error)
}

FileReader file reader interface

type Store

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

Store is store to get list of unique constraint column

func NewStore

func NewStore(source DictionaryStore) *Store

NewStore is constructor

func (*Store) FetchConstraints

func (s *Store) FetchConstraints(tableID string) ([]string, error)

FetchConstraints to get unique constraint will throw protocol.ErrUniqueConstraintNotFound when unique constraint not found

type StoreFactory

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

StoreFactory to create specific UniqueConstraintStore based on url configuration

func NewStoreFactory

func NewStoreFactory(dictionaryStoreFactory *DictionaryStoreFactory) *StoreFactory

NewStoreFactory is constructor of UniqueConstraintStoreFactory

func (*StoreFactory) CreateUniqueConstraintStore

func (u *StoreFactory) CreateUniqueConstraintStore(URL string) (protocol.ConstraintStore, error)

CreateUniqueConstraintStore to create specific implementation of UniqueConstraintStore

Jump to

Keyboard shortcuts

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