Skip to content

prepareRowIterator should be internal #1168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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