beeorm

package module
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 31 Imported by: 5

README

BeeORM

Golang ORM designed for optimal performance with MySQL and Redis

codecov Go Report Card MIT license

Official documentation

Documentation

Index

Constants

View Source
const BackgroundConsumerGroupName = "orm-async-consumer"
View Source
const LazyChannelName = "orm-lazy-channel"
View Source
const LogChannelName = "orm-log-channel"
View Source
const RedisStreamGarbageCollectorChannelName = "orm-stream-garbage-collector"

Variables

This section is empty.

Functions

func DisableCacheHashCheck added in v1.1.4

func DisableCacheHashCheck()

func SetUUIDServerID added in v1.11.0

func SetUUIDServerID(id uint16)

Types

type Alter

type Alter struct {
	SQL  string
	Safe bool
	Pool string
	// contains filtered or unexported fields
}

func (Alter) Exec

func (a Alter) Exec()

type BackgroundConsumer

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

func NewBackgroundConsumer

func NewBackgroundConsumer(engine Engine) *BackgroundConsumer

func (*BackgroundConsumer) Digest

func (r *BackgroundConsumer) Digest(ctx context.Context) bool

func (*BackgroundConsumer) DisableBlockMode added in v1.14.0

func (b *BackgroundConsumer) DisableBlockMode()

func (*BackgroundConsumer) GetLazyFlushEventsSample added in v1.4.2

func (r *BackgroundConsumer) GetLazyFlushEventsSample(count int64) []string

func (*BackgroundConsumer) RegisterLazyFlushQueryErrorResolver added in v1.14.0

func (r *BackgroundConsumer) RegisterLazyFlushQueryErrorResolver(resolver LazyFlushQueryErrorResolver)

func (*BackgroundConsumer) SetBlockTime added in v1.15.10

func (r *BackgroundConsumer) SetBlockTime(ttl time.Duration)

type Bind

type Bind map[string]interface{}

type CachedQuery

type CachedQuery struct{}

type DB

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

func (*DB) Begin

func (db *DB) Begin()

func (*DB) Commit

func (db *DB) Commit()

func (*DB) Exec

func (db *DB) Exec(query string, args ...interface{}) ExecResult

func (*DB) GetPoolConfig

func (db *DB) GetPoolConfig() MySQLPoolConfig

func (*DB) IsInTransaction

func (db *DB) IsInTransaction() bool

func (*DB) Query

func (db *DB) Query(query string, args ...interface{}) (rows Rows, close func())

func (*DB) QueryRow

func (db *DB) QueryRow(query *Where, toFill ...interface{}) (found bool)

func (*DB) Rollback

func (db *DB) Rollback()

type DuplicatedKeyError

type DuplicatedKeyError struct {
	Message string
	Index   string
}

func (*DuplicatedKeyError) Error

func (err *DuplicatedKeyError) Error() string

type Engine

type Engine interface {
	Clone() Engine
	EnableRequestCache()
	SetQueryTimeLimit(seconds int)
	GetMysql(code ...string) *DB
	GetLocalCache(code ...string) *LocalCache
	GetRedis(code ...string) *RedisCache
	SetLogMetaData(key string, value interface{})
	NewFlusher() Flusher
	Flush(entity ...Entity)
	FlushLazy(entity ...Entity)
	FlushWithCheck(entity ...Entity) error
	FlushWithFullCheck(entity ...Entity) error
	Delete(entity ...Entity)
	DeleteLazy(entity ...Entity)
	ForceDelete(entity ...Entity)
	GetRegistry() ValidatedRegistry
	SearchWithCount(where *Where, pager *Pager, entities interface{}, references ...string) (totalRows int)
	Search(where *Where, pager *Pager, entities interface{}, references ...string)
	SearchIDsWithCount(where *Where, pager *Pager, entity Entity) (results []uint64, totalRows int)
	SearchIDs(where *Where, pager *Pager, entity Entity) []uint64
	SearchOne(where *Where, entity Entity, references ...string) (found bool)
	CachedSearchOne(entity Entity, indexName string, arguments ...interface{}) (found bool)
	CachedSearchOneWithReferences(entity Entity, indexName string, arguments []interface{}, references []string) (found bool)
	CachedSearch(entities interface{}, indexName string, pager *Pager, arguments ...interface{}) (totalRows int)
	CachedSearchIDs(entity Entity, indexName string, pager *Pager, arguments ...interface{}) (totalRows int, ids []uint64)
	CachedSearchCount(entity Entity, indexName string, arguments ...interface{}) int
	CachedSearchWithReferences(entities interface{}, indexName string, pager *Pager, arguments []interface{}, references []string) (totalRows int)
	ClearCacheByIDs(entity Entity, ids ...uint64)
	LoadByID(id uint64, entity Entity, references ...string) (found bool)
	Load(entity Entity, references ...string) (found bool)
	LoadByIDs(ids []uint64, entities interface{}, references ...string) (found bool)
	GetAlters() (alters []Alter)
	GetEventBroker() EventBroker
	RegisterQueryLogger(handler LogHandler, mysql, redis, local bool)
	EnableQueryDebug()
	EnableQueryDebugCustom(mysql, redis, local bool)
}

type Entity

type Entity interface {
	GetID() uint64

	IsLoaded() bool
	IsDirty() bool
	IsToDelete() bool
	GetDirtyBind() (bind Bind, has bool)
	SetOnDuplicateKeyUpdate(bind Bind)
	SetEntityLogMeta(key string, value interface{})
	SetField(field string, value interface{}) error
	Clone() Entity
	SetMemoryOnly(memory bool)
	// contains filtered or unexported methods
}

type EntityLog added in v1.13.0

type EntityLog struct {
	LogID    uint64
	EntityID uint64
	Date     time.Time
	Meta     map[string]interface{}
	Before   map[string]interface{}
	Changes  map[string]interface{}
}

type Enum

type Enum interface {
	GetFields() []string
	GetDefault() string
	Has(value string) bool
	Index(value string) int
}

type Event

type Event interface {
	Ack()
	ID() string
	Stream() string
	Tag(key string) (value string)
	Unserialize(val interface{})
	// contains filtered or unexported methods
}

type EventBroker

type EventBroker interface {
	Publish(stream string, body interface{}, meta ...string) (id string)
	Consumer(group string) EventsConsumer
	NewFlusher() EventFlusher
	GetStreamsStatistics(stream ...string) []*RedisStreamStatistics
	GetStreamStatistics(stream string) *RedisStreamStatistics
	GetStreamGroupStatistics(stream, group string) *RedisStreamGroupStatistics
}

type EventConsumerHandler

type EventConsumerHandler func([]Event)

type EventFlusher

type EventFlusher interface {
	Publish(stream string, body interface{}, meta ...string)
	Flush()
}

type EventsConsumer

type EventsConsumer interface {
	Consume(ctx context.Context, count int, handler EventConsumerHandler) bool
	ConsumeMany(ctx context.Context, nr, count int, handler EventConsumerHandler) bool
	Claim(from, to int)
	DisableBlockMode()
	SetBlockTime(ttl time.Duration)
}

type ExecResult

type ExecResult interface {
	LastInsertId() uint64
	RowsAffected() uint64
}

type Flusher

type Flusher interface {
	Track(entity ...Entity) Flusher
	Flush()
	FlushWithCheck() error
	FlushWithFullCheck() error
	FlushLazy()
	Clear()
	Delete(entity ...Entity) Flusher
	ForceDelete(entity ...Entity) Flusher
	CancelDelete(entity ...Entity) Flusher
}

type ForeignKeyError

type ForeignKeyError struct {
	Message    string
	Constraint string
}

func (*ForeignKeyError) Error

func (err *ForeignKeyError) Error() string

type LazyFlushQueryErrorResolver added in v1.14.0

type LazyFlushQueryErrorResolver func(engine Engine, db *DB, sql string, queryError *mysql.MySQLError) error

type LocalCache

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

func (*LocalCache) Clear

func (c *LocalCache) Clear()

func (*LocalCache) Get

func (c *LocalCache) Get(key string) (value interface{}, ok bool)

func (*LocalCache) GetObjectsCount added in v1.0.32

func (c *LocalCache) GetObjectsCount() int

func (*LocalCache) GetPoolConfig

func (c *LocalCache) GetPoolConfig() LocalCachePoolConfig

func (*LocalCache) GetSet

func (c *LocalCache) GetSet(key string, ttl time.Duration, provider func() interface{}) interface{}

func (*LocalCache) MGet

func (c *LocalCache) MGet(keys ...string) []interface{}

func (*LocalCache) MSet

func (c *LocalCache) MSet(pairs ...interface{})

func (*LocalCache) Remove

func (c *LocalCache) Remove(keys ...string)

func (*LocalCache) Set

func (c *LocalCache) Set(key string, value interface{})

type LocalCachePoolConfig

type LocalCachePoolConfig interface {
	GetCode() string
	GetLimit() int
}

type Lock

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

func (*Lock) Refresh

func (l *Lock) Refresh(ctx context.Context) bool

func (*Lock) Release

func (l *Lock) Release()

func (*Lock) TTL

func (l *Lock) TTL() time.Duration

type Locker

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

func (*Locker) Obtain

func (l *Locker) Obtain(ctx context.Context, key string, ttl time.Duration, waitTimeout time.Duration) (lock *Lock, obtained bool)

type LogHandler

type LogHandler interface {
	Handle(log map[string]interface{})
}

type LogQueueValue

type LogQueueValue struct {
	PoolName  string
	TableName string
	ID        uint64
	LogID     uint64
	Meta      map[string]interface{}
	Before    map[string]interface{}
	Changes   map[string]interface{}
	Updated   time.Time
}

type MySQLPoolConfig

type MySQLPoolConfig interface {
	GetCode() string
	GetDatabase() string
	GetDataSourceURI() string
	GetVersion() int
	// contains filtered or unexported methods
}

type ORM

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

func (*ORM) Clone added in v1.10.0

func (orm *ORM) Clone() Entity

func (*ORM) GetDirtyBind

func (orm *ORM) GetDirtyBind() (bind Bind, has bool)

func (*ORM) GetID

func (orm *ORM) GetID() uint64

func (*ORM) IsDirty

func (orm *ORM) IsDirty() bool

func (*ORM) IsLoaded

func (orm *ORM) IsLoaded() bool

func (*ORM) IsToDelete added in v1.15.3

func (orm *ORM) IsToDelete() bool

func (*ORM) SetEntityLogMeta

func (orm *ORM) SetEntityLogMeta(key string, value interface{})

func (*ORM) SetField

func (orm *ORM) SetField(field string, value interface{}) error

func (*ORM) SetMemoryOnly added in v1.20.1

func (orm *ORM) SetMemoryOnly(memory bool)

func (*ORM) SetOnDuplicateKeyUpdate

func (orm *ORM) SetOnDuplicateKeyUpdate(bind Bind)

type Pager

type Pager struct {
	// CurrentPage is the current page number.
	CurrentPage int

	// PageSize is the number of items per page.
	PageSize int
}

Pager represents a paginated list of results.

func NewPager

func NewPager(currentPage, pageSize int) *Pager

NewPager creates a new Pager with the given page number and page size.

func (*Pager) GetCurrentPage

func (pager *Pager) GetCurrentPage() int

GetCurrentPage returns the current page number of the Pager.

func (*Pager) GetPageSize

func (pager *Pager) GetPageSize() int

GetPageSize returns the page size of the Pager.

func (*Pager) IncrementPage

func (pager *Pager) IncrementPage()

IncrementPage increments the current page number of the Pager.

func (*Pager) String added in v1.13.0

func (pager *Pager) String() string

String returns SQL 'LIMIT X,Y'.

type PipeLineBool

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

func (*PipeLineBool) Result

func (c *PipeLineBool) Result() bool

type PipeLineGet

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

func (*PipeLineGet) Result

func (c *PipeLineGet) Result() (value string, has bool)

type PipeLineInt

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

func (*PipeLineInt) Result

func (c *PipeLineInt) Result() int64

type PipeLineString

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

func (*PipeLineString) Result

func (c *PipeLineString) Result() string

type QueryLoggerSource

type QueryLoggerSource int

type RedisCache

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

func (*RedisCache) Del

func (r *RedisCache) Del(keys ...string)

func (*RedisCache) Eval

func (r *RedisCache) Eval(script string, keys []string, args ...interface{}) interface{}

func (*RedisCache) EvalSha

func (r *RedisCache) EvalSha(sha1 string, keys []string, args ...interface{}) (res interface{}, exists bool)

func (*RedisCache) Exists

func (r *RedisCache) Exists(keys ...string) int64

func (*RedisCache) Expire

func (r *RedisCache) Expire(key string, expiration time.Duration) bool

func (*RedisCache) FlushAll

func (r *RedisCache) FlushAll()

func (*RedisCache) FlushDB

func (r *RedisCache) FlushDB()

func (*RedisCache) Get

func (r *RedisCache) Get(key string) (value string, has bool)

func (*RedisCache) GetLocker

func (r *RedisCache) GetLocker() *Locker

func (*RedisCache) GetPoolConfig

func (r *RedisCache) GetPoolConfig() RedisPoolConfig

func (*RedisCache) GetSet

func (r *RedisCache) GetSet(key string, ttlSeconds int, provider func() interface{}) interface{}

func (*RedisCache) HDel

func (r *RedisCache) HDel(key string, fields ...string)

func (*RedisCache) HGet

func (r *RedisCache) HGet(key, field string) (value string, has bool)

func (*RedisCache) HGetAll

func (r *RedisCache) HGetAll(key string) map[string]string

func (*RedisCache) HIncrBy

func (r *RedisCache) HIncrBy(key, field string, incr int64) int64

func (*RedisCache) HLen

func (r *RedisCache) HLen(key string) int64

func (*RedisCache) HMGet

func (r *RedisCache) HMGet(key string, fields ...string) map[string]interface{}

func (*RedisCache) HSet

func (r *RedisCache) HSet(key string, values ...interface{})

func (*RedisCache) HSetNx added in v1.0.18

func (r *RedisCache) HSetNx(key, field string, value interface{}) bool

func (*RedisCache) Incr

func (r *RedisCache) Incr(key string) int64

func (*RedisCache) IncrBy

func (r *RedisCache) IncrBy(key string, incr int64) int64

func (*RedisCache) IncrWithExpire added in v1.0.29

func (r *RedisCache) IncrWithExpire(key string, expire time.Duration) int64

func (*RedisCache) Info

func (r *RedisCache) Info(section ...string) string

func (*RedisCache) LLen

func (r *RedisCache) LLen(key string) int64

func (*RedisCache) LPush

func (r *RedisCache) LPush(key string, values ...interface{}) int64

func (*RedisCache) LRange

func (r *RedisCache) LRange(key string, start, stop int64) []string

func (*RedisCache) LRem

func (r *RedisCache) LRem(key string, count int64, value interface{})

func (*RedisCache) LSet

func (r *RedisCache) LSet(key string, index int64, value interface{})

func (*RedisCache) Ltrim

func (r *RedisCache) Ltrim(key string, start, stop int64)

func (*RedisCache) MGet

func (r *RedisCache) MGet(keys ...string) []interface{}

func (*RedisCache) MSet

func (r *RedisCache) MSet(pairs ...interface{})

func (*RedisCache) PipeLine

func (r *RedisCache) PipeLine() *RedisPipeLine

func (*RedisCache) RPop

func (r *RedisCache) RPop(key string) (value string, found bool)

func (*RedisCache) RPush

func (r *RedisCache) RPush(key string, values ...interface{}) int64

func (*RedisCache) SAdd

func (r *RedisCache) SAdd(key string, members ...interface{}) int64

func (*RedisCache) SCard

func (r *RedisCache) SCard(key string) int64

func (*RedisCache) SPop

func (r *RedisCache) SPop(key string) (string, bool)

func (*RedisCache) SPopN

func (r *RedisCache) SPopN(key string, max int64) []string

func (*RedisCache) ScriptExists added in v1.3.13

func (r *RedisCache) ScriptExists(sha1 string) bool

func (*RedisCache) ScriptLoad

func (r *RedisCache) ScriptLoad(script string) string

func (*RedisCache) Set

func (r *RedisCache) Set(key string, value interface{}, ttlSeconds int)

func (*RedisCache) SetNX

func (r *RedisCache) SetNX(key string, value interface{}, ttlSeconds int) bool

func (*RedisCache) Type

func (r *RedisCache) Type(key string) string

func (*RedisCache) XAck

func (r *RedisCache) XAck(stream, group string, ids ...string) int64

func (*RedisCache) XClaim

func (r *RedisCache) XClaim(a *redis.XClaimArgs) []redis.XMessage

func (*RedisCache) XClaimJustID

func (r *RedisCache) XClaimJustID(a *redis.XClaimArgs) []string

func (*RedisCache) XDel

func (r *RedisCache) XDel(stream string, ids ...string) int64

func (*RedisCache) XGroupCreate

func (r *RedisCache) XGroupCreate(stream, group, start string) (key string, exists bool)

func (*RedisCache) XGroupCreateMkStream

func (r *RedisCache) XGroupCreateMkStream(stream, group, start string) (key string, exists bool)

func (*RedisCache) XGroupDelConsumer

func (r *RedisCache) XGroupDelConsumer(stream, group, consumer string) int64

func (*RedisCache) XGroupDestroy

func (r *RedisCache) XGroupDestroy(stream, group string) int64

func (*RedisCache) XInfoGroups

func (r *RedisCache) XInfoGroups(stream string) []redis.XInfoGroup

func (*RedisCache) XInfoStream

func (r *RedisCache) XInfoStream(stream string) *redis.XInfoStream

func (*RedisCache) XLen

func (r *RedisCache) XLen(stream string) int64

func (*RedisCache) XPending

func (r *RedisCache) XPending(stream, group string) *redis.XPending

func (*RedisCache) XPendingExt

func (r *RedisCache) XPendingExt(a *redis.XPendingExtArgs) []redis.XPendingExt

func (*RedisCache) XRange

func (r *RedisCache) XRange(stream, start, stop string, count int64) []redis.XMessage

func (*RedisCache) XRead

func (r *RedisCache) XRead(a *redis.XReadArgs) []redis.XStream

func (*RedisCache) XReadGroup

func (r *RedisCache) XReadGroup(ctx context.Context, a *redis.XReadGroupArgs) (streams []redis.XStream)

func (*RedisCache) XRevRange

func (r *RedisCache) XRevRange(stream, start, stop string, count int64) []redis.XMessage

func (*RedisCache) XTrim

func (r *RedisCache) XTrim(stream string, maxLen int64) (deleted int64)

func (*RedisCache) ZAdd

func (r *RedisCache) ZAdd(key string, members ...redis.Z) int64

func (*RedisCache) ZCard

func (r *RedisCache) ZCard(key string) int64

func (*RedisCache) ZCount

func (r *RedisCache) ZCount(key string, min, max string) int64

func (*RedisCache) ZRangeWithScores

func (r *RedisCache) ZRangeWithScores(key string, start, stop int64) []redis.Z

func (*RedisCache) ZRemRangeByRank added in v1.5.6

func (r *RedisCache) ZRemRangeByRank(key string, start, stop int64) int64

func (*RedisCache) ZRevRange

func (r *RedisCache) ZRevRange(key string, start, stop int64) []string

func (*RedisCache) ZRevRangeWithScores

func (r *RedisCache) ZRevRangeWithScores(key string, start, stop int64) []redis.Z

func (*RedisCache) ZScore

func (r *RedisCache) ZScore(key, member string) float64

type RedisPipeLine

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

func (*RedisPipeLine) Del

func (rp *RedisPipeLine) Del(key ...string)

func (*RedisPipeLine) Exec

func (rp *RedisPipeLine) Exec()

func (*RedisPipeLine) Expire

func (rp *RedisPipeLine) Expire(key string, expiration time.Duration) *PipeLineBool

func (*RedisPipeLine) Get

func (rp *RedisPipeLine) Get(key string) *PipeLineGet

func (*RedisPipeLine) HDel

func (rp *RedisPipeLine) HDel(key string, values ...string)

func (*RedisPipeLine) HIncrBy

func (rp *RedisPipeLine) HIncrBy(key, field string, incr int64) *PipeLineInt

func (*RedisPipeLine) HSet

func (rp *RedisPipeLine) HSet(key string, values ...interface{})

func (*RedisPipeLine) Set

func (rp *RedisPipeLine) Set(key string, value interface{}, expiration time.Duration)

func (*RedisPipeLine) XAdd

func (rp *RedisPipeLine) XAdd(stream string, values []string) *PipeLineString

type RedisPoolConfig

type RedisPoolConfig interface {
	GetCode() string
	GetDatabase() int
	GetAddress() string
	GetNamespace() string
	HasNamespace() bool
	// contains filtered or unexported methods
}

type RedisStreamConsumerStatistics added in v1.13.0

type RedisStreamConsumerStatistics struct {
	Name    string
	Pending uint64
}

type RedisStreamGroupStatistics added in v1.13.0

type RedisStreamGroupStatistics struct {
	Group                 string
	Lag                   int64
	Pending               uint64
	LastDeliveredID       string
	LastDeliveredDuration time.Duration
	LowerID               string
	LowerDuration         time.Duration
	Consumers             []*RedisStreamConsumerStatistics
}

type RedisStreamStatistics added in v1.13.0

type RedisStreamStatistics struct {
	Stream             string
	RedisPool          string
	Len                uint64
	OldestEventSeconds int
	Groups             []*RedisStreamGroupStatistics
}

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) InitByYaml

func (r *Registry) InitByYaml(yaml map[string]interface{})

func (*Registry) RegisterEntity

func (r *Registry) RegisterEntity(entity ...Entity)

func (*Registry) RegisterEnum

func (r *Registry) RegisterEnum(code string, values []string, defaultValue ...string)

func (*Registry) RegisterEnumStruct

func (r *Registry) RegisterEnumStruct(code string, val interface{}, defaultValue ...string)

func (*Registry) RegisterLocalCache

func (r *Registry) RegisterLocalCache(size int, code ...string)

func (*Registry) RegisterMySQLPool

func (r *Registry) RegisterMySQLPool(dataSourceName string, code ...string)

func (*Registry) RegisterRedis

func (r *Registry) RegisterRedis(address, namespace string, db int, code ...string)

func (*Registry) RegisterRedisSentinel

func (r *Registry) RegisterRedisSentinel(masterName, namespace string, db int, sentinels []string, code ...string)

func (*Registry) RegisterRedisSentinelWithCredentials added in v1.3.23

func (r *Registry) RegisterRedisSentinelWithCredentials(masterName, namespace, user, password string, db int, sentinels []string, code ...string)

func (*Registry) RegisterRedisSentinelWithOptions added in v1.9.0

func (r *Registry) RegisterRedisSentinelWithOptions(namespace string, opts redis.FailoverOptions, db int, sentinels []string, code ...string)

func (*Registry) RegisterRedisStream

func (r *Registry) RegisterRedisStream(name string, redisPool string, groups []string)

func (*Registry) RegisterRedisWithCredentials added in v1.3.23

func (r *Registry) RegisterRedisWithCredentials(address, namespace, user, password string, db int, code ...string)

func (*Registry) SetDefaultCollate added in v1.2.2

func (r *Registry) SetDefaultCollate(collate string)

func (*Registry) SetDefaultEncoding

func (r *Registry) SetDefaultEncoding(encoding string)

func (*Registry) Validate

func (r *Registry) Validate() (validated ValidatedRegistry, err error)

type Rows

type Rows interface {
	Next() bool
	Scan(dest ...interface{})
	Columns() []string
}

type SQLRow

type SQLRow interface {
	Scan(dest ...interface{}) error
}

type SQLRows

type SQLRows interface {
	Next() bool
	Err() error
	Close() error
	Scan(dest ...interface{}) error
	Columns() ([]string, error)
}

type TableSchema

type TableSchema interface {
	GetTableName() string
	GetType() reflect.Type
	NewEntity() Entity
	DropTable(engine Engine)
	TruncateTable(engine Engine)
	UpdateSchema(engine Engine)
	UpdateSchemaAndTruncateTable(engine Engine)
	GetMysql(engine Engine) *DB
	GetLocalCache(engine Engine) (cache *LocalCache, has bool)
	GetRedisCache(engine Engine) (cache *RedisCache, has bool)
	GetReferences() []string
	GetColumns() []string
	GetUniqueIndexes() map[string][]string
	GetSchemaChanges(engine Engine) (has bool, alters []Alter)
	GetUsage(registry ValidatedRegistry) map[reflect.Type][]string
	GetEntityLogs(engine Engine, entityID uint64, pager *Pager, where *Where) []EntityLog
}

type ValidatedRegistry

type ValidatedRegistry interface {
	CreateEngine() Engine
	GetTableSchema(entityName string) TableSchema
	GetTableSchemaForEntity(entity Entity) TableSchema
	GetTableSchemaForCachePrefix(cachePrefix string) TableSchema
	GetSourceRegistry() *Registry
	GetEnum(code string) Enum
	GetRedisStreams() map[string]map[string][]string
	GetMySQLPools() map[string]MySQLPoolConfig
	GetLocalCachePools() map[string]LocalCachePoolConfig
	GetRedisPools() map[string]RedisPoolConfig
	GetEntities() map[string]reflect.Type
}

type Where

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

func NewWhere

func NewWhere(query string, parameters ...interface{}) *Where

func (*Where) Append

func (where *Where) Append(query string, parameters ...interface{})

func (*Where) GetParameters

func (where *Where) GetParameters() []interface{}

func (*Where) SetParameter

func (where *Where) SetParameter(index int, param interface{}) *Where

func (*Where) SetParameters

func (where *Where) SetParameters(params ...interface{}) *Where

func (*Where) ShowFakeDeleted added in v1.12.1

func (where *Where) ShowFakeDeleted() *Where

func (*Where) String

func (where *Where) String() string

Jump to

Keyboard shortcuts

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