mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
17 lines
575 B
Swift
17 lines
575 B
Swift
/// A Foreign Key that helps building associations.
|
|
public struct ForeignKey {
|
|
let originColumns: [String]
|
|
let destinationColumns: [String]?
|
|
|
|
/// TODO
|
|
public init(_ originColumns: [String], to destinationColumns: [String]? = nil) {
|
|
self.originColumns = originColumns
|
|
self.destinationColumns = destinationColumns
|
|
}
|
|
|
|
/// TODO
|
|
public init(_ originColumns: [ColumnExpression], to destinationColumns: [ColumnExpression]? = nil) {
|
|
self.init(originColumns.map { $0.name }, to: destinationColumns?.map { $0.name })
|
|
}
|
|
}
|