-
The table to update.
Declaration
Swift
public let table: Table -
The SQL WHERE clause containing the filter for the rows to update. Could be represented with a
Filterclause or aStringcontaining raw SQL.Declaration
Swift
public private(set) var whereClause: QueryFilterProtocol? { get } -
A String with a clause to be appended to the end of the query.
Declaration
Swift
public private(set) var suffix: QuerySuffixProtocol? { get } -
An array of
AuxiliaryTablewhich will be used in a query with a WITH clause.Declaration
Swift
public private(set) var with: [AuxiliaryTable]? { get } -
Initialize an instance of Update.
Declaration
Swift
public init(_ table: Table, set: [(Column, Any)], where conditions: QueryFilterProtocol? = nil)Parameters
tableThe table to update.
setAn array of (column, value) tuples to set.
conditionsAn optional where clause to apply.
-
Build the query using
QueryBuilder.Throws
QueryError.syntaxError if query build fails.Declaration
Swift
public func build(queryBuilder: QueryBuilder) throws -> StringParameters
queryBuilderThe QueryBuilder to use.
Return Value
A String representation of the query.
-
Add an SQL WHERE clause to the update statement.
Declaration
Swift
public func `where`(_ conditions: QueryFilterProtocol) -> UpdateParameters
conditionsThe
Filterclause or aStringcontaining the SQL WHERE to apply.Return Value
A new instance of Update.
-
Add a raw suffix to the update statement.
Declaration
Swift
public func suffix(_ raw: String) -> UpdateParameters
rawA String with a clause to be appended to the end of the query.
Return Value
A new instance of Update.
View on GitHub
Update Structure Reference