-
The table to insert rows.
Declaration
Swift
public let table: Table -
An array of columns to insert. If not specified, values of all the columns have to be provided.
Declaration
Swift
public let columns: [Column]? -
An array of rows (values to insert in each row).
Declaration
Swift
public private(set) var values: [[Any]]? { get } -
A String with a clause to be appended to the end of the query.
Declaration
Swift
public private(set) var suffix: QuerySuffixProtocol? { get } -
The select query that retrieves the rows to insert (for INSERT INTO SELECT).
Declaration
Swift
public private(set) var query: Select? { get } -
An array of
AuxiliaryTablewhich will be used in a query with a WITH clause.Declaration
Swift
public private(set) var with: [AuxiliaryTable]? { get } -
A flag for return ID
Declaration
Swift
public let returnID: Bool -
Initialize an instance of Insert.
Declaration
Parameters
intoThe table to insert rows.
columnsAn optional array of columns to insert. If nil, values of all the columns have to be provided.
valuesAn array containg the row to insert.
-
Initialize an instance of Insert.
Declaration
Parameters
intoThe table to insert rows.
columnsAn optional array of columns to insert. If not specified, values of all the columns have to be provided.
valuesAn array of rows (values to insert in each row).
-
Initialize an instance of Insert.
Declaration
Swift
public init(into table: Table, values: Any..., returnID: Bool = false)Parameters
intoThe table to insert rows.
valuesA list of values (the row) to insert.
-
Initialize an instance of Insert.
Declaration
Swift
public init(into table: Table, values: [Any], returnID: Bool = false)Parameters
intoThe table to insert rows.
valuesAn array of values (the row) to insert.
-
Initialize an instance of Insert.
Declaration
Parameters
intoThe table to insert rows.
columnsAn optional array of columns to insert. If nil, values of all the columns have to be provided.
queryThe select query that retrieves the rows to insert.
-
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 a raw suffix to the insert statement.
Declaration
Swift
public func suffix(_ raw: String) -> InsertParameters
rawA String with a clause to be appended to the end of the query.
Return Value
A new instance of Insert.
View on GitHub
Insert Structure Reference