From f56d61070dacebf7c7377bf5a6b6d1e64f8762f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Jerman?= Date: Thu, 23 Jun 2022 10:33:46 +0200 Subject: [PATCH] Review and add missing col sorting --- automation/session.cue | 8 +- automation/trigger.cue | 8 +- automation/workflow.cue | 2 +- compose/attachment.cue | 8 +- compose/chart.cue | 2 +- compose/module-field.cue | 6 +- compose/namespace.cue | 2 +- compose/page.cue | 6 +- federation/module-exposed.cue | 4 +- federation/module-mapping.cue | 8 +- federation/node-sync.cue | 8 +- federation/node.cue | 10 +- federation/shared-module.cue | 6 +- store/adapters/rdbms/aux_types.gen.go | 8 +- store/adapters/rdbms/queries.gen.go | 16 +- store/adapters/rdbms/rdbms.gen.go | 374 +++++++++++++++++++++----- store/interfaces.gen.go | 6 +- system/apigw_filter.cue | 8 +- system/apigw_route.cue | 8 +- system/application.cue | 2 +- system/attachment.cue | 6 +- system/auth_client.cue | 4 +- system/dal_connection.cue | 4 +- system/dal_sensitivity_level.cue | 2 +- system/queue.cue | 4 +- system/queue_message.cue | 2 +- system/reminder.cue | 2 +- system/role.cue | 2 +- system/template.cue | 6 +- system/user.cue | 8 +- 30 files changed, 393 insertions(+), 147 deletions(-) diff --git a/automation/session.cue b/automation/session.cue index 348842358..95c079de7 100644 --- a/automation/session.cue +++ b/automation/session.cue @@ -11,10 +11,10 @@ session: schema.#Resource & { struct: { id: schema.IdField - workflow_id: { ident: "workflowID", goType: "uint64", storeIdent: "rel_workflow" } - event_type: { goType: "string" } - resource_type: { goType: "string" } - status: { goType: "types.SessionStatus" } + workflow_id: { sortable: true, ident: "workflowID", goType: "uint64", storeIdent: "rel_workflow" } + event_type: { sortable: true, goType: "string" } + resource_type: { sortable: true, goType: "string" } + status: { sortable: true, goType: "types.SessionStatus" } input: { goType: "*expr.Vars" } output: { goType: "*expr.Vars" } stacktrace: { goType: "types.Stacktrace" } diff --git a/automation/trigger.cue b/automation/trigger.cue index 5814be293..ff2bdc0a6 100644 --- a/automation/trigger.cue +++ b/automation/trigger.cue @@ -7,11 +7,11 @@ import ( trigger: schema.#Resource & { struct: { id: schema.IdField - workflow_id: { ident: "workflowID", goType: "uint64", storeIdent: "rel_workflow" } + workflow_id: { sortable: true, ident: "workflowID", goType: "uint64", storeIdent: "rel_workflow" } step_id: { ident: "stepID", goType: "uint64", storeIdent: "rel_step" } - enabled: { goType: "bool" } - resource_type: { goType: "string" } - event_type: { goType: "string" } + enabled: { sortable: true, goType: "bool" } + resource_type: { sortable: true, goType: "string" } + event_type: { sortable: true, goType: "string" } meta: { goType: "*types.TriggerMeta" } constraints: { goType: "types.TriggerConstraintSet" } input: { goType: "*expr.Vars" } diff --git a/automation/workflow.cue b/automation/workflow.cue index 9a935e7af..c35e947c4 100644 --- a/automation/workflow.cue +++ b/automation/workflow.cue @@ -9,7 +9,7 @@ workflow: schema.#Resource & { id: schema.IdField handle: schema.HandleField meta: { goType: "*types.WorkflowMeta" } - enabled: { goType: "bool" } + enabled: { sortable: true, goType: "bool" } trace: { goType: "bool" } keep_sessions: { goType: "int" } scope: { goType: "*expr.Vars" } diff --git a/compose/attachment.cue b/compose/attachment.cue index 6ad8ef1d6..29541cb9b 100644 --- a/compose/attachment.cue +++ b/compose/attachment.cue @@ -11,12 +11,12 @@ attachment: schema.#Resource & { struct: { id: schema.IdField - owner_id: { goType: "uint64", storeIdent: "rel_owner", ident: "ownerID" } - namespace_id: { goType: "uint64", storeIdent: "rel_namespace", ident: "namespaceID" } - kind: {} + owner_id: { sortable: true, goType: "uint64", storeIdent: "rel_owner", ident: "ownerID" } + namespace_id: { sortable: true, goType: "uint64", storeIdent: "rel_namespace", ident: "namespaceID" } + kind: {sortable: true} url: {} preview_url: {} - name: {} + name: {sortable: true} meta: { goType: "types.AttachmentMeta" } created_at: schema.SortableTimestampField updated_at: schema.SortableTimestampNilField diff --git a/compose/chart.cue b/compose/chart.cue index 21b43f767..402950d48 100644 --- a/compose/chart.cue +++ b/compose/chart.cue @@ -14,7 +14,7 @@ chart: schema.#Resource & { handle: schema.HandleField name: {sortable: true} config: { goType: "types.ChartConfig" } - namespace_id: { ident: "namespaceID", goType: "uint64", storeIdent: "rel_namespace" } + namespace_id: { sortable: true, ident: "namespaceID", goType: "uint64", storeIdent: "rel_namespace" } created_at: schema.SortableTimestampField updated_at: schema.SortableTimestampNilField diff --git a/compose/module-field.cue b/compose/module-field.cue index 13b6d2823..eb65e1db9 100644 --- a/compose/module-field.cue +++ b/compose/module-field.cue @@ -13,9 +13,9 @@ moduleField: schema.#Resource & { struct: { id: schema.IdField namespace_id: { ident: "namespaceID", goType: "uint64", store: false } - module_id: { ident: "moduleID", goType: "uint64", storeIdent: "rel_module" } - place: { goType: "int" } - kind: { goType: "string" } + module_id: { sortable: true, ident: "moduleID", goType: "uint64", storeIdent: "rel_module" } + place: { sortable: true, goType: "int" } + kind: { sortable: true, goType: "string" } name: {sortable: true} label: {sortable: true} options: { goType: "types.ModuleFieldOptions" } diff --git a/compose/namespace.cue b/compose/namespace.cue index cc8c69d63..9fd30c9a9 100644 --- a/compose/namespace.cue +++ b/compose/namespace.cue @@ -7,7 +7,7 @@ import ( namespace: schema.#Resource & { struct: { id: schema.IdField - slug: { goType: "string" } + slug: { sortable: true, goType: "string" } enabled: { goType: "bool" } meta: { goType: "types.NamespaceMeta" } name: {} diff --git a/compose/page.cue b/compose/page.cue index 8cfeb8a93..81fc6cf2f 100644 --- a/compose/page.cue +++ b/compose/page.cue @@ -11,9 +11,9 @@ page: schema.#Resource & { struct: { id: schema.IdField - self_id: { ident: "selfID", goType: "uint64" } - module_id: { ident: "moduleID", goType: "uint64", storeIdent: "rel_module" } - namespace_id: { ident: "namespaceID", goType: "uint64", storeIdent: "rel_namespace" } + self_id: { sortable: true, ident: "selfID", goType: "uint64" } + module_id: { sortable: true, ident: "moduleID", goType: "uint64", storeIdent: "rel_module" } + namespace_id: { sortable: true, ident: "namespaceID", goType: "uint64", storeIdent: "rel_namespace" } handle: schema.HandleField config: { goType: "types.PageConfig" } blocks: { goType: "types.PageBlocks" } diff --git a/federation/module-exposed.cue b/federation/module-exposed.cue index 9c0128e2d..5a6b34a1b 100644 --- a/federation/module-exposed.cue +++ b/federation/module-exposed.cue @@ -16,8 +16,8 @@ exposedModule: schema.#Resource & { struct: { id: schema.IdField handle: schema.HandleField - name: {} - node_id: { ident: "nodeID", goType: "uint64", storeIdent: "rel_node" } + name: { sortable: true } + node_id: { sortable: true, ident: "nodeID", goType: "uint64", storeIdent: "rel_node" } compose_module_id: { ident: "composeModuleID", goType: "uint64", storeIdent: "rel_compose_module" } compose_namespace_id: { ident: "composeNamespaceID", goType: "uint64", storeIdent: "rel_compose_namespace" } fields: { goType: "types.ModuleFieldSet" } diff --git a/federation/module-mapping.cue b/federation/module-mapping.cue index 0feec4513..a4d42ee0b 100644 --- a/federation/module-mapping.cue +++ b/federation/module-mapping.cue @@ -14,10 +14,10 @@ moduleMapping: schema.#Resource & { } struct: { - node_id: { ident: "nodeID", goType: "uint64" } - federation_module_id: { ident: "federationModuleID", goType: "uint64" } - compose_module_id: { ident: "composeModuleID", goType: "uint64" } - compose_namespace_id: { ident: "composeNamespaceID", goType: "uint64" } + node_id: { ident: "nodeID", goType: "uint64", primaryKey: true, unique: true } + federation_module_id: { sortable: true, ident: "federationModuleID", goType: "uint64" } + compose_module_id: { sortable: true, ident: "composeModuleID", goType: "uint64" } + compose_namespace_id: { sortable: true, ident: "composeNamespaceID", goType: "uint64" } field_mapping: { goType: "types.ModuleFieldMappingSet" } } diff --git a/federation/node-sync.cue b/federation/node-sync.cue index 4ae1ce7ad..15a1074b3 100644 --- a/federation/node-sync.cue +++ b/federation/node-sync.cue @@ -10,10 +10,10 @@ nodeSync: schema.#Resource & { } struct: { - node_id: { ident: "nodeID", goType: "uint64", primaryKey: true } - module_id: { ident: "moduleID", goType: "uint64" } - sync_type: { goType: "string" } - sync_status: { goType: "string" } + node_id: { sortable: true, ident: "nodeID", goType: "uint64", primaryKey: true } + module_id: { sortable: true, ident: "moduleID", goType: "uint64" } + sync_type: { sortable: true, goType: "string" } + sync_status: { sortable: true, goType: "string" } } & { time_of_action: schema.SortableTimestampField } diff --git a/federation/node.cue b/federation/node.cue index 8acaadb4a..9bbf4b1a9 100644 --- a/federation/node.cue +++ b/federation/node.cue @@ -13,11 +13,11 @@ node: schema.#Resource & { struct: { id: schema.IdField - name: {} - shared_node_id: { ident: "sharedNodeID", goType: "uint64" } - base_url: { goType: "string", ident: "baseURL" } - status: { goType: "string" } - contact: { goType: "string" } + name: {sortable: true} + shared_node_id: { sortable: true, ident: "sharedNodeID", goType: "uint64" } + base_url: { sortable: true, goType: "string", ident: "baseURL" } + status: { sortable: true, goType: "string" } + contact: { sortable: true, goType: "string" } pair_token: { goType: "string" } auth_token: { goType: "string" } diff --git a/federation/shared-module.cue b/federation/shared-module.cue index f33ae4f6b..63f26720a 100644 --- a/federation/shared-module.cue +++ b/federation/shared-module.cue @@ -16,9 +16,9 @@ sharedModule: schema.#Resource & { struct: { id: schema.IdField handle: schema.HandleField - node_id: { ident: "nodeID", goType: "uint64", storeIdent: "rel_node" } - name: {} - external_federation_module_id: { ident: "externalFederationModuleID", goType: "uint64", storeIdent: "xref_module", } + node_id: { sortable: true, ident: "nodeID", goType: "uint64", storeIdent: "rel_node" } + name: {sortable: true} + external_federation_module_id: { sortable: true, ident: "externalFederationModuleID", goType: "uint64", storeIdent: "xref_module", } fields: { goType: "types.ModuleFieldSet" } created_at: schema.SortableTimestampField diff --git a/store/adapters/rdbms/aux_types.gen.go b/store/adapters/rdbms/aux_types.gen.go index 49fd78d54..6499e877a 100644 --- a/store/adapters/rdbms/aux_types.gen.go +++ b/store/adapters/rdbms/aux_types.gen.go @@ -108,8 +108,8 @@ type ( Scope string `db:"scope"` ValidGrant string `db:"valid_grant"` RedirectURI string `db:"redirect_uri"` - Trusted bool `db:"trusted"` Enabled bool `db:"enabled"` + Trusted bool `db:"trusted"` ValidFrom *time.Time `db:"valid_from"` ExpiresAt *time.Time `db:"expires_at"` Security *systemType.AuthClientSecurity `db:"security"` @@ -918,8 +918,8 @@ func (aux *auxAuthClient) encode(res *systemType.AuthClient) (_ error) { aux.Scope = res.Scope aux.ValidGrant = res.ValidGrant aux.RedirectURI = res.RedirectURI - aux.Trusted = res.Trusted aux.Enabled = res.Enabled + aux.Trusted = res.Trusted aux.ValidFrom = res.ValidFrom aux.ExpiresAt = res.ExpiresAt aux.Security = res.Security @@ -945,8 +945,8 @@ func (aux auxAuthClient) decode() (res *systemType.AuthClient, _ error) { res.Scope = aux.Scope res.ValidGrant = aux.ValidGrant res.RedirectURI = aux.RedirectURI - res.Trusted = aux.Trusted res.Enabled = aux.Enabled + res.Trusted = aux.Trusted res.ValidFrom = aux.ValidFrom res.ExpiresAt = aux.ExpiresAt res.Security = aux.Security @@ -972,8 +972,8 @@ func (aux *auxAuthClient) scan(row scanner) error { &aux.Scope, &aux.ValidGrant, &aux.RedirectURI, - &aux.Trusted, &aux.Enabled, + &aux.Trusted, &aux.ValidFrom, &aux.ExpiresAt, &aux.Security, diff --git a/store/adapters/rdbms/queries.gen.go b/store/adapters/rdbms/queries.gen.go index d9212aab7..968a138e9 100644 --- a/store/adapters/rdbms/queries.gen.go +++ b/store/adapters/rdbms/queries.gen.go @@ -601,8 +601,8 @@ var ( "scope", "valid_grant", "redirect_uri", - "trusted", "enabled", + "trusted", "valid_from", "expires_at", "security", @@ -629,8 +629,8 @@ var ( "scope": res.Scope, "valid_grant": res.ValidGrant, "redirect_uri": res.RedirectURI, - "trusted": res.Trusted, "enabled": res.Enabled, + "trusted": res.Trusted, "valid_from": res.ValidFrom, "expires_at": res.ExpiresAt, "security": res.Security, @@ -660,8 +660,8 @@ var ( "scope": res.Scope, "valid_grant": res.ValidGrant, "redirect_uri": res.RedirectURI, - "trusted": res.Trusted, "enabled": res.Enabled, + "trusted": res.Trusted, "valid_from": res.ValidFrom, "expires_at": res.ExpiresAt, "security": res.Security, @@ -689,8 +689,8 @@ var ( "scope": res.Scope, "valid_grant": res.ValidGrant, "redirect_uri": res.RedirectURI, - "trusted": res.Trusted, "enabled": res.Enabled, + "trusted": res.Trusted, "valid_from": res.ValidFrom, "expires_at": res.ExpiresAt, "security": res.Security, @@ -2827,13 +2827,12 @@ var ( // // This function is auto-generated federationModuleMappingUpsertQuery = func(d goqu.DialectWrapper, res *federationType.ModuleMapping) *goqu.InsertDataset { - var target = `` + var target = `,node_id` return federationModuleMappingInsertQuery(d, res). OnConflict( goqu.DoUpdate(target[1:], goqu.Record{ - "node_id": res.NodeID, "federation_module_id": res.FederationModuleID, "compose_module_id": res.ComposeModuleID, "compose_namespace_id": res.ComposeNamespaceID, @@ -2849,7 +2848,6 @@ var ( federationModuleMappingUpdateQuery = func(d goqu.DialectWrapper, res *federationType.ModuleMapping) *goqu.UpdateDataset { return d.Update(federationModuleMappingTable). Set(goqu.Record{ - "node_id": res.NodeID, "federation_module_id": res.FederationModuleID, "compose_module_id": res.ComposeModuleID, "compose_namespace_id": res.ComposeNamespaceID, @@ -2876,7 +2874,9 @@ var ( // // This function is auto-generated federationModuleMappingPrimaryKeys = func(res *federationType.ModuleMapping) goqu.Ex { - return goqu.Ex{} + return goqu.Ex{ + "node_id": res.NodeID, + } } // federationNodeTable represents federationNodes store table diff --git a/store/adapters/rdbms/rdbms.gen.go b/store/adapters/rdbms/rdbms.gen.go index 377f86b30..2488992d3 100644 --- a/store/adapters/rdbms/rdbms.gen.go +++ b/store/adapters/rdbms/rdbms.gen.go @@ -824,9 +824,13 @@ func (Store) sortableApigwFilterFields() map[string]string { "createdat": "created_at", "deleted_at": "deleted_at", "deletedat": "deleted_at", + "enabled": "enabled", "id": "id", + "kind": "kind", + "route": "route", "updated_at": "updated_at", "updatedat": "updated_at", + "weight": "weight", } } @@ -855,6 +859,14 @@ func (s *Store) collectApigwFilterCursorValues(res *systemType.ApigwFilter, cc . case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "route": + cur.Set(c.Column, res.Route, c.Descending) + case "weight": + cur.Set(c.Column, res.Weight, c.Descending) + case "kind": + cur.Set(c.Column, res.Kind, c.Descending) + case "enabled": + cur.Set(c.Column, res.Enabled, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -1350,7 +1362,11 @@ func (Store) sortableApigwRouteFields() map[string]string { "createdat": "created_at", "deleted_at": "deleted_at", "deletedat": "deleted_at", + "enabled": "enabled", + "endpoint": "endpoint", + "group": "group", "id": "id", + "method": "method", "updated_at": "updated_at", "updatedat": "updated_at", } @@ -1381,6 +1397,14 @@ func (s *Store) collectApigwRouteCursorValues(res *systemType.ApigwRoute, cc ... case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "endpoint": + cur.Set(c.Column, res.Endpoint, c.Descending) + case "method": + cur.Set(c.Column, res.Method, c.Descending) + case "enabled": + cur.Set(c.Column, res.Enabled, c.Descending) + case "group": + cur.Set(c.Column, res.Group, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -1834,6 +1858,7 @@ func (Store) sortableApplicationFields() map[string]string { "createdat": "created_at", "deleted_at": "deleted_at", "deletedat": "deleted_at", + "enabled": "enabled", "id": "id", "name": "name", "owner_id": "owner_id", @@ -1873,6 +1898,8 @@ func (s *Store) collectApplicationCursorValues(res *systemType.Application, cc . cur.Set(c.Column, res.Name, c.Descending) case "ownerID": cur.Set(c.Column, res.OwnerID, c.Descending) + case "enabled": + cur.Set(c.Column, res.Enabled, c.Descending) case "weight": cur.Set(c.Column, res.Weight, c.Descending) case "createdAt": @@ -2327,6 +2354,10 @@ func (Store) sortableAttachmentFields() map[string]string { "deleted_at": "deleted_at", "deletedat": "deleted_at", "id": "id", + "kind": "kind", + "name": "name", + "owner_id": "owner_id", + "ownerid": "owner_id", "updated_at": "updated_at", "updatedat": "updated_at", } @@ -2357,6 +2388,12 @@ func (s *Store) collectAttachmentCursorValues(res *systemType.Attachment, cc ... case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "ownerID": + cur.Set(c.Column, res.OwnerID, c.Descending) + case "kind": + cur.Set(c.Column, res.Kind, c.Descending) + case "name": + cur.Set(c.Column, res.Name, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -2853,10 +2890,12 @@ func (Store) sortableAuthClientFields() map[string]string { "createdat": "created_at", "deleted_at": "deleted_at", "deletedat": "deleted_at", + "enabled": "enabled", "expires_at": "expires_at", "expiresat": "expires_at", "handle": "handle", "id": "id", + "trusted": "trusted", "updated_at": "updated_at", "updatedat": "updated_at", } @@ -2890,6 +2929,10 @@ func (s *Store) collectAuthClientCursorValues(res *systemType.AuthClient, cc ... case "handle": cur.Set(c.Column, res.Handle, c.Descending) hasUnique = true + case "enabled": + cur.Set(c.Column, res.Enabled, c.Descending) + case "trusted": + cur.Set(c.Column, res.Trusted, c.Descending) case "expiresAt": cur.Set(c.Column, res.ExpiresAt, c.Descending) case "createdAt": @@ -4348,15 +4391,22 @@ func (s *Store) LookupAutomationSessionByID(ctx context.Context, id uint64) (_ * // This function is auto-generated func (Store) sortableAutomationSessionFields() map[string]string { return map[string]string{ - "completed_at": "completed_at", - "completedat": "completed_at", - "created_at": "created_at", - "createdat": "created_at", - "id": "id", - "purge_at": "purge_at", - "purgeat": "purge_at", - "suspended_at": "suspended_at", - "suspendedat": "suspended_at", + "completed_at": "completed_at", + "completedat": "completed_at", + "created_at": "created_at", + "createdat": "created_at", + "event_type": "event_type", + "eventtype": "event_type", + "id": "id", + "purge_at": "purge_at", + "purgeat": "purge_at", + "resource_type": "resource_type", + "resourcetype": "resource_type", + "status": "status", + "suspended_at": "suspended_at", + "suspendedat": "suspended_at", + "workflow_id": "workflow_id", + "workflowid": "workflow_id", } } @@ -4385,6 +4435,14 @@ func (s *Store) collectAutomationSessionCursorValues(res *automationType.Session case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "workflowID": + cur.Set(c.Column, res.WorkflowID, c.Descending) + case "eventType": + cur.Set(c.Column, res.EventType, c.Descending) + case "resourceType": + cur.Set(c.Column, res.ResourceType, c.Descending) + case "status": + cur.Set(c.Column, res.Status, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "purgeAt": @@ -4836,13 +4894,20 @@ func (s *Store) LookupAutomationTriggerByID(ctx context.Context, id uint64) (_ * // This function is auto-generated func (Store) sortableAutomationTriggerFields() map[string]string { return map[string]string{ - "created_at": "created_at", - "createdat": "created_at", - "deleted_at": "deleted_at", - "deletedat": "deleted_at", - "id": "id", - "updated_at": "updated_at", - "updatedat": "updated_at", + "created_at": "created_at", + "createdat": "created_at", + "deleted_at": "deleted_at", + "deletedat": "deleted_at", + "enabled": "enabled", + "event_type": "event_type", + "eventtype": "event_type", + "id": "id", + "resource_type": "resource_type", + "resourcetype": "resource_type", + "updated_at": "updated_at", + "updatedat": "updated_at", + "workflow_id": "workflow_id", + "workflowid": "workflow_id", } } @@ -4871,6 +4936,14 @@ func (s *Store) collectAutomationTriggerCursorValues(res *automationType.Trigger case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "workflowID": + cur.Set(c.Column, res.WorkflowID, c.Descending) + case "enabled": + cur.Set(c.Column, res.Enabled, c.Descending) + case "resourceType": + cur.Set(c.Column, res.ResourceType, c.Descending) + case "eventType": + cur.Set(c.Column, res.EventType, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -5367,6 +5440,7 @@ func (Store) sortableAutomationWorkflowFields() map[string]string { "createdat": "created_at", "deleted_at": "deleted_at", "deletedat": "deleted_at", + "enabled": "enabled", "handle": "handle", "id": "id", "updated_at": "updated_at", @@ -5402,6 +5476,8 @@ func (s *Store) collectAutomationWorkflowCursorValues(res *automationType.Workfl case "handle": cur.Set(c.Column, res.Handle, c.Descending) hasUnique = true + case "enabled": + cur.Set(c.Column, res.Enabled, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -5876,13 +5952,19 @@ func (s *Store) LookupComposeAttachmentByID(ctx context.Context, id uint64) (_ * // This function is auto-generated func (Store) sortableComposeAttachmentFields() map[string]string { return map[string]string{ - "created_at": "created_at", - "createdat": "created_at", - "deleted_at": "deleted_at", - "deletedat": "deleted_at", - "id": "id", - "updated_at": "updated_at", - "updatedat": "updated_at", + "created_at": "created_at", + "createdat": "created_at", + "deleted_at": "deleted_at", + "deletedat": "deleted_at", + "id": "id", + "kind": "kind", + "name": "name", + "namespace_id": "namespace_id", + "namespaceid": "namespace_id", + "owner_id": "owner_id", + "ownerid": "owner_id", + "updated_at": "updated_at", + "updatedat": "updated_at", } } @@ -5911,6 +5993,14 @@ func (s *Store) collectComposeAttachmentCursorValues(res *composeType.Attachment case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "ownerID": + cur.Set(c.Column, res.OwnerID, c.Descending) + case "namespaceID": + cur.Set(c.Column, res.NamespaceID, c.Descending) + case "kind": + cur.Set(c.Column, res.Kind, c.Descending) + case "name": + cur.Set(c.Column, res.Name, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -6402,15 +6492,17 @@ func (s *Store) LookupComposeChartByNamespaceIDHandle(ctx context.Context, names // This function is auto-generated func (Store) sortableComposeChartFields() map[string]string { return map[string]string{ - "created_at": "created_at", - "createdat": "created_at", - "deleted_at": "deleted_at", - "deletedat": "deleted_at", - "handle": "handle", - "id": "id", - "name": "name", - "updated_at": "updated_at", - "updatedat": "updated_at", + "created_at": "created_at", + "createdat": "created_at", + "deleted_at": "deleted_at", + "deletedat": "deleted_at", + "handle": "handle", + "id": "id", + "name": "name", + "namespace_id": "namespace_id", + "namespaceid": "namespace_id", + "updated_at": "updated_at", + "updatedat": "updated_at", } } @@ -6444,6 +6536,8 @@ func (s *Store) collectComposeChartCursorValues(res *composeType.Chart, cc ...*f hasUnique = true case "name": cur.Set(c.Column, res.Name, c.Descending) + case "namespaceID": + cur.Set(c.Column, res.NamespaceID, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -7306,9 +7400,13 @@ func (s *Store) LookupComposeModuleFieldByModuleIDName(ctx context.Context, modu // This function is auto-generated func (Store) sortableComposeModuleFieldFields() map[string]string { return map[string]string{ - "id": "id", - "label": "label", - "name": "name", + "id": "id", + "kind": "kind", + "label": "label", + "module_id": "module_id", + "moduleid": "module_id", + "name": "name", + "place": "place", } } @@ -7337,6 +7435,12 @@ func (s *Store) collectComposeModuleFieldCursorValues(res *composeType.ModuleFie case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "moduleID": + cur.Set(c.Column, res.ModuleID, c.Descending) + case "place": + cur.Set(c.Column, res.Place, c.Descending) + case "kind": + cur.Set(c.Column, res.Kind, c.Descending) case "name": cur.Set(c.Column, res.Name, c.Descending) case "label": @@ -7862,6 +7966,7 @@ func (Store) sortableComposeNamespaceFields() map[string]string { "deleted_at": "deleted_at", "deletedat": "deleted_at", "id": "id", + "slug": "slug", "updated_at": "updated_at", "updatedat": "updated_at", } @@ -7892,6 +7997,8 @@ func (s *Store) collectComposeNamespaceCursorValues(res *composeType.Namespace, case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "slug": + cur.Set(c.Column, res.Slug, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -8452,16 +8559,22 @@ func (s *Store) LookupComposePageByID(ctx context.Context, id uint64) (_ *compos // This function is auto-generated func (Store) sortableComposePageFields() map[string]string { return map[string]string{ - "created_at": "created_at", - "createdat": "created_at", - "deleted_at": "deleted_at", - "deletedat": "deleted_at", - "handle": "handle", - "id": "id", - "title": "title", - "updated_at": "updated_at", - "updatedat": "updated_at", - "weight": "weight", + "created_at": "created_at", + "createdat": "created_at", + "deleted_at": "deleted_at", + "deletedat": "deleted_at", + "handle": "handle", + "id": "id", + "module_id": "module_id", + "moduleid": "module_id", + "namespace_id": "namespace_id", + "namespaceid": "namespace_id", + "self_id": "self_id", + "selfid": "self_id", + "title": "title", + "updated_at": "updated_at", + "updatedat": "updated_at", + "weight": "weight", } } @@ -8490,6 +8603,12 @@ func (s *Store) collectComposePageCursorValues(res *composeType.Page, cc ...*fil case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "selfID": + cur.Set(c.Column, res.SelfID, c.Descending) + case "moduleID": + cur.Set(c.Column, res.ModuleID, c.Descending) + case "namespaceID": + cur.Set(c.Column, res.NamespaceID, c.Descending) case "handle": cur.Set(c.Column, res.Handle, c.Descending) hasUnique = true @@ -9111,6 +9230,8 @@ func (Store) sortableDalConnectionFields() map[string]string { "deletedat": "deleted_at", "handle": "handle", "id": "id", + "name": "name", + "type": "type", "updated_at": "updated_at", "updatedat": "updated_at", } @@ -9141,9 +9262,13 @@ func (s *Store) collectDalConnectionCursorValues(res *systemType.DalConnection, case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "name": + cur.Set(c.Column, res.Name, c.Descending) case "handle": cur.Set(c.Column, res.Handle, c.Descending) hasUnique = true + case "type": + cur.Set(c.Column, res.Type, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -9444,6 +9569,7 @@ func (Store) sortableDalSensitivityLevelFields() map[string]string { "deletedat": "deleted_at", "handle": "handle", "id": "id", + "level": "level", "updated_at": "updated_at", "updatedat": "updated_at", } @@ -9477,6 +9603,8 @@ func (s *Store) collectDalSensitivityLevelCursorValues(res *systemType.DalSensit case "handle": cur.Set(c.Column, res.Handle, c.Descending) hasUnique = true + case "level": + cur.Set(c.Column, res.Level, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -10872,6 +11000,9 @@ func (Store) sortableFederationExposedModuleFields() map[string]string { "deletedat": "deleted_at", "handle": "handle", "id": "id", + "name": "name", + "node_id": "node_id", + "nodeid": "node_id", "updated_at": "updated_at", "updatedat": "updated_at", } @@ -10905,6 +11036,10 @@ func (s *Store) collectFederationExposedModuleCursorValues(res *federationType.E case "handle": cur.Set(c.Column, res.Handle, c.Descending) hasUnique = true + case "name": + cur.Set(c.Column, res.Name, c.Descending) + case "nodeID": + cur.Set(c.Column, res.NodeID, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -11003,8 +11138,10 @@ func (s *Store) DeleteFederationModuleMapping(ctx context.Context, rr ...*federa // DeleteFederationModuleMappingByID deletes single entry from federationModuleMapping collection // // This function is auto-generated -func (s *Store) DeleteFederationModuleMappingBy(ctx context.Context) error { - return s.Exec(ctx, federationModuleMappingDeleteQuery(s.Dialect, goqu.Ex{})) +func (s *Store) DeleteFederationModuleMappingByNodeID(ctx context.Context, nodeID uint64) error { + return s.Exec(ctx, federationModuleMappingDeleteQuery(s.Dialect, goqu.Ex{ + "node_id": nodeID, + })) } // TruncateFederationModuleMappings Deletes all rows from the federationModuleMapping collection @@ -11395,7 +11532,16 @@ func (s *Store) LookupFederationModuleMappingByFederationModuleID(ctx context.Co // // This function is auto-generated func (Store) sortableFederationModuleMappingFields() map[string]string { - return map[string]string{} + return map[string]string{ + "compose_module_id": "compose_module_id", + "compose_namespace_id": "compose_namespace_id", + "composemoduleid": "compose_module_id", + "composenamespaceid": "compose_namespace_id", + "federation_module_id": "federation_module_id", + "federationmoduleid": "federation_module_id", + "node_id": "node_id", + "nodeid": "node_id", + } } // collectFederationModuleMappingCursorValues collects values from the given resource that and sets them to the cursor @@ -11410,7 +11556,37 @@ func (Store) sortableFederationModuleMappingFields() map[string]string { // // This function is auto-generated func (s *Store) collectFederationModuleMappingCursorValues(res *federationType.ModuleMapping, cc ...*filter.SortExpr) *filter.PagingCursor { - return nil + var ( + cur = &filter.PagingCursor{LThen: filter.SortExprSet(cc).Reversed()} + + hasUnique bool + + pkNodeID bool + + collect = func(cc ...*filter.SortExpr) { + for _, c := range cc { + switch c.Column { + case "nodeID": + cur.Set(c.Column, res.NodeID, c.Descending) + pkNodeID = true + case "federationModuleID": + cur.Set(c.Column, res.FederationModuleID, c.Descending) + case "composeModuleID": + cur.Set(c.Column, res.ComposeModuleID, c.Descending) + case "composeNamespaceID": + cur.Set(c.Column, res.ComposeNamespaceID, c.Descending) + } + } + } + ) + + collect(cc...) + if !hasUnique || !pkNodeID { + collect(&filter.SortExpr{Column: "nodeID", Descending: false}) + } + + return cur + } // checkFederationModuleMappingConstraints performs lookups (on valid) resource to check if any of the values on unique fields @@ -11741,13 +11917,20 @@ func (s *Store) LookupFederationNodeBySharedNodeID(ctx context.Context, sharedNo // This function is auto-generated func (Store) sortableFederationNodeFields() map[string]string { return map[string]string{ - "created_at": "created_at", - "createdat": "created_at", - "deleted_at": "deleted_at", - "deletedat": "deleted_at", - "id": "id", - "updated_at": "updated_at", - "updatedat": "updated_at", + "base_url": "base_url", + "baseurl": "base_url", + "contact": "contact", + "created_at": "created_at", + "createdat": "created_at", + "deleted_at": "deleted_at", + "deletedat": "deleted_at", + "id": "id", + "name": "name", + "shared_node_id": "shared_node_id", + "sharednodeid": "shared_node_id", + "status": "status", + "updated_at": "updated_at", + "updatedat": "updated_at", } } @@ -11776,6 +11959,16 @@ func (s *Store) collectFederationNodeCursorValues(res *federationType.Node, cc . case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "name": + cur.Set(c.Column, res.Name, c.Descending) + case "sharedNodeID": + cur.Set(c.Column, res.SharedNodeID, c.Descending) + case "baseURL": + cur.Set(c.Column, res.BaseURL, c.Descending) + case "status": + cur.Set(c.Column, res.Status, c.Descending) + case "contact": + cur.Set(c.Column, res.Contact, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -12270,8 +12463,14 @@ func (s *Store) LookupFederationNodeSyncByNodeIDModuleIDSyncTypeSyncStatus(ctx c // This function is auto-generated func (Store) sortableFederationNodeSyncFields() map[string]string { return map[string]string{ + "module_id": "module_id", + "moduleid": "module_id", "node_id": "node_id", "nodeid": "node_id", + "sync_status": "sync_status", + "sync_type": "sync_type", + "syncstatus": "sync_status", + "synctype": "sync_type", "time_of_action": "time_of_action", "timeofaction": "time_of_action", } @@ -12302,6 +12501,12 @@ func (s *Store) collectFederationNodeSyncCursorValues(res *federationType.NodeSy case "nodeID": cur.Set(c.Column, res.NodeID, c.Descending) pkNodeID = true + case "moduleID": + cur.Set(c.Column, res.ModuleID, c.Descending) + case "syncType": + cur.Set(c.Column, res.SyncType, c.Descending) + case "syncStatus": + cur.Set(c.Column, res.SyncStatus, c.Descending) case "timeOfAction": cur.Set(c.Column, res.TimeOfAction, c.Descending) } @@ -12747,14 +12952,19 @@ func (s *Store) LookupFederationSharedModuleByID(ctx context.Context, id uint64) // This function is auto-generated func (Store) sortableFederationSharedModuleFields() map[string]string { return map[string]string{ - "created_at": "created_at", - "createdat": "created_at", - "deleted_at": "deleted_at", - "deletedat": "deleted_at", - "handle": "handle", - "id": "id", - "updated_at": "updated_at", - "updatedat": "updated_at", + "created_at": "created_at", + "createdat": "created_at", + "deleted_at": "deleted_at", + "deletedat": "deleted_at", + "external_federation_module_id": "external_federation_module_id", + "externalfederationmoduleid": "external_federation_module_id", + "handle": "handle", + "id": "id", + "name": "name", + "node_id": "node_id", + "nodeid": "node_id", + "updated_at": "updated_at", + "updatedat": "updated_at", } } @@ -12786,6 +12996,12 @@ func (s *Store) collectFederationSharedModuleCursorValues(res *federationType.Sh case "handle": cur.Set(c.Column, res.Handle, c.Descending) hasUnique = true + case "nodeID": + cur.Set(c.Column, res.NodeID, c.Descending) + case "name": + cur.Set(c.Column, res.Name, c.Descending) + case "externalFederationModuleID": + cur.Set(c.Column, res.ExternalFederationModuleID, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -13878,11 +14094,13 @@ func (s *Store) LookupQueueByQueue(ctx context.Context, queue string) (_ *system // This function is auto-generated func (Store) sortableQueueFields() map[string]string { return map[string]string{ + "consumer": "consumer", "created_at": "created_at", "createdat": "created_at", "deleted_at": "deleted_at", "deletedat": "deleted_at", "id": "id", + "queue": "queue", "updated_at": "updated_at", "updatedat": "updated_at", } @@ -13913,6 +14131,10 @@ func (s *Store) collectQueueCursorValues(res *systemType.Queue, cc ...*filter.So case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "consumer": + cur.Set(c.Column, res.Consumer, c.Descending) + case "queue": + cur.Set(c.Column, res.Queue, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -14311,6 +14533,7 @@ func (Store) sortableQueueMessageFields() map[string]string { "created": "created", "id": "id", "processed": "processed", + "queue": "queue", } } @@ -14339,6 +14562,8 @@ func (s *Store) collectQueueMessageCursorValues(res *systemType.QueueMessage, cc case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "queue": + cur.Set(c.Column, res.Queue, c.Descending) case "processed": cur.Set(c.Column, res.Processed, c.Descending) case "created": @@ -15050,6 +15275,7 @@ func (Store) sortableReminderFields() map[string]string { "id": "id", "remind_at": "remind_at", "remindat": "remind_at", + "resource": "resource", "updated_at": "updated_at", "updatedat": "updated_at", } @@ -15080,6 +15306,8 @@ func (s *Store) collectReminderCursorValues(res *systemType.Reminder, cc ...*fil case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "resource": + cur.Set(c.Column, res.Resource, c.Descending) case "assignedAt": cur.Set(c.Column, res.AssignedAt, c.Descending) case "dismissedAt": @@ -16897,6 +17125,7 @@ func (Store) sortableRoleFields() map[string]string { "deletedat": "deleted_at", "handle": "handle", "id": "id", + "name": "name", "updated_at": "updated_at", "updatedat": "updated_at", } @@ -16927,6 +17156,8 @@ func (s *Store) collectRoleCursorValues(res *systemType.Role, cc ...*filter.Sort case "id": cur.Set(c.Column, res.ID, c.Descending) pkID = true + case "name": + cur.Set(c.Column, res.Name, c.Descending) case "handle": cur.Set(c.Column, res.Handle, c.Descending) hasUnique = true @@ -18022,8 +18253,11 @@ func (Store) sortableTemplateFields() map[string]string { "deletedat": "deleted_at", "handle": "handle", "id": "id", + "language": "language", "last_used_at": "last_used_at", "lastusedat": "last_used_at", + "template": "template", + "type": "type", "updated_at": "updated_at", "updatedat": "updated_at", } @@ -18057,6 +18291,12 @@ func (s *Store) collectTemplateCursorValues(res *systemType.Template, cc ...*fil case "handle": cur.Set(c.Column, res.Handle, c.Descending) hasUnique = true + case "language": + cur.Set(c.Column, res.Language, c.Descending) + case "type": + cur.Set(c.Column, res.Type, c.Descending) + case "template": + cur.Set(c.Column, res.Template, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": @@ -18671,6 +18911,8 @@ func (Store) sortableUserFields() map[string]string { "email": "email", "handle": "handle", "id": "id", + "kind": "kind", + "name": "name", "suspended_at": "suspended_at", "suspendedat": "suspended_at", "updated_at": "updated_at", @@ -18713,6 +18955,10 @@ func (s *Store) collectUserCursorValues(res *systemType.User, cc ...*filter.Sort case "username": cur.Set(c.Column, res.Username, c.Descending) hasUnique = true + case "name": + cur.Set(c.Column, res.Name, c.Descending) + case "kind": + cur.Set(c.Column, res.Kind, c.Descending) case "createdAt": cur.Set(c.Column, res.CreatedAt, c.Descending) case "updatedAt": diff --git a/store/interfaces.gen.go b/store/interfaces.gen.go index 99c1333c5..415c217b5 100644 --- a/store/interfaces.gen.go +++ b/store/interfaces.gen.go @@ -379,7 +379,7 @@ type ( UpdateFederationModuleMapping(ctx context.Context, rr ...*federationType.ModuleMapping) error UpsertFederationModuleMapping(ctx context.Context, rr ...*federationType.ModuleMapping) error DeleteFederationModuleMapping(ctx context.Context, rr ...*federationType.ModuleMapping) error - DeleteFederationModuleMappingBy(ctx context.Context) error + DeleteFederationModuleMappingByNodeID(ctx context.Context, nodeID uint64) error TruncateFederationModuleMappings(ctx context.Context) error LookupFederationModuleMappingByFederationModuleIDComposeModuleIDComposeNamespaceID(ctx context.Context, federationModuleID uint64, composeModuleID uint64, composeNamespaceID uint64) (*federationType.ModuleMapping, error) LookupFederationModuleMappingByFederationModuleID(ctx context.Context, federationModuleID uint64) (*federationType.ModuleMapping, error) @@ -2168,8 +2168,8 @@ func DeleteFederationModuleMapping(ctx context.Context, s FederationModuleMappin // DeleteFederationModuleMappingByID deletes one or more FederationModuleMappings from store // // This function is auto-generated -func DeleteFederationModuleMappingBy(ctx context.Context, s FederationModuleMappings) error { - return s.DeleteFederationModuleMappingBy(ctx) +func DeleteFederationModuleMappingByNodeID(ctx context.Context, s FederationModuleMappings, nodeID uint64) error { + return s.DeleteFederationModuleMappingByNodeID(ctx, nodeID) } // TruncateFederationModuleMappings Deletes all FederationModuleMappings from store diff --git a/system/apigw_filter.cue b/system/apigw_filter.cue index bd0cd986f..592ca2231 100644 --- a/system/apigw_filter.cue +++ b/system/apigw_filter.cue @@ -11,11 +11,11 @@ apigw_filter: schema.#Resource & { struct: { id: schema.IdField - route: { goType: "uint64", storeIdent: "rel_route" } - weight: { goType: "uint64" } + route: { sortable: true, goType: "uint64", storeIdent: "rel_route" } + weight: { sortable: true, goType: "uint64" } ref: {} - kind: {} - enabled: {goType: "bool"} + kind: {sortable: true} + enabled: {sortable: true, goType: "bool"} params: {goType: "types.ApigwFilterParams"} created_at: schema.SortableTimestampField diff --git a/system/apigw_route.cue b/system/apigw_route.cue index 7b3e93497..00b4686a5 100644 --- a/system/apigw_route.cue +++ b/system/apigw_route.cue @@ -11,10 +11,10 @@ apigw_route: schema.#Resource & { struct: { id: schema.IdField - endpoint: {} - method: {} - enabled: {goType: "bool"} - group: {goType: "uint64", storeIdent: "rel_group"} + endpoint: {sortable: true} + method: {sortable: true} + enabled: {sortable: true, goType: "bool"} + group: {sortable: true, goType: "uint64", storeIdent: "rel_group"} meta: {goType: "types.ApigwRouteMeta"} created_at: schema.SortableTimestampField diff --git a/system/application.cue b/system/application.cue index c390a0916..ef1bff554 100644 --- a/system/application.cue +++ b/system/application.cue @@ -9,7 +9,7 @@ application: schema.#Resource & { id: schema.IdField name: {sortable: true} owner_id: { ident: "ownerID", goType: "uint64", storeIdent: "rel_owner", sortable: true } - enabled: {goType: "bool"} + enabled: {sortable: true, goType: "bool"} weight: {goType: "int", sortable: true} unify: {goType: "*types.ApplicationUnify"} created_at: schema.SortableTimestampField diff --git a/system/attachment.cue b/system/attachment.cue index eae4915be..9eeb79c4c 100644 --- a/system/attachment.cue +++ b/system/attachment.cue @@ -11,11 +11,11 @@ attachment: schema.#Resource & { struct: { id: schema.IdField - owner_id: { goType: "uint64", storeIdent: "rel_owner", ident: "ownerID"} - kind: {} + owner_id: { sortable: true, goType: "uint64", storeIdent: "rel_owner", ident: "ownerID"} + kind: {sortable: true} url: {} preview_url: {} - name: {} + name: {sortable: true} meta: { goType: "types.AttachmentMeta" } created_at: schema.SortableTimestampField updated_at: schema.SortableTimestampNilField diff --git a/system/auth_client.cue b/system/auth_client.cue index 7a62a39b5..2747f0b65 100644 --- a/system/auth_client.cue +++ b/system/auth_client.cue @@ -13,8 +13,8 @@ auth_client: schema.#Resource & { scope: {goType: "string"} valid_grant: {goType: "string"} redirect_uri: {goType: "string", ident: "redirectURI"} - trusted: {goType: "bool"} - enabled: {goType: "bool"} + enabled: {sortable: true, goType: "bool"} + trusted: {sortable: true, goType: "bool"} valid_from: { goType: "*time.Time" } expires_at: schema.SortableTimestampNilField security: {goType: "*types.AuthClientSecurity"} diff --git a/system/dal_connection.cue b/system/dal_connection.cue index a2ae939dc..c28fd96ad 100644 --- a/system/dal_connection.cue +++ b/system/dal_connection.cue @@ -7,11 +7,11 @@ import ( dal_connection: schema.#Resource & { struct: { id: schema.IdField - name: { goType: "string" } + name: { sortable: true, goType: "string" } handle: schema.HandleField // omitting isPrimary and replacing with a special type - type: { goType: "string" } + type: { sortable: true } location: { goType: "geolocation.Full" } ownership: {} diff --git a/system/dal_sensitivity_level.cue b/system/dal_sensitivity_level.cue index d07f2c68a..dc166c888 100644 --- a/system/dal_sensitivity_level.cue +++ b/system/dal_sensitivity_level.cue @@ -8,7 +8,7 @@ dal_sensitivity_level: schema.#Resource & { struct: { id: schema.IdField handle: schema.HandleField - level: { goType: "int" } + level: { sortable: true, goType: "int" } meta: {goType: "types.DalSensitivityLevelMeta"} created_at: schema.SortableTimestampField diff --git a/system/queue.cue b/system/queue.cue index d105ae25f..6c00f1f42 100644 --- a/system/queue.cue +++ b/system/queue.cue @@ -11,8 +11,8 @@ queue: schema.#Resource & { struct: { id: schema.IdField - consumer: {goType: "string"} - queue: {goType: "string"} + consumer: {sortable: true, goType: "string"} + queue: {sortable: true, goType: "string"} meta: {goType: "types.QueueMeta"} created_at: schema.SortableTimestampField diff --git a/system/queue_message.cue b/system/queue_message.cue index a470e4942..4366979b2 100644 --- a/system/queue_message.cue +++ b/system/queue_message.cue @@ -12,7 +12,7 @@ queue_message: schema.#Resource & { struct: { id: schema.IdField - queue: {} + queue: { sortable: true } payload: { goType: "[]byte" } processed: schema.SortableTimestampNilField created: schema.SortableTimestampNilField diff --git a/system/reminder.cue b/system/reminder.cue index 42dce955c..53cbc3ed7 100644 --- a/system/reminder.cue +++ b/system/reminder.cue @@ -11,7 +11,7 @@ reminder: schema.#Resource & { struct: { id: schema.IdField - resource: {} + resource: { sortable: true } payload: { goType: "rawJson" } snooze_count: { goType: "uint" } assigned_to: { goType: "uint64" } diff --git a/system/role.cue b/system/role.cue index fc34f1f4e..2dc3c1e85 100644 --- a/system/role.cue +++ b/system/role.cue @@ -7,7 +7,7 @@ import ( role: schema.#Resource & { struct: { id: schema.IdField - name: {} + name: {sortable: true} handle: schema.HandleField meta: {goType: "*types.RoleMeta"} diff --git a/system/template.cue b/system/template.cue index 10b813ccd..167b4c537 100644 --- a/system/template.cue +++ b/system/template.cue @@ -8,11 +8,11 @@ template: schema.#Resource & { struct: { id: schema.IdField handle: schema.HandleField - language: {goType: "string"} - type: {goType: "types.DocumentType"} + language: {sortable: true, goType: "string"} + type: {sortable: true, goType: "types.DocumentType"} partial: {goType: "bool"} meta: {goType: "types.TemplateMeta"} - template: {goType: "string"} + template: {sortable: true, goType: "string"} owner_id: { ident: "ownerID", goType: "uint64", storeIdent: "rel_owner" } created_at: schema.SortableTimestampField diff --git a/system/user.cue b/system/user.cue index 9e15c02fa..14cb4c173 100644 --- a/system/user.cue +++ b/system/user.cue @@ -8,11 +8,11 @@ user: schema.#Resource & { struct: { id: schema.IdField handle: schema.HandleField - email: {unique: true, ignoreCase: true} + email: {sortable: true, unique: true, ignoreCase: true} email_confirmed: {goType: "bool"} - username: {unique: true, ignoreCase: true} - name: {} - kind: {goType: "types.UserKind"} + username: {sortable: true, unique: true, ignoreCase: true} + name: {sortable: true} + kind: {sortable: true, goType: "types.UserKind"} meta: {goType: "*types.UserMeta"} created_at: schema.SortableTimestampField updated_at: schema.SortableTimestampNilField