backends

package
v4.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: LGPL-2.1 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AutopingTimeout = 5 * time.Second
View Source
var DefaultAmazonRegion = `us-east-1`
View Source
var DefaultAutoregister = false
View Source
var DefaultCompoundJoiner = `:`
View Source
var DefaultSharedCredentialsFile = `~/.aws/credentials`
View Source
var DefaultSharedCredentialsProfile = `default`
View Source
var ElasticsearchBatchFlushCount = 1
View Source
var ElasticsearchBatchFlushInterval = 10 * time.Second
View Source
var ElasticsearchConnectTimeout = 3 * time.Second
View Source
var ElasticsearchDocumentType = `document`
View Source
var ElasticsearchIdentityField = `_id`
View Source
var ElasticsearchRequestTimeout = 30 * time.Second
View Source
var ElasticsearchResponseHeaderTimeout = 10 * time.Second
View Source
var ElasticsearchTLSTimeout = 10 * time.Second
View Source
var IndexerPageSize int = 100
View Source
var IndexerResultsStop = fmt.Errorf(`stop indexer results`)
View Source
var InitialPingTimeout = time.Duration(10) * time.Second
View Source
var MaxFacetCardinality int = 10000
View Source
var NotImplementedError = fmt.Errorf("Not Implemented")
View Source
var SqlArrayFieldHintLength = 131069
View Source
var SqlObjectFieldHintLength = 131071

Functions

func DefaultQueryImplementation

func DefaultQueryImplementation(ctx context.Context, indexer Indexer, collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func PopulateRecordSetPageDetails

func PopulateRecordSetPageDetails(recordset *dal.RecordSet, f *filter.Filter, page IndexPage)

func RegisterBackend

func RegisterBackend(name string, fn BackendFunc)

Register a new or replacement backend for the given connection string scheme. For example, registering backend "foo" will allow Pivot to handle "foo://" connection strings.

func RegisterSqlInitFunc

func RegisterSqlInitFunc(scheme string, fn SqlInitFunc)

func RegisterSqlPreInitFunc

func RegisterSqlPreInitFunc(scheme string, fn SqlPreInitFunc)

Types

type Aggregator

type Aggregator interface {
	AggregatorConnectionString() *dal.ConnectionString
	AggregatorInitialize(Backend) error
	Sum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
	Count(ctx context.Context, collection *dal.Collection, f ...*filter.Filter) (uint64, error)
	Minimum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
	Maximum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
	Average(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
	GroupBy(ctx context.Context, collection *dal.Collection, fields []string, aggregates []filter.Aggregate, f ...*filter.Filter) (*dal.RecordSet, error)
}

type Backend

type Backend interface {
	Initialize() error
	SetIndexer(dal.ConnectionString) error
	RegisterCollection(*dal.Collection)
	GetConnectionString() *dal.ConnectionString
	Exists(ctx context.Context, collection string, id interface{}) bool
	Retrieve(ctx context.Context, collection string, id interface{}, fields ...string) (*dal.Record, error)
	Insert(ctx context.Context, collection string, records *dal.RecordSet) error
	Update(ctx context.Context, collection string, records *dal.RecordSet, target ...string) error
	Delete(ctx context.Context, collection string, ids ...interface{}) error
	CreateCollection(ctx context.Context, definition *dal.Collection) error
	DeleteCollection(ctx context.Context, collection string) error
	ListCollections() ([]string, error)
	GetCollection(collection string) (*dal.Collection, error)
	WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer
	WithAggregator(collection *dal.Collection) Aggregator
	Flush() error
	Ping(context.Context, time.Duration) error
	String() string
	Supports(feature ...BackendFeature) bool
	SetEndpoint(string)
}

func MakeBackend

func MakeBackend(connection dal.ConnectionString) (Backend, error)

Instantiate the appropriate Backend for the given connection string.

func NewDynamoBackend

func NewDynamoBackend(connection dal.ConnectionString) Backend

func NewSqlBackend

func NewSqlBackend(connection dal.ConnectionString) Backend

type BackendFeature

type BackendFeature int
const (
	PartialSearch BackendFeature = iota
	CompositeKeys
	Constraints
)

type BackendFunc

type BackendFunc func(dal.ConnectionString) Backend

type CachingBackend

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

func NewCachingBackend

func NewCachingBackend(parent Backend) *CachingBackend

func (*CachingBackend) CreateCollection

func (self *CachingBackend) CreateCollection(ctx context.Context, definition *dal.Collection) error

func (*CachingBackend) Delete

func (self *CachingBackend) Delete(ctx context.Context, collection string, ids ...interface{}) error

func (*CachingBackend) DeleteCollection

func (self *CachingBackend) DeleteCollection(ctx context.Context, collection string) error

func (*CachingBackend) Exists

func (self *CachingBackend) Exists(ctx context.Context, collection string, id interface{}) bool

passthrough the remaining functions to fulfill the Backend interface -------------------------------------------------------------------------------------------------

func (*CachingBackend) Flush

func (self *CachingBackend) Flush() error

func (*CachingBackend) GetCollection

func (self *CachingBackend) GetCollection(collection string) (*dal.Collection, error)

func (*CachingBackend) GetConnectionString

func (self *CachingBackend) GetConnectionString() *dal.ConnectionString

func (*CachingBackend) Initialize

func (self *CachingBackend) Initialize() error

func (*CachingBackend) Insert

func (self *CachingBackend) Insert(ctx context.Context, collection string, records *dal.RecordSet) error

func (*CachingBackend) ListCollections

func (self *CachingBackend) ListCollections() ([]string, error)

func (*CachingBackend) Ping

func (self *CachingBackend) Ping(ctx context.Context, d time.Duration) error

func (*CachingBackend) RegisterCollection

func (self *CachingBackend) RegisterCollection(c *dal.Collection)

func (*CachingBackend) ResetCache

func (self *CachingBackend) ResetCache()

func (*CachingBackend) Retrieve

func (self *CachingBackend) Retrieve(ctx context.Context, collection string, id interface{}, fields ...string) (*dal.Record, error)

func (*CachingBackend) SetIndexer

func (self *CachingBackend) SetIndexer(cs dal.ConnectionString) error

func (*CachingBackend) String

func (self *CachingBackend) String() string

func (*CachingBackend) Supports

func (self *CachingBackend) Supports(feature ...BackendFeature) bool

func (*CachingBackend) Update

func (self *CachingBackend) Update(ctx context.Context, collection string, records *dal.RecordSet, target ...string) error

func (*CachingBackend) WithAggregator

func (self *CachingBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*CachingBackend) WithSearch

func (self *CachingBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type ConnectOptions

type ConnectOptions struct {
	Endpoint              string   `json:"endpoint"`
	Indexer               string   `json:"indexer"`
	AdditionalIndexers    []string `json:"additional_indexers"`
	SkipInitialize        bool     `json:"skip_initialize"`
	AutocreateCollections bool     `json:"autocreate_collections"`
}

type DynamoBackend

type DynamoBackend struct {
	Backend
	Indexer
	// contains filtered or unexported fields
}

func (*DynamoBackend) CreateCollection

func (self *DynamoBackend) CreateCollection(ctx context.Context, definition *dal.Collection) error

func (*DynamoBackend) Delete

func (self *DynamoBackend) Delete(ctx context.Context, name string, ids ...interface{}) error

func (*DynamoBackend) DeleteCollection

func (self *DynamoBackend) DeleteCollection(ctx context.Context, name string) error

func (*DynamoBackend) DeleteQuery

func (self *DynamoBackend) DeleteQuery(ctx context.Context, collection *dal.Collection, flt *filter.Filter) error

func (*DynamoBackend) Exists

func (self *DynamoBackend) Exists(ctx context.Context, name string, id interface{}) bool

func (*DynamoBackend) Flush

func (self *DynamoBackend) Flush() error

func (*DynamoBackend) FlushIndex

func (self *DynamoBackend) FlushIndex() error

func (*DynamoBackend) GetBackend

func (self *DynamoBackend) GetBackend() Backend

func (*DynamoBackend) GetCollection

func (self *DynamoBackend) GetCollection(name string) (*dal.Collection, error)

func (*DynamoBackend) GetConnectionString

func (self *DynamoBackend) GetConnectionString() *dal.ConnectionString

func (*DynamoBackend) Index

func (self *DynamoBackend) Index(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error

func (*DynamoBackend) IndexConnectionString

func (self *DynamoBackend) IndexConnectionString() *dal.ConnectionString

func (*DynamoBackend) IndexExists

func (self *DynamoBackend) IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool

func (*DynamoBackend) IndexInitialize

func (self *DynamoBackend) IndexInitialize(Backend) error

func (*DynamoBackend) IndexRemove

func (self *DynamoBackend) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error

func (*DynamoBackend) IndexRetrieve

func (self *DynamoBackend) IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*DynamoBackend) Initialize

func (self *DynamoBackend) Initialize() error

func (*DynamoBackend) Insert

func (self *DynamoBackend) Insert(ctx context.Context, name string, records *dal.RecordSet) error

func (*DynamoBackend) ListCollections

func (self *DynamoBackend) ListCollections() ([]string, error)

func (*DynamoBackend) ListValues

func (self *DynamoBackend) ListValues(ctx context.Context, collection *dal.Collection, fields []string, flt *filter.Filter) (map[string][]interface{}, error)

func (*DynamoBackend) Ping

func (self *DynamoBackend) Ping(ctx context.Context, timeout time.Duration) error

func (*DynamoBackend) Query

func (self *DynamoBackend) Query(ctx context.Context, collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*DynamoBackend) QueryFunc

func (self *DynamoBackend) QueryFunc(ctx context.Context, collection *dal.Collection, flt *filter.Filter, resultFn IndexResultFunc) error

func (*DynamoBackend) RegisterCollection

func (self *DynamoBackend) RegisterCollection(definition *dal.Collection)

func (*DynamoBackend) Retrieve

func (self *DynamoBackend) Retrieve(ctx context.Context, name string, id interface{}, fields ...string) (*dal.Record, error)

func (*DynamoBackend) SetEndpoint added in v4.0.2

func (self *DynamoBackend) SetEndpoint(endpoint string)

func (*DynamoBackend) SetIndexer

func (self *DynamoBackend) SetIndexer(indexConnString dal.ConnectionString) error

func (*DynamoBackend) String

func (self *DynamoBackend) String() string

func (*DynamoBackend) Supports

func (self *DynamoBackend) Supports(features ...BackendFeature) bool

func (*DynamoBackend) Update

func (self *DynamoBackend) Update(ctx context.Context, name string, records *dal.RecordSet, target ...string) error

func (*DynamoBackend) WithAggregator

func (self *DynamoBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*DynamoBackend) WithSearch

func (self *DynamoBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type ElasticsearchIndexer

type ElasticsearchIndexer struct {
	Indexer
	// contains filtered or unexported fields
}

func NewElasticsearchIndexer

func NewElasticsearchIndexer(connection dal.ConnectionString) *ElasticsearchIndexer

func (*ElasticsearchIndexer) AggregatorConnectionString

func (self *ElasticsearchIndexer) AggregatorConnectionString() *dal.ConnectionString

func (*ElasticsearchIndexer) AggregatorInitialize

func (self *ElasticsearchIndexer) AggregatorInitialize(parent Backend) error

func (*ElasticsearchIndexer) Average

func (self *ElasticsearchIndexer) Average(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*ElasticsearchIndexer) Count

func (self *ElasticsearchIndexer) Count(ctx context.Context, collection *dal.Collection, flt ...*filter.Filter) (uint64, error)

func (*ElasticsearchIndexer) DeleteQuery

func (self *ElasticsearchIndexer) DeleteQuery(ctx context.Context, collection *dal.Collection, f *filter.Filter) error

func (*ElasticsearchIndexer) FlushIndex

func (self *ElasticsearchIndexer) FlushIndex() error

func (*ElasticsearchIndexer) GetBackend

func (self *ElasticsearchIndexer) GetBackend() Backend

func (*ElasticsearchIndexer) GroupBy

func (self *ElasticsearchIndexer) GroupBy(ctx context.Context, collection *dal.Collection, groupBy []string, aggregates []filter.Aggregate, flt ...*filter.Filter) (*dal.RecordSet, error)

func (*ElasticsearchIndexer) Index

func (self *ElasticsearchIndexer) Index(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error

func (*ElasticsearchIndexer) IndexConnectionString

func (self *ElasticsearchIndexer) IndexConnectionString() *dal.ConnectionString

func (*ElasticsearchIndexer) IndexExists

func (self *ElasticsearchIndexer) IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool

func (*ElasticsearchIndexer) IndexInitialize

func (self *ElasticsearchIndexer) IndexInitialize(parent Backend) error

func (*ElasticsearchIndexer) IndexRemove

func (self *ElasticsearchIndexer) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error

func (*ElasticsearchIndexer) IndexRetrieve

func (self *ElasticsearchIndexer) IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*ElasticsearchIndexer) ListValues

func (self *ElasticsearchIndexer) ListValues(ctx context.Context, collection *dal.Collection, fields []string, f *filter.Filter) (map[string][]interface{}, error)

func (*ElasticsearchIndexer) Maximum

func (self *ElasticsearchIndexer) Maximum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*ElasticsearchIndexer) Minimum

func (self *ElasticsearchIndexer) Minimum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*ElasticsearchIndexer) Query

func (self *ElasticsearchIndexer) Query(ctx context.Context, collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*ElasticsearchIndexer) QueryFunc

func (self *ElasticsearchIndexer) QueryFunc(ctx context.Context, collection *dal.Collection, f *filter.Filter, resultFn IndexResultFunc) error

func (*ElasticsearchIndexer) Sum

func (self *ElasticsearchIndexer) Sum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

type IndexOperation

type IndexOperation int
const (
	RetrieveOperation IndexOperation = iota
	PersistOperation
	DeleteOperation
	InspectionOperation
)

type IndexPage

type IndexPage struct {
	Page         int
	TotalPages   int
	Limit        int
	Offset       int
	TotalResults int64
}

type IndexResultFunc

type IndexResultFunc func(record *dal.Record, err error, page IndexPage) error // {}

type IndexSelectionStrategy

type IndexSelectionStrategy int
const (
	Sequential IndexSelectionStrategy = iota
	All
	First
	AllExceptFirst
	Random
)

func (IndexSelectionStrategy) IsCompoundable

func (self IndexSelectionStrategy) IsCompoundable() bool

type Indexer

type Indexer interface {
	IndexConnectionString() *dal.ConnectionString
	IndexInitialize(Backend) error
	IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool
	IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)
	IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error
	Index(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error
	QueryFunc(ctx context.Context, collection *dal.Collection, filter *filter.Filter, resultFn IndexResultFunc) error
	Query(ctx context.Context, collection *dal.Collection, filter *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)
	ListValues(ctx context.Context, collection *dal.Collection, fields []string, filter *filter.Filter) (map[string][]interface{}, error)
	DeleteQuery(ctx context.Context, collection *dal.Collection, f *filter.Filter) error
	FlushIndex() error
	GetBackend() Backend
}

func MakeIndexer

func MakeIndexer(connection dal.ConnectionString) (Indexer, error)

type IndexerResult

type IndexerResult struct {
	Index   int
	Indexer Indexer
}

type IndexerResultFunc

type IndexerResultFunc func(indexer Indexer, current int, last int) error // {}

type Mapper

type Mapper interface {
	GetBackend() Backend
	GetCollection() *dal.Collection
	Migrate(ctx context.Context) error
	Drop(ctx context.Context) error
	Exists(ctx context.Context, id interface{}) bool
	Create(ctx context.Context, from interface{}) error
	Get(ctx context.Context, id interface{}, into interface{}) error
	Update(ctx context.Context, from interface{}) error
	CreateOrUpdate(ctx context.Context, id interface{}, from interface{}) error
	Delete(ctx context.Context, ids ...interface{}) error
	DeleteQuery(ctx context.Context, flt interface{}) error
	Find(ctx context.Context, flt interface{}, into interface{}) error
	FindFunc(ctx context.Context, flt interface{}, destZeroValue interface{}, resultFn ResultFunc) error
	All(ctx context.Context, into interface{}) error
	Each(ctx context.Context, destZeroValue interface{}, resultFn ResultFunc) error
	List(ctx context.Context, fields []string) (map[string][]interface{}, error)
	ListWithFilter(ctx context.Context, fields []string, flt interface{}) (map[string][]interface{}, error)
	Sum(ctx context.Context, field string, flt interface{}) (float64, error)
	Count(ctx context.Context, flt interface{}) (uint64, error)
	Minimum(ctx context.Context, field string, flt interface{}) (float64, error)
	Maximum(ctx context.Context, field string, flt interface{}) (float64, error)
	Average(ctx context.Context, field string, flt interface{}) (float64, error)
	GroupBy(ctx context.Context, fields []string, aggregates []filter.Aggregate, flt interface{}) (*dal.RecordSet, error)
}

type MultiIndex

type MultiIndex struct {
	RetrievalStrategy  IndexSelectionStrategy
	PersistStrategy    IndexSelectionStrategy
	DeleteStrategy     IndexSelectionStrategy
	InspectionStrategy IndexSelectionStrategy
	// contains filtered or unexported fields
}

func NewMultiIndex

func NewMultiIndex(connectionStrings ...string) *MultiIndex

func (*MultiIndex) AddIndexer

func (self *MultiIndex) AddIndexer(indexer Indexer) error

func (*MultiIndex) AddIndexerByConnectionString

func (self *MultiIndex) AddIndexerByConnectionString(cs string) error

func (*MultiIndex) DeleteQuery

func (self *MultiIndex) DeleteQuery(ctx context.Context, collection *dal.Collection, f *filter.Filter) error

func (*MultiIndex) EachSelectedIndex

func (self *MultiIndex) EachSelectedIndex(ctx context.Context, collection *dal.Collection, operation IndexOperation, resultFn IndexerResultFunc) error

func (*MultiIndex) FlushIndex

func (self *MultiIndex) FlushIndex() error

func (*MultiIndex) GetBackend

func (self *MultiIndex) GetBackend() Backend

func (*MultiIndex) Index

func (self *MultiIndex) Index(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error

func (*MultiIndex) IndexConnectionString

func (self *MultiIndex) IndexConnectionString() *dal.ConnectionString

func (*MultiIndex) IndexExists

func (self *MultiIndex) IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool

func (*MultiIndex) IndexInitialize

func (self *MultiIndex) IndexInitialize(backend Backend) error

func (*MultiIndex) IndexRemove

func (self *MultiIndex) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error

func (*MultiIndex) IndexRetrieve

func (self *MultiIndex) IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*MultiIndex) ListValues

func (self *MultiIndex) ListValues(ctx context.Context, collection *dal.Collection, fields []string, filter *filter.Filter) (map[string][]interface{}, error)

func (*MultiIndex) Query

func (self *MultiIndex) Query(ctx context.Context, collection *dal.Collection, filter *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*MultiIndex) QueryFunc

func (self *MultiIndex) QueryFunc(ctx context.Context, collection *dal.Collection, filter *filter.Filter, resultFn IndexResultFunc) error

func (*MultiIndex) SelectIndex

func (self *MultiIndex) SelectIndex(collection *dal.Collection, operation IndexOperation, lastIndexer int) ([]IndexerResult, error)

type ResultFunc

type ResultFunc func(ptrToInstance interface{}, err error) // {}

type SqlBackend

type SqlBackend struct {
	Backend
	Indexer
	Aggregator
	// contains filtered or unexported fields
}

func (*SqlBackend) AggregatorConnectionString

func (self *SqlBackend) AggregatorConnectionString() *dal.ConnectionString

func (*SqlBackend) AggregatorInitialize

func (self *SqlBackend) AggregatorInitialize(parent Backend) error

func (*SqlBackend) Average

func (self *SqlBackend) Average(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*SqlBackend) Count

func (self *SqlBackend) Count(ctx context.Context, collection *dal.Collection, f ...*filter.Filter) (uint64, error)

func (*SqlBackend) CreateCollection

func (self *SqlBackend) CreateCollection(ctx context.Context, definition *dal.Collection) error

func (*SqlBackend) Delete

func (self *SqlBackend) Delete(ctx context.Context, name string, ids ...interface{}) error

func (*SqlBackend) DeleteCollection

func (self *SqlBackend) DeleteCollection(ctx context.Context, collectionName string) error

func (*SqlBackend) DeleteQuery

func (self *SqlBackend) DeleteQuery(ctx context.Context, collection *dal.Collection, f *filter.Filter) error

DeleteQuery removes records using a filter

func (*SqlBackend) Exists

func (self *SqlBackend) Exists(ctx context.Context, name string, id interface{}) bool

func (*SqlBackend) Flush

func (self *SqlBackend) Flush() error

func (*SqlBackend) FlushIndex

func (self *SqlBackend) FlushIndex() error

func (*SqlBackend) GetBackend

func (self *SqlBackend) GetBackend() Backend

func (*SqlBackend) GetCollection

func (self *SqlBackend) GetCollection(name string) (*dal.Collection, error)

func (*SqlBackend) GetConnectionString

func (self *SqlBackend) GetConnectionString() *dal.ConnectionString

func (*SqlBackend) GroupBy

func (self *SqlBackend) GroupBy(ctx context.Context, collection *dal.Collection, groupBy []string, aggregates []filter.Aggregate, f ...*filter.Filter) (*dal.RecordSet, error)

func (*SqlBackend) Index

func (self *SqlBackend) Index(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error

Index is a no-op, this should be handled by SqlBackend's Insert() function

func (*SqlBackend) IndexConnectionString

func (self *SqlBackend) IndexConnectionString() *dal.ConnectionString

func (*SqlBackend) IndexExists

func (self *SqlBackend) IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool

func (*SqlBackend) IndexInitialize

func (self *SqlBackend) IndexInitialize(parent Backend) error

func (*SqlBackend) IndexRemove

func (self *SqlBackend) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error

IndexRemove is a no-op, this should be handled by SqlBackend's Delete() function

func (*SqlBackend) IndexRetrieve

func (self *SqlBackend) IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*SqlBackend) Initialize

func (self *SqlBackend) Initialize() error

func (*SqlBackend) Insert

func (self *SqlBackend) Insert(ctx context.Context, name string, recordset *dal.RecordSet) error

func (*SqlBackend) ListCollections

func (self *SqlBackend) ListCollections() ([]string, error)

func (*SqlBackend) ListValues

func (self *SqlBackend) ListValues(ctx context.Context, collection *dal.Collection, fields []string, f *filter.Filter) (map[string][]interface{}, error)

func (*SqlBackend) Maximum

func (self *SqlBackend) Maximum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*SqlBackend) Migrate

func (self *SqlBackend) Migrate(ctx context.Context) error

func (*SqlBackend) Minimum

func (self *SqlBackend) Minimum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*SqlBackend) Ping

func (self *SqlBackend) Ping(ctx context.Context, timeout time.Duration) error

func (*SqlBackend) Query

func (self *SqlBackend) Query(ctx context.Context, collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*SqlBackend) QueryFunc

func (self *SqlBackend) QueryFunc(ctx context.Context, collection *dal.Collection, f *filter.Filter, resultFn IndexResultFunc) error

func (*SqlBackend) RegisterCollection

func (self *SqlBackend) RegisterCollection(collection *dal.Collection)

func (*SqlBackend) Retrieve

func (self *SqlBackend) Retrieve(ctx context.Context, name string, id interface{}, fields ...string) (*dal.Record, error)

func (*SqlBackend) SetIndexer

func (self *SqlBackend) SetIndexer(indexConnString dal.ConnectionString) error

func (*SqlBackend) String

func (self *SqlBackend) String() string

func (*SqlBackend) Sum

func (self *SqlBackend) Sum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*SqlBackend) Supports

func (self *SqlBackend) Supports(features ...BackendFeature) bool

func (*SqlBackend) Update

func (self *SqlBackend) Update(ctx context.Context, name string, recordset *dal.RecordSet, target ...string) error

func (*SqlBackend) WithAggregator

func (self *SqlBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*SqlBackend) WithSearch

func (self *SqlBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type SqlInitFunc

type SqlInitFunc func(*SqlBackend) (string, string, error)

type SqlPreInitFunc

type SqlPreInitFunc func(*SqlBackend)

Jump to

Keyboard shortcuts

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