mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
New SQL interpolation "... \(tableOf: record) ..." (addresses #524)
This commit is contained in:
1 parent
7461342089
commit
21d2df9ade
4 files changed
+36
-10
No files matched your search
@@ -9,6 +9,15 @@ extension SQLInterpolation {
|
||||
sql += table.databaseTableName.quotedDatabaseIdentifier
|
||||
}
|
||||
|
||||
/// Appends the table name of the record.
|
||||
///
|
||||
/// // INSERT INTO player ...
|
||||
/// let player: Player = ...
|
||||
/// let request: SQLRequest<Player> = "INSERT INTO \(tableOf: player) ..."
|
||||
public mutating func appendInterpolation<T: TableRecord>(tableOf record: T) {
|
||||
sql += type(of: record).databaseTableName.quotedDatabaseIdentifier
|
||||
}
|
||||
|
||||
/// Appends the selectable SQL.
|
||||
///
|
||||
/// // SELECT * FROM player
|
||||
|
||||
Reference in new issue
Block a user