Versions in this module Expand all Collapse all v0 v0.0.1 Nov 8, 2023 Changes in this version + const CreatedAtField + const InstancesTableName + const OperationTableName + const OrchestrationTableName + const RuntimeStateTableName + const TableNotExistsError + const UniqueViolationErrorCode + func CheckIfDatabaseInitialized(db *dbr.Connection) (bool, error) + func InitializeDatabase(connectionURL string, retries int, log logrus.FieldLogger) (*dbr.Connection, error) + func WaitForDatabaseAccess(connString string, retryCount int, sleepTime time.Duration, ...) (*dbr.Connection, error) + type Factory interface + NewReadSession func() ReadSession + NewSessionWithinTransaction func() (WriteSessionWithinTransaction, dberr.Error) + NewWriteSession func() WriteSession + func NewFactory(connection *dbr.Connection) Factory + type ReadSession interface + CountNotFinishedOperationsByInstanceID func(instanceID string) (int, dberr.Error) + FindAllInstancesForRuntimes func(runtimeIdList []string) ([]dbmodel.InstanceDTO, dberr.Error) + FindAllInstancesForSubAccounts func(subAccountslist []string) ([]dbmodel.InstanceDTO, dberr.Error) + FindAllInstancesJoinedWithOperation func(prct ...predicate.Predicate) ([]dbmodel.InstanceWithOperationDTO, dberr.Error) + GetERSContextStats func() ([]dbmodel.InstanceERSContextStatsEntry, error) + GetInstanceByID func(instanceID string) (dbmodel.InstanceDTO, dberr.Error) + GetInstanceStats func() ([]dbmodel.InstanceByGlobalAccountIDStatEntry, error) + GetLastOperation func(instanceID string) (dbmodel.OperationDTO, dberr.Error) + GetLatestRuntimeStateByRuntimeID func(runtimeID string) (dbmodel.RuntimeStateDTO, dberr.Error) + GetLatestRuntimeStateWithKymaVersionByRuntimeID func(runtimeID string) (dbmodel.RuntimeStateDTO, dberr.Error) + GetLatestRuntimeStateWithOIDCConfigByRuntimeID func(runtimeID string) (dbmodel.RuntimeStateDTO, dberr.Error) + GetLatestRuntimeStateWithReconcilerInputByRuntimeID func(runtimeID string) (dbmodel.RuntimeStateDTO, dberr.Error) + GetNotFinishedOperationsByType func(operationType internal.OperationType) ([]dbmodel.OperationDTO, dberr.Error) + GetNumberOfInstancesForGlobalAccountID func(globalAccountID string) (int, error) + GetOperationByID func(opID string) (dbmodel.OperationDTO, dberr.Error) + GetOperationByInstanceID func(inID string) (dbmodel.OperationDTO, dberr.Error) + GetOperationByTypeAndInstanceID func(inID string, opType internal.OperationType) (dbmodel.OperationDTO, dberr.Error) + GetOperationStats func() ([]dbmodel.OperationStatEntry, error) + GetOperationStatsForOrchestration func(orchestrationID string) ([]dbmodel.OperationStatEntry, error) + GetOperationsByInstanceID func(inID string) ([]dbmodel.OperationDTO, dberr.Error) + GetOperationsByTypeAndInstanceID func(inID string, opType internal.OperationType) ([]dbmodel.OperationDTO, dberr.Error) + GetOperationsForIDs func(opIdList []string) ([]dbmodel.OperationDTO, dberr.Error) + GetOrchestrationByID func(oID string) (dbmodel.OrchestrationDTO, dberr.Error) + GetRuntimeStateByOperationID func(operationID string) (dbmodel.RuntimeStateDTO, dberr.Error) + ListEvents func(filter events.EventFilter) ([]events.EventDTO, error) + ListInstances func(filter dbmodel.InstanceFilter) ([]dbmodel.InstanceDTO, int, int, error) + ListOperations func(filter dbmodel.OperationFilter) ([]dbmodel.OperationDTO, int, int, error) + ListOperationsByOrchestrationID func(orchestrationID string, filter dbmodel.OperationFilter) ([]dbmodel.OperationDTO, int, int, error) + ListOperationsByType func(operationType internal.OperationType) ([]dbmodel.OperationDTO, dberr.Error) + ListOperationsInTimeRange func(from, to time.Time) ([]dbmodel.OperationDTO, error) + ListOrchestrations func(filter dbmodel.OrchestrationFilter) ([]dbmodel.OrchestrationDTO, int, int, error) + ListRuntimeStateByRuntimeID func(runtimeID string) ([]dbmodel.RuntimeStateDTO, dberr.Error) + type Transaction interface + Commit func() dberr.Error + RollbackUnlessCommitted func() + type WriteSession interface + DeleteEvents func(until time.Time) dberr.Error + DeleteInstance func(instanceID string) dberr.Error + InsertEvent func(level events.EventLevel, message, instanceID, operationID string) dberr.Error + InsertInstance func(instance dbmodel.InstanceDTO) dberr.Error + InsertOperation func(dto dbmodel.OperationDTO) dberr.Error + InsertOrchestration func(o dbmodel.OrchestrationDTO) dberr.Error + InsertRuntimeState func(state dbmodel.RuntimeStateDTO) dberr.Error + UpdateInstance func(instance dbmodel.InstanceDTO) dberr.Error + UpdateOperation func(dto dbmodel.OperationDTO) dberr.Error + UpdateOrchestration func(o dbmodel.OrchestrationDTO) dberr.Error + type WriteSessionWithinTransaction interface