MCPcopy
hub / github.com/ent/ent / matchIDs

Function matchIDs

dialect/sql/sqlgraph/graph.go:2056–2064  ·  view source on GitHub ↗
(column1 string, pk1 []driver.Value, column2 string, pk2 []driver.Value)

Source from the content-addressed store, hash-verified

2054}
2055
2056func matchIDs(column1 string, pk1 []driver.Value, column2 string, pk2 []driver.Value) *sql.Predicate {
2057 p := matchID(column1, pk1)
2058 if len(pk2) > 1 {
2059 // Use "IN" predicate instead of list of "OR"
2060 // in case of more than on nodes to connect.
2061 return sql.And(p, sql.InValues(column2, pk2...))
2062 }
2063 return sql.And(p, sql.EQ(column2, pk2[0]))
2064}
2065
2066// cartesian product of 2 id sets.
2067func product(a, b []driver.Value) [][2]driver.Value {

Callers 2

clearM2MEdgesMethod · 0.85
clearFKEdgesMethod · 0.85

Calls 4

AndFunction · 0.92
InValuesFunction · 0.92
EQFunction · 0.92
matchIDFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…