Skip to content

Commit 48546c1

Browse files
committed
Special description for self-joins
[SELF]
1 parent 61413d9 commit 48546c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/ZeeQL/Access/Relationship.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,10 @@ public extension Relationship {
323323
ms += isToMany ? "[1:n]" : "[1:1]"
324324
ms += " '\(entity.name)'"
325325

326-
if let to = destinationEntity { ms += " to=\(to.name)" }
326+
if let to = destinationEntity {
327+
if to === entity { ms += "[SELF-JOIN]" }
328+
else { ms += " to=\(to.name)" }
329+
}
327330

328331
if !joins.isEmpty {
329332
if joinSemantic != .innerJoin { ms += " \(joinSemantic)" }

0 commit comments

Comments
 (0)