From 570efefb451ff021aa5d19414f9a30d357042a96 Mon Sep 17 00:00:00 2001 From: Jan Berkel Date: Wed, 26 Oct 2022 01:04:29 +0200 Subject: [PATCH] prepareRowIterator should be internal --- Documentation/Index.md | 8 -------- Sources/SQLite/Core/Statement.swift | 4 ++-- Tests/SQLiteTests/Core/StatementTests.swift | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Documentation/Index.md b/Documentation/Index.md index 3d0639b3..fa91f7b7 100644 --- a/Documentation/Index.md +++ b/Documentation/Index.md @@ -2125,15 +2125,7 @@ using the following functions. } } ``` - Statements with results may be iterated over, using a `RowIterator` if - useful. - ```swift - let emailColumn = Expression("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. diff --git a/Sources/SQLite/Core/Statement.swift b/Sources/SQLite/Core/Statement.swift index df4ceebf..80450258 100644 --- a/Sources/SQLite/Core/Statement.swift +++ b/Sources/SQLite/Core/Statement.swift @@ -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] { diff --git a/Tests/SQLiteTests/Core/StatementTests.swift b/Tests/SQLiteTests/Core/StatementTests.swift index 2ab84c09..0d82e890 100644 --- a/Tests/SQLiteTests/Core/StatementTests.swift +++ b/Tests/SQLiteTests/Core/StatementTests.swift @@ -1,5 +1,5 @@ import XCTest -import SQLite +@testable import SQLite #if SQLITE_SWIFT_STANDALONE import sqlite3