SQLStatementCursor
A cursor over all statements in an SQL string.
class SQLStatementCursor
A cursor over all statements in an SQL string.
class SQLStatementCursor
import GRDB
A toolkit for SQLite databases, with a focus on application development
func allStatements(literal sqlLiteral: SQL) throws -> SQLStatementCursor
Returns a cursor of prepared statements.
func allStatements(sql: String, arguments: StatementArguments? = nil) throws -> SQLStatementCursor
Returns a cursor of prepared statements.
func cachedStatement(literal sqlLiteral: SQL) throws -> Statement
Returns a prepared statement that can be reused.
func cachedStatement(sql: String) throws -> Statement
Returns a prepared statement that can be reused.
func execute(literal sqlLiteral: SQL) throws
Executes one or several SQL statements.
func execute(sql: String, arguments: StatementArguments = StatementArguments()) throws
Executes one or several SQL statements.
func makeStatement(literal sqlLiteral: SQL) throws -> Statement
Returns a new prepared statement that can be reused.
func makeStatement(sql: String) throws -> Statement
Returns a new prepared statement that can be reused.
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol Cursor<Element> : AnyObject
A type that supplies the values of some external resource, one at a time.
protocol Escapable
func next() throws -> Statement?
var isEmpty: Bool { get throws }
Returns a Boolean value indicating whether the cursor does not contain any element.
func compactMap<ElementOfResult>(_ transform: @escaping (Element) throws -> ElementOfResult?) -> MapCursor<FilterCursor<MapCursor<Self, ElementOfResult?>>, ElementOfResult>
Returns a cursor over the concatenated non-nil results of mapping transform over this cursor.
func contains(where predicate: (Element) throws -> Bool) throws -> Bool
Returns a Boolean value indicating whether the cursor contains an element that satisfies the given predicate.
func drop(while predicate: @escaping (Element) throws -> Bool) -> DropWhileCursor<Self>
Returns a cursor that skips any initial elements that satisfy predicate
.
func dropFirst() -> DropFirstCursor<Self>
Returns a cursor containing all but the first element of the cursor.
func dropFirst(_ n: Int) -> DropFirstCursor<Self>
Returns a cursor containing all but the given number of initial elements.
func dropLast() throws -> [Element]
Returns an array containing all but the last element of the cursor.
func dropLast(_ n: Int) throws -> [Element]
Returns an array containing all but the given number of final elements.
func enumerated() -> EnumeratedCursor<Self>
Returns a cursor of pairs (n, x), where n represents a consecutive integer starting at zero, and x represents an element of the cursor.
func filter(_ isIncluded: @escaping (Element) throws -> Bool) -> FilterCursor<Self>
Returns the elements of the cursor that satisfy the given predicate.
func first(where predicate: (Element) throws -> Bool) throws -> Element?
Returns the first element of the cursor that satisfies the given predicate or nil if no such element is found.
func flatMap<SegmentOfResult>(_ transform: @escaping (Element) throws -> SegmentOfResult) -> FlattenCursor<MapCursor<Self, AnyCursor<SegmentOfResult.Element>>> where SegmentOfResult : Sequence
Returns a cursor over the concatenated results of mapping transform over self.
func flatMap<SegmentOfResult>(_ transform: @escaping (Element) throws -> SegmentOfResult) -> FlattenCursor<MapCursor<Self, SegmentOfResult>> where SegmentOfResult : Cursor
Returns a cursor over the concatenated results of mapping transform over self.
func forEach(_ body: (Element) throws -> Void) throws
Calls the given closure on each element in the cursor.
func map<T>(_ transform: @escaping (Element) throws -> T) -> MapCursor<Self, T>
Returns a cursor over the results of the transform function applied to this cursor’s elements.
func max(by areInIncreasingOrder: (Element, Element) throws -> Bool) throws -> Element?
Returns the maximum element in the cursor, using the given predicate as the comparison between elements.
func min(by areInIncreasingOrder: (Element, Element) throws -> Bool) throws -> Element?
Returns the minimum element in the cursor, using the given predicate as the comparison between elements.
func prefix(_ maxLength: Int) -> PrefixCursor<Self>
Returns a cursor, up to the specified maximum length, containing the initial elements of the cursor.
func prefix(while predicate: @escaping (Element) throws -> Bool) -> PrefixWhileCursor<Self>
Returns a cursor of the initial consecutive elements that satisfy predicate
.
func reduce<Result>(_ initialResult: Result, _ nextPartialResult: (Result, Element) throws -> Result) throws -> Result
Returns the result of calling the given combining closure with each element of this cursor and an accumulating value.
func reduce<Result>(into initialResult: Result, _ updateAccumulatingResult: (inout Result, Element) throws -> Void) throws -> Result
Returns the result of calling the given combining closure with each element of this cursor and an accumulating value.
func suffix(_ maxLength: Int) throws -> [Element]
Returns an array, up to the given maximum length, containing the final elements of the cursor.