Skip to content

Commit

Permalink
Merge pull request #1168 from stephencelis/revert-prepareRowIterator
Browse files Browse the repository at this point in the history
prepareRowIterator should be internal
  • Loading branch information
jberkel authored Oct 26, 2022
2 parents 3977813 + 570efef commit 884627c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
8 changes: 0 additions & 8 deletions Documentation/Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2125,15 +2125,7 @@ using the following functions.
}
}
```
Statements with results may be iterated over, using a `RowIterator` if
useful.

```swift
let emailColumn = Expression<String>("email")
let stmt = try db.prepare("SELECT id, email FROM users")
let emails = try! stmt.prepareRowIterator().map { $0[emailColumn] }
```

- `run` prepares a single `Statement` object from a SQL string, optionally
binds values to it (using the statement’s `bind` function), executes,
and returns the statement.
Expand Down
4 changes: 2 additions & 2 deletions Sources/SQLite/Core/Statement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ extension Statement: FailableIterator {
}

extension Statement {
public func prepareRowIterator() -> RowIterator {
return RowIterator(statement: self, columnNames: self.columnNameMap)
func prepareRowIterator() -> RowIterator {
RowIterator(statement: self, columnNames: columnNameMap)
}

var columnNameMap: [String: Int] {
Expand Down
2 changes: 1 addition & 1 deletion Tests/SQLiteTests/Core/StatementTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import XCTest
import SQLite
@testable import SQLite

#if SQLITE_SWIFT_STANDALONE
import sqlite3
Expand Down

0 comments on commit 884627c

Please sign in to comment.