MCPcopy Create free account
hub / github.com/Permify/permify / buildDeleteClausesForAttributes

Function buildDeleteClausesForAttributes

internal/storage/postgres/data_writer.go:522–535  ·  view source on GitHub ↗

Build delete clauses for attributes

(attributeCollection *database.AttributeCollection)

Source from the content-addressed store, hash-verified

520
521// Build delete clauses for attributes
522func buildDeleteClausesForAttributes(attributeCollection *database.AttributeCollection) []squirrel.Eq { // Build delete clauses
523 deleteClauses := make([]squirrel.Eq, 0)
524 aiter := attributeCollection.CreateAttributeIterator()
525 for aiter.HasNext() {
526 a := aiter.GetNext()
527 condition := squirrel.Eq{
528 "entity_type": a.GetEntity().GetType(),
529 "entity_id": a.GetEntity().GetId(),
530 "attribute": a.GetAttribute(),
531 }
532 deleteClauses = append(deleteClauses, condition)
533 }
534 return deleteClauses
535}

Callers 2

writeMethod · 0.85
runOperationMethod · 0.85

Calls 7

GetTypeMethod · 0.65
HasNextMethod · 0.45
GetNextMethod · 0.45
GetEntityMethod · 0.45
GetIdMethod · 0.45
GetAttributeMethod · 0.45

Tested by

no test coverage detected