mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
31 lines
840 B
Swift
31 lines
840 B
Swift
/// A column in the database
|
|
///
|
|
/// See https://github.com/groue/GRDB.swift#the-query-interface
|
|
public struct Column {
|
|
/// The hidden rowID column
|
|
public static let rowID = Column("rowid")
|
|
|
|
/// The name of the column
|
|
public let name: String
|
|
|
|
/// Creates a column given its name.
|
|
public init(_ name: String) {
|
|
self.name = name
|
|
}
|
|
}
|
|
|
|
extension Column : SQLExpression {
|
|
|
|
/// This function is an implementation detail of the query interface.
|
|
/// Do not use it directly.
|
|
///
|
|
/// See https://github.com/groue/GRDB.swift/#the-query-interface
|
|
///
|
|
/// # Low Level Query Interface
|
|
///
|
|
/// See SQLExpression.expressionSQL(_:arguments:)
|
|
public func expressionSQL(_ arguments: inout StatementArguments?) -> String {
|
|
return name.quotedDatabaseIdentifier
|
|
}
|
|
}
|