Fix definitions for fed. module mapping
This commit is contained in:
Generated
+3
-14
@@ -155,19 +155,19 @@ var ModuleMapping = &dal.Model{
|
||||
&dal.Attribute{
|
||||
Ident: "FederationModuleID", Sortable: true,
|
||||
Type: &dal.TypeID{},
|
||||
Store: &dal.CodecAlias{Ident: "federation_module_id"},
|
||||
Store: &dal.CodecAlias{Ident: "rel_federation_module"},
|
||||
},
|
||||
|
||||
&dal.Attribute{
|
||||
Ident: "ComposeModuleID", Sortable: true,
|
||||
Type: &dal.TypeID{},
|
||||
Store: &dal.CodecAlias{Ident: "compose_module_id"},
|
||||
Store: &dal.CodecAlias{Ident: "rel_compose_module"},
|
||||
},
|
||||
|
||||
&dal.Attribute{
|
||||
Ident: "ComposeNamespaceID", Sortable: true,
|
||||
Type: &dal.TypeID{},
|
||||
Store: &dal.CodecAlias{Ident: "compose_namespace_id"},
|
||||
Store: &dal.CodecAlias{Ident: "rel_compose_namespace"},
|
||||
},
|
||||
|
||||
&dal.Attribute{
|
||||
@@ -180,17 +180,6 @@ var ModuleMapping = &dal.Model{
|
||||
},
|
||||
|
||||
Indexes: dal.IndexSet{
|
||||
&dal.Index{
|
||||
Ident: "PRIMARY",
|
||||
Type: "BTREE",
|
||||
|
||||
Fields: []*dal.IndexField{
|
||||
{
|
||||
AttributeIdent: "NodeID",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
&dal.Index{
|
||||
Ident: "federation_module_mapping_uniqueModuleComposeModule",
|
||||
Type: "BTREE",
|
||||
|
||||
@@ -22,18 +22,21 @@ moduleMapping: {
|
||||
sortable: true,
|
||||
ident: "federationModuleID",
|
||||
goType: "uint64"
|
||||
storeIdent: "rel_federation_module"
|
||||
dal: { type: "ID" }
|
||||
}
|
||||
compose_module_id: {
|
||||
sortable: true,
|
||||
ident: "composeModuleID",
|
||||
goType: "uint64"
|
||||
storeIdent: "rel_compose_module"
|
||||
dal: { type: "ID" }
|
||||
}
|
||||
compose_namespace_id: {
|
||||
sortable: true,
|
||||
ident: "composeNamespaceID",
|
||||
goType: "uint64"
|
||||
storeIdent: "rel_compose_namespace"
|
||||
dal: { type: "ID" }
|
||||
}
|
||||
field_mapping: {
|
||||
@@ -43,7 +46,6 @@ moduleMapping: {
|
||||
}
|
||||
|
||||
indexes: {
|
||||
"primary": { attribute: "node_id" }
|
||||
"unique_module_compose_module": {
|
||||
attributes: ["federation_module_id", "compose_module_id", "compose_namespace_id" ]
|
||||
}
|
||||
|
||||
Generated
+20
-20
@@ -2770,9 +2770,9 @@ var (
|
||||
federationModuleMappingSelectQuery = func(d goqu.DialectWrapper) *goqu.SelectDataset {
|
||||
return d.Select(
|
||||
"node_id",
|
||||
"federation_module_id",
|
||||
"compose_module_id",
|
||||
"compose_namespace_id",
|
||||
"rel_federation_module",
|
||||
"rel_compose_module",
|
||||
"rel_compose_namespace",
|
||||
"field_mapping",
|
||||
).From(federationModuleMappingTable)
|
||||
}
|
||||
@@ -2783,11 +2783,11 @@ var (
|
||||
federationModuleMappingInsertQuery = func(d goqu.DialectWrapper, res *federationType.ModuleMapping) *goqu.InsertDataset {
|
||||
return d.Insert(federationModuleMappingTable).
|
||||
Rows(goqu.Record{
|
||||
"node_id": res.NodeID,
|
||||
"federation_module_id": res.FederationModuleID,
|
||||
"compose_module_id": res.ComposeModuleID,
|
||||
"compose_namespace_id": res.ComposeNamespaceID,
|
||||
"field_mapping": res.FieldMapping,
|
||||
"node_id": res.NodeID,
|
||||
"rel_federation_module": res.FederationModuleID,
|
||||
"rel_compose_module": res.ComposeModuleID,
|
||||
"rel_compose_namespace": res.ComposeNamespaceID,
|
||||
"field_mapping": res.FieldMapping,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2795,16 +2795,17 @@ var (
|
||||
//
|
||||
// This function is auto-generated
|
||||
federationModuleMappingUpsertQuery = func(d goqu.DialectWrapper, res *federationType.ModuleMapping) *goqu.InsertDataset {
|
||||
var target = `,node_id`
|
||||
var target = ``
|
||||
|
||||
return federationModuleMappingInsertQuery(d, res).
|
||||
OnConflict(
|
||||
goqu.DoUpdate(target[1:],
|
||||
goqu.Record{
|
||||
"federation_module_id": res.FederationModuleID,
|
||||
"compose_module_id": res.ComposeModuleID,
|
||||
"compose_namespace_id": res.ComposeNamespaceID,
|
||||
"field_mapping": res.FieldMapping,
|
||||
"node_id": res.NodeID,
|
||||
"rel_federation_module": res.FederationModuleID,
|
||||
"rel_compose_module": res.ComposeModuleID,
|
||||
"rel_compose_namespace": res.ComposeNamespaceID,
|
||||
"field_mapping": res.FieldMapping,
|
||||
},
|
||||
),
|
||||
)
|
||||
@@ -2816,10 +2817,11 @@ var (
|
||||
federationModuleMappingUpdateQuery = func(d goqu.DialectWrapper, res *federationType.ModuleMapping) *goqu.UpdateDataset {
|
||||
return d.Update(federationModuleMappingTable).
|
||||
Set(goqu.Record{
|
||||
"federation_module_id": res.FederationModuleID,
|
||||
"compose_module_id": res.ComposeModuleID,
|
||||
"compose_namespace_id": res.ComposeNamespaceID,
|
||||
"field_mapping": res.FieldMapping,
|
||||
"node_id": res.NodeID,
|
||||
"rel_federation_module": res.FederationModuleID,
|
||||
"rel_compose_module": res.ComposeModuleID,
|
||||
"rel_compose_namespace": res.ComposeNamespaceID,
|
||||
"field_mapping": res.FieldMapping,
|
||||
}).
|
||||
Where(federationModuleMappingPrimaryKeys(res))
|
||||
}
|
||||
@@ -2842,9 +2844,7 @@ var (
|
||||
//
|
||||
// This function is auto-generated
|
||||
federationModuleMappingPrimaryKeys = func(res *federationType.ModuleMapping) goqu.Ex {
|
||||
return goqu.Ex{
|
||||
"node_id": res.NodeID,
|
||||
}
|
||||
return goqu.Ex{}
|
||||
}
|
||||
|
||||
// federationNodeTable represents federationNodes store table
|
||||
|
||||
Generated
+5
-19
@@ -11515,15 +11515,6 @@ func (s *Store) DeleteFederationModuleMapping(ctx context.Context, rr ...*federa
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteFederationModuleMappingByNodeID deletes single entry from federationModuleMapping collection
|
||||
//
|
||||
// This function is auto-generated
|
||||
func (s *Store) DeleteFederationModuleMappingByNodeID(ctx context.Context, nodeID uint64) error {
|
||||
return s.Exec(ctx, federationModuleMappingDeleteQuery(s.Dialect.GOQU(), goqu.Ex{
|
||||
"node_id": nodeID,
|
||||
}))
|
||||
}
|
||||
|
||||
// TruncateFederationModuleMappings Deletes all rows from the federationModuleMapping collection
|
||||
func (s *Store) TruncateFederationModuleMappings(ctx context.Context) error {
|
||||
return s.Exec(ctx, federationModuleMappingTruncateQuery(s.Dialect.GOQU()))
|
||||
@@ -11849,9 +11840,9 @@ func (s *Store) LookupFederationModuleMappingByFederationModuleIDComposeModuleID
|
||||
rows *sql.Rows
|
||||
aux = new(auxFederationModuleMapping)
|
||||
lookup = federationModuleMappingSelectQuery(s.Dialect.GOQU()).Where(
|
||||
goqu.I("federation_module_id").Eq(federationModuleID),
|
||||
goqu.I("compose_module_id").Eq(composeModuleID),
|
||||
goqu.I("compose_namespace_id").Eq(composeNamespaceID),
|
||||
goqu.I("rel_federation_module").Eq(federationModuleID),
|
||||
goqu.I("rel_compose_module").Eq(composeModuleID),
|
||||
goqu.I("rel_compose_namespace").Eq(composeNamespaceID),
|
||||
).Limit(1)
|
||||
)
|
||||
|
||||
@@ -11893,7 +11884,7 @@ func (s *Store) LookupFederationModuleMappingByFederationModuleID(ctx context.Co
|
||||
rows *sql.Rows
|
||||
aux = new(auxFederationModuleMapping)
|
||||
lookup = federationModuleMappingSelectQuery(s.Dialect.GOQU()).Where(
|
||||
goqu.I("federation_module_id").Eq(federationModuleID),
|
||||
goqu.I("rel_federation_module").Eq(federationModuleID),
|
||||
).Limit(1)
|
||||
)
|
||||
|
||||
@@ -11960,14 +11951,12 @@ func (s *Store) collectFederationModuleMappingCursorValues(res *federationType.M
|
||||
|
||||
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
|
||||
hasUnique = true
|
||||
case "federationModuleID":
|
||||
cur.Set(c.Column, res.FederationModuleID, c.Descending)
|
||||
case "composeModuleID":
|
||||
@@ -11982,9 +11971,6 @@ func (s *Store) collectFederationModuleMappingCursorValues(res *federationType.M
|
||||
_ = hasUnique
|
||||
|
||||
collect(cc...)
|
||||
if !hasUnique || !pkNodeID {
|
||||
collect(&filter.SortExpr{Column: "nodeID", Descending: false})
|
||||
}
|
||||
|
||||
return cur
|
||||
|
||||
|
||||
Generated
-8
@@ -407,7 +407,6 @@ type (
|
||||
UpsertFederationModuleMapping(ctx context.Context, rr ...*federationType.ModuleMapping) error
|
||||
DeleteFederationModuleMapping(ctx context.Context, rr ...*federationType.ModuleMapping) 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)
|
||||
@@ -2217,13 +2216,6 @@ func DeleteFederationModuleMapping(ctx context.Context, s FederationModuleMappin
|
||||
return s.DeleteFederationModuleMapping(ctx, rr...)
|
||||
}
|
||||
|
||||
// DeleteFederationModuleMappingByID deletes one or more FederationModuleMappings from store
|
||||
//
|
||||
// This function is auto-generated
|
||||
func DeleteFederationModuleMappingByNodeID(ctx context.Context, s FederationModuleMappings, nodeID uint64) error {
|
||||
return s.DeleteFederationModuleMappingByNodeID(ctx, nodeID)
|
||||
}
|
||||
|
||||
// TruncateFederationModuleMappings Deletes all FederationModuleMappings from store
|
||||
//
|
||||
// This function is auto-generated
|
||||
|
||||
Reference in New Issue
Block a user