# Functions
InitAllFrameworkModels will create all framework-related tables in SQL backend NOT thread-safe.
InitEpochModel creates the backend logic epoch table if not exists Only use for business meta currently NOT thread-safe.
IsDuplicateEntryError checks whether error contains DuplicateEntry(MySQL) error or UNIQUE constraint failed(SQLite) error underlying.
IsNotFoundError checks whether the error is ErrMetaEntryNotFound TODO: refine me, need wrap error for api.
NewClient return the client to operate framework metastore.
NewDefaultDBConfig creates a default DBConfig.
NewGormDB news a gorm.DB.
NewMockClient creates a mock orm client.
NewOrmLogger returns a logger which implements logger.Interface.
WithIgnoreTraceRecordNotFoundErr sets if ignore 'record not found' error for trace.
WithSlowThreshold sets the slow log threshold for gorm log.
# Constants
TODO: split the config file.
TODO: split the config file.
TODO: split the config file.
# Interfaces
Client defines an interface that has the ability to manage every kind of logic abstraction in metastore, including project, project op, job, worker and resource.
ExecutorClient defines interface that manages executor information in metastore.
JobClient defines interface that manages job in metastore.
JobOpClient defines interface that operates job status (upper logic oriented).
ProjectClient defines interface that manages project in metastore.
ProjectOperationClient defines interface that manages project operation in metastore TODO: support pagination and cursor here support `order by time desc limit N`.
ResourceClient defines interface that manages resource in metastore.
Result defines a query result interface.
WorkerClient defines interface that manages worker in metastore.