From d7971d76e79f3fd068321f061fadf5cade8a6507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 19 Jun 2021 14:30:04 +0200 Subject: [PATCH] Introduce Table --- GRDB.xcodeproj/project.pbxproj | 10 + .../Request/CommonTableExpression.swift | 34 ++ GRDB/QueryInterface/SQL/Table.swift | 338 ++++++++++++++++++ .../TableRecord+Association.swift | 85 +++++ GRDBCustom.xcodeproj/project.pbxproj | 6 + 5 files changed, 473 insertions(+) create mode 100644 GRDB/QueryInterface/SQL/Table.swift diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index 3fbb46a02..8abdb50fe 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -129,6 +129,10 @@ 5623936D1DEE0CD200A6B01F /* FlattenCursorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 562393681DEE0CD200A6B01F /* FlattenCursorTests.swift */; }; 562393721DEE104400A6B01F /* MapCursorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 562393711DEE104400A6B01F /* MapCursorTests.swift */; }; 562393761DEE104400A6B01F /* MapCursorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 562393711DEE104400A6B01F /* MapCursorTests.swift */; }; + 56256ED025D1ACD0008C2BDD /* Table.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56256ECF25D1ACD0008C2BDD /* Table.swift */; }; + 56256ED125D1ACD0008C2BDD /* Table.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56256ECF25D1ACD0008C2BDD /* Table.swift */; }; + 56256ED225D1ACD0008C2BDD /* Table.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56256ECF25D1ACD0008C2BDD /* Table.swift */; }; + 56256ED325D1ACD0008C2BDD /* Table.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56256ECF25D1ACD0008C2BDD /* Table.swift */; }; 56256ED925D1B316008C2BDD /* ForeignKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56256ED825D1B316008C2BDD /* ForeignKey.swift */; }; 56256EDA25D1B316008C2BDD /* ForeignKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56256ED825D1B316008C2BDD /* ForeignKey.swift */; }; 56256EDB25D1B316008C2BDD /* ForeignKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56256ED825D1B316008C2BDD /* ForeignKey.swift */; }; @@ -1290,6 +1294,7 @@ 562393681DEE0CD200A6B01F /* FlattenCursorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FlattenCursorTests.swift; sourceTree = ""; }; 562393711DEE104400A6B01F /* MapCursorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MapCursorTests.swift; sourceTree = ""; }; 5623E0901B4AFACC00B20B7F /* GRDBTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GRDBTestCase.swift; sourceTree = ""; }; + 56256ECF25D1ACD0008C2BDD /* Table.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Table.swift; sourceTree = ""; }; 56256ED825D1B316008C2BDD /* ForeignKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForeignKey.swift; sourceTree = ""; }; 562756421E963AAC0035B653 /* DatabaseWriterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseWriterTests.swift; sourceTree = ""; }; 562EA8251F17B2AC00FA528C /* CompilationProtocolTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompilationProtocolTests.swift; sourceTree = ""; }; @@ -2060,6 +2065,7 @@ 56D91AA12205E03700770D8D /* SQLRelation.swift */, 568ECA8925D7013000B71526 /* SQLSelection.swift */, 568ECB1725D9161500B71526 /* SQLSubquery.swift */, + 56256ECF25D1ACD0008C2BDD /* Table.swift */, ); path = SQL; sourceTree = ""; @@ -2867,6 +2873,7 @@ buildActionMask = 2147483647; files = ( 5616AAF3207CD45E00AC3664 /* RequestProtocols.swift in Sources */, + 56256ED225D1ACD0008C2BDD /* Table.swift in Sources */, 56B964BF1DA51D0A0002DA19 /* FTS5Pattern.swift in Sources */, 56D51D061EA789FA0074638A /* FetchableRecord+TableRecord.swift in Sources */, 565490CE1D5AE252005622CB /* NSNull.swift in Sources */, @@ -3030,6 +3037,7 @@ 566475D61D981D5E00FF74B8 /* SQLOperators.swift in Sources */, 5698AD381DABAF4A0056AF8C /* FTS5CustomTokenizer.swift in Sources */, 56012BA8257404E000B4925B /* CommonTableExpression.swift in Sources */, + 56256ED125D1ACD0008C2BDD /* Table.swift in Sources */, 5653EB0A20944C7C00F46237 /* Association.swift in Sources */, 56A2387E1B9C75030082EB20 /* Database.swift in Sources */, 56CEB4FD1EAA2F4D00BFAF62 /* FTS3.swift in Sources */, @@ -3621,6 +3629,7 @@ AAA4DC7F230F1E0600C74B15 /* SQLOperators.swift in Sources */, AAA4DC80230F1E0600C74B15 /* FTS5CustomTokenizer.swift in Sources */, 56012BB2257404E200B4925B /* CommonTableExpression.swift in Sources */, + 56256ED325D1ACD0008C2BDD /* Table.swift in Sources */, AAA4DC81230F1E0600C74B15 /* Association.swift in Sources */, AAA4DC82230F1E0600C74B15 /* Database.swift in Sources */, AAA4DC83230F1E0600C74B15 /* FTS3.swift in Sources */, @@ -3982,6 +3991,7 @@ 566B91091FA4C3970012D5B0 /* Database+Statements.swift in Sources */, 566B91231FA4CF810012D5B0 /* Database+Schema.swift in Sources */, 56012B9F257404DF00B4925B /* CommonTableExpression.swift in Sources */, + 56256ED025D1ACD0008C2BDD /* Table.swift in Sources */, 563B06AB217EF0CC00B38F35 /* ValueObservation.swift in Sources */, 56CEB5111EAA324B00BFAF62 /* FTS3+QueryInterface.swift in Sources */, 5659F4901EA8D964004A4992 /* ReadWriteBox.swift in Sources */, diff --git a/GRDB/QueryInterface/Request/CommonTableExpression.swift b/GRDB/QueryInterface/Request/CommonTableExpression.swift index ebbdd54e1..786edda01 100644 --- a/GRDB/QueryInterface/Request/CommonTableExpression.swift +++ b/GRDB/QueryInterface/Request/CommonTableExpression.swift @@ -408,4 +408,38 @@ extension CommonTableExpression { { JoinAssociation(to: Destination.relationForAll, condition: .none) } + + /// Creates an association to a table that you can join + /// or include in another request. + /// + /// The key of the returned association is the table name of `Destination`. + /// + /// - parameter cte: A common table expression. + /// - parameter condition: A function that returns the joining clause. + /// - parameter left: A `TableAlias` for the left table. + /// - parameter right: A `TableAlias` for the right table. + /// - returns: An association to the common table expression. + public func association( + to destination: Table, + on condition: @escaping (_ left: TableAlias, _ right: TableAlias) -> SQLExpressible) + -> JoinAssociation + { + JoinAssociation( + to: destination.relationForAll, + condition: .expression { condition($0, $1).sqlExpression }) + } + + /// Creates an association to a table that you can join + /// or include in another request. + /// + /// The key of the returned association is the table name of `Destination`. + /// + /// - parameter cte: A common table expression. + /// - returns: An association to the common table expression. + public func association( + to destination: Table) + -> JoinAssociation + { + JoinAssociation(to: destination.relationForAll, condition: .none) + } } diff --git a/GRDB/QueryInterface/SQL/Table.swift b/GRDB/QueryInterface/SQL/Table.swift new file mode 100644 index 000000000..23cb1dbfc --- /dev/null +++ b/GRDB/QueryInterface/SQL/Table.swift @@ -0,0 +1,338 @@ +/// `Table` can build query interface requests. +/// +/// // SELECT * FROM player WHERE score >= 1000 +/// let table = Table("player") +/// let rows: [Row] = try dbQueue.read { db in +/// table.all() +/// .filter(Column("score") >= 1000) +/// .fetchAll(db) +/// } +public struct Table { + /// The table name + public var tableName: String + + private init(_ tableName: String, _ type: RowDecoder.Type) { + self.tableName = tableName + } + + /// Create a `Table` + /// + /// let table = Table("player") + /// let table = Table("player") + public init(_ tableName: String) { + self.init(tableName, RowDecoder.self) + } +} + +extension Table where RowDecoder == Row { + /// Create a `Table` of `Row`. + /// + /// let table = Table("player") // Table + public init(_ tableName: String) { + self.init(tableName, Row.self) + } +} + +extension Table { + var relationForAll: SQLRelation { + .all(fromTable: tableName) + } + + /// Creates a request for all rows of the table. + /// + /// You can, for example, fetch from this request: + /// + /// let table = Table("player") + /// let rows: [Row] = try table.all().fetchAll(db) + public func all() -> QueryInterfaceRequest { + QueryInterfaceRequest(relation: relationForAll) + } +} + +extension Table { + /// Returns a request which embeds the common table expression. + /// + /// For more information, see `TableRecord.with(_:)`. + /// + /// - parameter cte: A common table expression. + /// - returns: A request. + public func with(_ cte: CommonTableExpression) -> QueryInterfaceRequest { + all().with(cte) + } +} + +// MARK: - Associations to TableRecord + +extension Table { + /// Creates a "Belongs To" association between Self and the destination + /// type, based on a database foreign key. + /// + /// For more information, see `TableRecord.belongsTo(_:key:using:)`. + /// + /// - parameters: + /// - destination: The record type at the other side of the association. + /// - key: An eventual decoding key for the association. By default, it + /// is `destination.databaseTableName`. + /// - foreignKey: An eventual foreign key. You need to provide an + /// explicit foreign key when GRDB can't infer one from the database + /// schema. This happens when the schema does not define any foreign + /// key to the destination table, or when the schema defines several + /// foreign keys to the destination table. + public func belongsTo( + _ destination: Destination.Type, + key: String? = nil, + using foreignKey: ForeignKey? = nil) + -> BelongsToAssociation + where Destination: TableRecord + { + BelongsToAssociation( + to: Destination.relationForAll, + key: key, + using: foreignKey) + } + + /// Creates a "Has many" association between Self and the destination type, + /// based on a database foreign key. + /// + /// For more information, see `TableRecord.hasMany(_:key:using:)`. + /// + /// - parameters: + /// - destination: The record type at the other side of the association. + /// - key: An eventual decoding key for the association. By default, it + /// is `destination.databaseTableName`. + /// - foreignKey: An eventual foreign key. You need to provide an + /// explicit foreign key when GRDB can't infer one from the database + /// schema. This happens when the schema does not define any foreign + /// key from the destination table, or when the schema defines several + /// foreign keys from the destination table. + public func hasMany( + _ destination: Destination.Type, + key: String? = nil, + using foreignKey: ForeignKey? = nil) + -> HasManyAssociation + where Destination: TableRecord + { + HasManyAssociation( + to: Destination.relationForAll, + key: key, + using: foreignKey) + } + + /// Creates a "Has one" association between Self and the destination type, + /// based on a database foreign key. + /// + /// For more information, see `TableRecord.hasOne(_:key:using:)`. + /// + /// - parameters: + /// - destination: The record type at the other side of the association. + /// - key: An eventual decoding key for the association. By default, it + /// is `destination.databaseTableName`. + /// - foreignKey: An eventual foreign key. You need to provide an + /// explicit foreign key when GRDB can't infer one from the database + /// schema. This happens when the schema does not define any foreign + /// key from the destination table, or when the schema defines several + /// foreign keys from the destination table. + public func hasOne( + _ destination: Destination.Type, + key: String? = nil, + using foreignKey: ForeignKey? = nil) + -> HasOneAssociation + where Destination: TableRecord + { + HasOneAssociation( + to: Destination.relationForAll, + key: key, + using: foreignKey) + } +} + +// MARK: - Associations to Table + +extension Table { + /// Creates a "Belongs To" association between Self and the destination + /// table, based on a database foreign key. + /// + /// For more information, see `TableRecord.belongsTo(_:key:using:)`. + /// + /// - parameters: + /// - destination: The table at the other side of the association. + /// - key: An eventual decoding key for the association. By default, it + /// is `destination.tableName`. + /// - foreignKey: An eventual foreign key. You need to provide an + /// explicit foreign key when GRDB can't infer one from the database + /// schema. This happens when the schema does not define any foreign + /// key to the destination table, or when the schema defines several + /// foreign keys to the destination table. + public func belongsTo( + _ destination: Table, + key: String? = nil, + using foreignKey: ForeignKey? = nil) + -> BelongsToAssociation + { + BelongsToAssociation( + to: destination.relationForAll, + key: key, + using: foreignKey) + } + + /// Creates a "Has many" association between Self and the destination table, + /// based on a database foreign key. + /// + /// For more information, see `TableRecord.hasMany(_:key:using:)`. + /// + /// - parameters: + /// - destination: The table at the other side of the association. + /// - key: An eventual decoding key for the association. By default, it + /// is `destination.tableName`. + /// - foreignKey: An eventual foreign key. You need to provide an + /// explicit foreign key when GRDB can't infer one from the database + /// schema. This happens when the schema does not define any foreign + /// key from the destination table, or when the schema defines several + /// foreign keys from the destination table. + public func hasMany( + _ destination: Table, + key: String? = nil, + using foreignKey: ForeignKey? = nil) + -> HasManyAssociation + { + HasManyAssociation( + to: destination.relationForAll, + key: key, + using: foreignKey) + } + + /// Creates a "Has one" association between Self and the destination table, + /// based on a database foreign key. + /// + /// For more information, see `TableRecord.hasOne(_:key:using:)`. + /// + /// - parameters: + /// - destination: The table at the other side of the association. + /// - key: An eventual decoding key for the association. By default, it + /// is `destination.databaseTableName`. + /// - foreignKey: An eventual foreign key. You need to provide an + /// explicit foreign key when GRDB can't infer one from the database + /// schema. This happens when the schema does not define any foreign + /// key from the destination table, or when the schema defines several + /// foreign keys from the destination table. + public func hasOne( + _ destination: Table, + key: String? = nil, + using foreignKey: ForeignKey? = nil) + -> HasOneAssociation + { + HasOneAssociation( + to: destination.relationForAll, + key: key, + using: foreignKey) + } +} + +// MARK: - Associations to CommonTableExpression + +extension Table { + /// Creates an association to a common table expression that you can join + /// or include in another request. + /// + /// For more information, see `TableRecord.association(to:on:)`. + /// + /// - parameter cte: A common table expression. + /// - parameter condition: A function that returns the joining clause. + /// - parameter left: A `TableAlias` for the left table. + /// - parameter right: A `TableAlias` for the right table. + /// - returns: An association to the common table expression. + public func association( + to cte: CommonTableExpression, + on condition: @escaping (_ left: TableAlias, _ right: TableAlias) -> SQLExpressible) + -> JoinAssociation + { + JoinAssociation( + to: cte.relationForAll, + condition: .expression { condition($0, $1).sqlExpression }) + } + + /// Creates an association to a common table expression that you can join + /// or include in another request. + /// + /// The key of the returned association is the table name of the common + /// table expression. + /// + /// - parameter cte: A common table expression. + /// - returns: An association to the common table expression. + public func association( + to cte: CommonTableExpression) + -> JoinAssociation + { + JoinAssociation(to: cte.relationForAll, condition: .none) + } +} + +// MARK: - "Through" Associations + +extension Table { + /// Creates a "Has Many Through" association between Self and the + /// destination type. + /// + /// For more information, see `TableRecord.hasMany(_:through:using:key:)`. + /// + /// - parameters: + /// - destination: The record type at the other side of the association. + /// - pivot: An association from Self to the intermediate type. + /// - target: A target association from the intermediate type to the + /// destination type. + /// - key: An eventual decoding key for the association. By default, it + /// is the same key as the target. + public func hasMany( + _ destination: Target.RowDecoder.Type, + through pivot: Pivot, + using target: Target, + key: String? = nil) + -> HasManyThroughAssociation + where Pivot: Association, + Target: Association, + Pivot.OriginRowDecoder == Self, + Pivot.RowDecoder == Target.OriginRowDecoder + { + let association = HasManyThroughAssociation( + sqlAssociation: target._sqlAssociation.through(pivot._sqlAssociation)) + + if let key = key { + return association.forKey(key) + } else { + return association + } + } + + /// Creates a "Has One Through" association between Self and the + /// destination type. + /// + /// For more information, see `TableRecord.hasOne(_:through:using:key:)`. + /// + /// - parameters: + /// - destination: The record type at the other side of the association. + /// - pivot: An association from Self to the intermediate type. + /// - target: A target association from the intermediate type to the + /// destination type. + /// - key: An eventual decoding key for the association. By default, it + /// is the same key as the target. + public func hasOne( + _ destination: Target.RowDecoder.Type, + through pivot: Pivot, + using target: Target, + key: String? = nil) + -> HasOneThroughAssociation + where Pivot: AssociationToOne, + Target: AssociationToOne, + Pivot.OriginRowDecoder == Self, + Pivot.RowDecoder == Target.OriginRowDecoder + { + let association = HasOneThroughAssociation( + sqlAssociation: target._sqlAssociation.through(pivot._sqlAssociation)) + + if let key = key { + return association.forKey(key) + } else { + return association + } + } +} diff --git a/GRDB/QueryInterface/TableRecord+Association.swift b/GRDB/QueryInterface/TableRecord+Association.swift index def776476..7c5c74fc3 100644 --- a/GRDB/QueryInterface/TableRecord+Association.swift +++ b/GRDB/QueryInterface/TableRecord+Association.swift @@ -209,6 +209,91 @@ extension TableRecord { } } +// MARK: - Associations to Table + +extension TableRecord { + /// Creates a "Belongs To" association between Self and the destination + /// table, based on a database foreign key. + /// + /// For more information, see `TableRecord.belongsTo(_:key:using:)` where + /// the first argument is `TableRecord`. + /// + /// - parameters: + /// - destination: The table at the other side of the association. + /// - key: An eventual decoding key for the association. By default, it + /// is `destination.tableName`. + /// - foreignKey: An eventual foreign key. You need to provide an + /// explicit foreign key when GRDB can't infer one from the database + /// schema. This happens when the schema does not define any foreign + /// key to the destination table, or when the schema defines several + /// foreign keys to the destination table. + public static func belongsTo( + _ destination: Table, + key: String? = nil, + using foreignKey: ForeignKey? = nil) + -> BelongsToAssociation + { + BelongsToAssociation( + to: destination.relationForAll, + key: key, + using: foreignKey) + } + + /// Creates a "Has many" association between Self and the destination table, + /// based on a database foreign key. + /// + /// For more information, see `TableRecord.hasMany(_:key:using:)` where + /// the first argument is `TableRecord`. + /// + /// - parameters: + /// - destination: The table at the other side of the association. + /// - key: An eventual decoding key for the association. By default, it + /// is `destination.tableName`. + /// - foreignKey: An eventual foreign key. You need to provide an + /// explicit foreign key when GRDB can't infer one from the database + /// schema. This happens when the schema does not define any foreign + /// key from the destination table, or when the schema defines several + /// foreign keys from the destination table. + public static func hasMany( + _ destination: Table, + key: String? = nil, + using foreignKey: ForeignKey? = nil) + -> HasManyAssociation + { + HasManyAssociation( + to: destination.relationForAll, + key: key, + using: foreignKey) + } + + /// Creates a "Has one" association between Self and the destination table, + /// based on a database foreign key. + /// + /// For more information, see `TableRecord.hasOne(_:key:using:)` where + /// the first argument is `TableRecord`. + /// + /// - parameters: + /// - destination: The table at the other side of the association. + /// - key: An eventual decoding key for the association. By default, it + /// is `destination.databaseTableName`. + /// - foreignKey: An eventual foreign key. You need to provide an + /// explicit foreign key when GRDB can't infer one from the database + /// schema. This happens when the schema does not define any foreign + /// key from the destination table, or when the schema defines several + /// foreign keys from the destination table. + public static func hasOne( + _ destination: Table, + key: String? = nil, + using foreignKey: ForeignKey? = nil) + -> HasOneAssociation + { + HasOneAssociation( + to: destination.relationForAll, + key: key, + using: foreignKey) + } +} + // MARK: - Associations to CommonTableExpression extension TableRecord { diff --git a/GRDBCustom.xcodeproj/project.pbxproj b/GRDBCustom.xcodeproj/project.pbxproj index 220ca551e..27ca1bf4c 100755 --- a/GRDBCustom.xcodeproj/project.pbxproj +++ b/GRDBCustom.xcodeproj/project.pbxproj @@ -362,6 +362,8 @@ 56894FE8260658A500268F4D /* Decimal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56894FA0260657F600268F4D /* Decimal.swift */; }; 56894FF2260658E600268F4D /* FoundationDecimalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56894FF1260658E600268F4D /* FoundationDecimalTests.swift */; }; 56894FF3260658E600268F4D /* FoundationDecimalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56894FF1260658E600268F4D /* FoundationDecimalTests.swift */; }; + 56894F332604FC1E00268F4D /* Table.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56894F322604FC1E00268F4D /* Table.swift */; }; + 56894F342604FC1E00268F4D /* Table.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56894F322604FC1E00268F4D /* Table.swift */; }; 568ECB0D25D904CA00B71526 /* SQLSelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568ECB0C25D904CA00B71526 /* SQLSelection.swift */; }; 568ECB0E25D904CA00B71526 /* SQLSelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568ECB0C25D904CA00B71526 /* SQLSelection.swift */; }; 568ECB3525D91CEF00B71526 /* SQLSubquery.swift in Sources */ = {isa = PBXBuildFile; fileRef = 568ECB3425D91CEE00B71526 /* SQLSubquery.swift */; }; @@ -976,6 +978,7 @@ 5687359E1CEDE16C009B9116 /* Betty.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Betty.jpeg; sourceTree = ""; }; 56894FA0260657F600268F4D /* Decimal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Decimal.swift; sourceTree = ""; }; 56894FF1260658E600268F4D /* FoundationDecimalTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FoundationDecimalTests.swift; sourceTree = ""; }; + 56894F322604FC1E00268F4D /* Table.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Table.swift; sourceTree = ""; }; 568ECB0C25D904CA00B71526 /* SQLSelection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SQLSelection.swift; sourceTree = ""; }; 568ECB3425D91CEE00B71526 /* SQLSubquery.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SQLSubquery.swift; sourceTree = ""; }; 5690C3251D23E6D800E59934 /* FoundationDateComponentsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FoundationDateComponentsTests.swift; sourceTree = ""; }; @@ -1562,6 +1565,7 @@ 5656A84E2295BD56001FF3FF /* SQLRelation.swift */, 568ECB0C25D904CA00B71526 /* SQLSelection.swift */, 568ECB3425D91CEE00B71526 /* SQLSubquery.swift */, + 56894F322604FC1E00268F4D /* Table.swift */, ); path = SQL; sourceTree = ""; @@ -2280,6 +2284,7 @@ 56CEB4F61EAA2EFA00BFAF62 /* FetchableRecord.swift in Sources */, 5656A8522295BD56001FF3FF /* SQLInterpolation+QueryInterface.swift in Sources */, 56BB6EAE1D3009B100A1CA52 /* SchedulingWatchdog.swift in Sources */, + 56894F342604FC1E00268F4D /* Table.swift in Sources */, F3BA801A1CFB2876003DC1BA /* StatementColumnConvertible.swift in Sources */, 566B91381FA4D3810012D5B0 /* TransactionObserver.swift in Sources */, 56CEB4FF1EAA2F4D00BFAF62 /* FTS3.swift in Sources */, @@ -2641,6 +2646,7 @@ 56CEB4F31EAA2EFA00BFAF62 /* FetchableRecord.swift in Sources */, 5656A8512295BD56001FF3FF /* SQLInterpolation+QueryInterface.swift in Sources */, 56BB6EAB1D3009B100A1CA52 /* SchedulingWatchdog.swift in Sources */, + 56894F332604FC1E00268F4D /* Table.swift in Sources */, F3BA80761CFB2E55003DC1BA /* StatementColumnConvertible.swift in Sources */, 566B91351FA4D3810012D5B0 /* TransactionObserver.swift in Sources */, 56CEB4FC1EAA2F4D00BFAF62 /* FTS3.swift in Sources */,