MCPcopy
hub / github.com/ent/ent / hasExternalEdges

Function hasExternalEdges

dialect/sql/sqlgraph/graph.go:1854–1869  ·  view source on GitHub ↗
(addEdges, clearEdges map[Rel][]*EdgeSpec)

Source from the content-addressed store, hash-verified

1852}
1853
1854func hasExternalEdges(addEdges, clearEdges map[Rel][]*EdgeSpec) bool {
1855 // M2M edges reside in a join-table, and O2M edges reside
1856 // in the M2O table (the entity that holds the FK).
1857 if len(clearEdges[M2M]) > 0 || len(addEdges[M2M]) > 0 ||
1858 len(clearEdges[O2M]) > 0 || len(addEdges[O2M]) > 0 {
1859 return true
1860 }
1861 for _, edges := range [][]*EdgeSpec{clearEdges[O2O], addEdges[O2O]} {
1862 for _, e := range edges {
1863 if !e.Inverse {
1864 return true
1865 }
1866 }
1867 }
1868 return false
1869}
1870
1871// isExternalEdge reports if the given edge requires an UPDATE
1872// or an INSERT to other table.

Callers 2

nodesMethod · 0.85
mayTxMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…