Last active
August 4, 2018 16:38
-
-
Save calebkleveter/a363cfb901020f46a47032fa0873b4dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FluentPostgreSQL | |
final class UserConnection: PostgreSQLPivot { | |
typealias Left = User | |
typealias Right = User | |
static var leftIDKey: WritableKeyPath<UserConnection, String> = \.leftID | |
static var rightIDKey: WritableKeyPath<UserConnection, String> = \.rightID | |
var id: Int? | |
var leftID: String | |
var rightID: String | |
init(left: User, right: User)throws { | |
self.leftID = try left.requireID() | |
self.rightID = try right.requireID() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment