SQLPrimaryKeyExpression
public struct SQLPrimaryKeyExpression : SQLExpression
SQLPrimaryKeyExpression is the primary key of a table.
For tables that have no explicit primary key, SQLPrimaryKeyExpression is the
rowid
column.
For tables whose primary key spans several columns, the current
implementation of SQLPrimaryKeyExpression also is the rowid
column. Future
GRDB versions may return a row value.
For example:
struct Player: TableRecord { ... }
let player = dbQueue.read { db in
try Player.filter(Player.primaryKey == 12).fetchOne(db)
}
-
Declaration
Swift
public func expressionSQL(_ context: SQLGenerationContext, wrappedInParenthesis: Bool) throws -> String
-
Declaration
Swift
public func qualifiedExpression(with alias: TableAlias) -> SQLExpression