3
0

More verbose info on store scan error

This commit is contained in:
Denis Arh
2021-01-20 19:54:25 +01:00
parent 9290bff442
commit d44e3474e8
26 changed files with 88 additions and 25 deletions
+1 -1
View File
@@ -566,7 +566,7 @@ func (s Store) internal{{ export $.Types.Singular }}RowScanner({{ template "extr
}
if err != nil {
return nil, errors.Store("could not scan {{ unexport $.Types.Singular }} db row").Wrap(err)
return nil, errors.Store("could not scan {{ unexport $.Types.Singular }} db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -141,7 +141,7 @@ func (s Store) internalActionlogRowScanner(row rowScanner) (res *actionlog.Actio
}
if err != nil {
return nil, errors.Store("could not scan actionlog db row").Wrap(err)
return nil, errors.Store("could not scan actionlog db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -448,7 +448,7 @@ func (s Store) internalApplicationRowScanner(row rowScanner) (res *types.Applica
}
if err != nil {
return nil, errors.Store("could not scan application db row").Wrap(err)
return nil, errors.Store("could not scan application db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -263,7 +263,7 @@ func (s Store) internalAttachmentRowScanner(row rowScanner) (res *types.Attachme
}
if err != nil {
return nil, errors.Store("could not scan attachment db row").Wrap(err)
return nil, errors.Store("could not scan attachment db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -264,7 +264,7 @@ func (s Store) internalComposeAttachmentRowScanner(row rowScanner) (res *types.A
}
if err != nil {
return nil, errors.Store("could not scan composeAttachment db row").Wrap(err)
return nil, errors.Store("could not scan composeAttachment db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -457,7 +457,7 @@ func (s Store) internalComposeChartRowScanner(row rowScanner) (res *types.Chart,
}
if err != nil {
return nil, errors.Store("could not scan composeChart db row").Wrap(err)
return nil, errors.Store("could not scan composeChart db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -260,7 +260,7 @@ func (s Store) internalComposeModuleFieldRowScanner(row rowScanner) (res *types.
}
if err != nil {
return nil, errors.Store("could not scan composeModuleField db row").Wrap(err)
return nil, errors.Store("could not scan composeModuleField db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -467,7 +467,7 @@ func (s Store) internalComposeModuleRowScanner(row rowScanner) (res *types.Modul
}
if err != nil {
return nil, errors.Store("could not scan composeModule db row").Wrap(err)
return nil, errors.Store("could not scan composeModule db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -456,7 +456,7 @@ func (s Store) internalComposeNamespaceRowScanner(row rowScanner) (res *types.Na
}
if err != nil {
return nil, errors.Store("could not scan composeNamespace db row").Wrap(err)
return nil, errors.Store("could not scan composeNamespace db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -472,7 +472,7 @@ func (s Store) internalComposePageRowScanner(row rowScanner) (res *types.Page, e
}
if err != nil {
return nil, errors.Store("could not scan composePage db row").Wrap(err)
return nil, errors.Store("could not scan composePage db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -244,7 +244,7 @@ func (s Store) internalComposeRecordValueRowScanner(_mod *types.Module, row rowS
}
if err != nil {
return nil, errors.Store("could not scan composeRecordValue db row").Wrap(err)
return nil, errors.Store("could not scan composeRecordValue db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -383,7 +383,7 @@ func (s Store) internalComposeRecordRowScanner(_mod *types.Module, row rowScanne
}
if err != nil {
return nil, errors.Store("could not scan composeRecord db row").Wrap(err)
return nil, errors.Store("could not scan composeRecord db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -254,7 +254,7 @@ func (s Store) internalCredentialsRowScanner(row rowScanner) (res *types.Credent
}
if err != nil {
return nil, errors.Store("could not scan credentials db row").Wrap(err)
return nil, errors.Store("could not scan credentials db row: %s", err).Wrap(err)
} else {
return res, nil
}
@@ -452,7 +452,7 @@ func (s Store) internalFederationExposedModuleRowScanner(row rowScanner) (res *t
}
if err != nil {
return nil, errors.Store("could not scan federationExposedModule db row").Wrap(err)
return nil, errors.Store("could not scan federationExposedModule db row: %s", err).Wrap(err)
} else {
return res, nil
}
@@ -470,7 +470,7 @@ func (s Store) internalFederationModuleMappingRowScanner(row rowScanner) (res *t
}
if err != nil {
return nil, errors.Store("could not scan federationModuleMapping db row").Wrap(err)
return nil, errors.Store("could not scan federationModuleMapping db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -282,7 +282,7 @@ func (s Store) internalFederationNodeRowScanner(row rowScanner) (res *types.Node
}
if err != nil {
return nil, errors.Store("could not scan federationNode db row").Wrap(err)
return nil, errors.Store("could not scan federationNode db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -456,7 +456,7 @@ func (s Store) internalFederationNodesSyncRowScanner(row rowScanner) (res *types
}
if err != nil {
return nil, errors.Store("could not scan federationNodesSync db row").Wrap(err)
return nil, errors.Store("could not scan federationNodesSync db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -451,7 +451,7 @@ func (s Store) internalFederationSharedModuleRowScanner(row rowScanner) (res *ty
}
if err != nil {
return nil, errors.Store("could not scan federationSharedModule db row").Wrap(err)
return nil, errors.Store("could not scan federationSharedModule db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -251,7 +251,7 @@ func (s Store) internalLabelRowScanner(row rowScanner) (res *types.Label, err er
}
if err != nil {
return nil, errors.Store("could not scan label db row").Wrap(err)
return nil, errors.Store("could not scan label db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -239,7 +239,7 @@ func (s Store) internalRbacRuleRowScanner(row rowScanner) (res *rbac.Rule, err e
}
if err != nil {
return nil, errors.Store("could not scan rbacRule db row").Wrap(err)
return nil, errors.Store("could not scan rbacRule db row: %s", err).Wrap(err)
} else {
return res, nil
}
+63
View File
@@ -77,6 +77,10 @@ func (s Schema) Tables() []*Table {
s.FederationModuleMapping(),
s.FederationNodes(),
s.FederationNodesSync(),
s.AutomationWorkflows(),
s.AutomationTriggers(),
s.AutomationSessions(),
//s.AutomationState(),
}
}
@@ -565,3 +569,62 @@ func (Schema) FederationNodesSync() *Table {
ColumnDef("time_action", ColumnTypeTimestamp),
)
}
func (Schema) AutomationWorkflows() *Table {
return TableDef("automation_workflows",
ID,
ColumnDef("handle", ColumnTypeVarchar, ColumnTypeLength(handleLength)),
ColumnDef("meta", ColumnTypeJson),
ColumnDef("enabled", ColumnTypeBoolean),
ColumnDef("trace", ColumnTypeBoolean),
ColumnDef("keep_sessions", ColumnTypeInteger),
ColumnDef("scope", ColumnTypeJson),
ColumnDef("steps", ColumnTypeJson),
ColumnDef("paths", ColumnTypeJson),
ColumnDef("run_as", ColumnTypeIdentifier),
ColumnDef("owned_by", ColumnTypeIdentifier),
CUDTimestamps,
CUDUsers,
AddIndex("unique_handle", IExpr("LOWER(handle)"), IWhere("LENGTH(handle) > 0 AND deleted_at IS NULL")),
)
}
func (Schema) AutomationSessions() *Table {
return TableDef("automation_sessions",
ID,
ColumnDef("rel_workflow", ColumnTypeIdentifier),
ColumnDef("status", ColumnTypeInteger),
ColumnDef("event_type", ColumnTypeText, ColumnTypeLength(handleLength)),
ColumnDef("resource_type", ColumnTypeText, ColumnTypeLength(handleLength)),
ColumnDef("input", ColumnTypeJson),
ColumnDef("output", ColumnTypeJson),
ColumnDef("stacktrace", ColumnTypeJson),
ColumnDef("created_by", ColumnTypeIdentifier),
ColumnDef("created_at", ColumnTypeTimestamp),
ColumnDef("purge_at", ColumnTypeTimestamp, Null),
ColumnDef("suspended_at", ColumnTypeTimestamp, Null),
ColumnDef("completed_at", ColumnTypeTimestamp, Null),
ColumnDef("error", ColumnTypeText),
AddIndex("workflow", IColumn("rel_workflow")),
)
}
func (Schema) AutomationTriggers() *Table {
return TableDef("automation_triggers",
ID,
ColumnDef("rel_workflow", ColumnTypeIdentifier),
ColumnDef("rel_step", ColumnTypeIdentifier),
ColumnDef("enabled", ColumnTypeBoolean),
ColumnDef("resource_type", ColumnTypeText, ColumnTypeLength(handleLength)),
ColumnDef("event_type", ColumnTypeText, ColumnTypeLength(handleLength)),
ColumnDef("constraints", ColumnTypeJson),
ColumnDef("input", ColumnTypeJson),
ColumnDef("owned_by", ColumnTypeIdentifier),
CUDTimestamps,
CUDUsers,
AddIndex("workflow", IColumn("rel_workflow")),
)
}
+1 -1
View File
@@ -452,7 +452,7 @@ func (s Store) internalReminderRowScanner(row rowScanner) (res *types.Reminder,
}
if err != nil {
return nil, errors.Store("could not scan reminder db row").Wrap(err)
return nil, errors.Store("could not scan reminder db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -238,7 +238,7 @@ func (s Store) internalRoleMemberRowScanner(row rowScanner) (res *types.RoleMemb
}
if err != nil {
return nil, errors.Store("could not scan roleMember db row").Wrap(err)
return nil, errors.Store("could not scan roleMember db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -470,7 +470,7 @@ func (s Store) internalRoleRowScanner(row rowScanner) (res *types.Role, err erro
}
if err != nil {
return nil, errors.Store("could not scan role db row").Wrap(err)
return nil, errors.Store("could not scan role db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -259,7 +259,7 @@ func (s Store) internalSettingRowScanner(row rowScanner) (res *types.SettingValu
}
if err != nil {
return nil, errors.Store("could not scan setting db row").Wrap(err)
return nil, errors.Store("could not scan setting db row: %s", err).Wrap(err)
} else {
return res, nil
}
+1 -1
View File
@@ -484,7 +484,7 @@ func (s Store) internalUserRowScanner(row rowScanner) (res *types.User, err erro
}
if err != nil {
return nil, errors.Store("could not scan user db row").Wrap(err)
return nil, errors.Store("could not scan user db row: %s", err).Wrap(err)
} else {
return res, nil
}