Skip to content

Commit d8d8abb

Browse files
committed
rename the func to __simpleQuery for now
1 parent 94eeb8a commit d8d8abb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Sources/PostgresNIO/Connection/PostgresConnection.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,9 @@ extension PostgresConnection {
438438
}
439439
}
440440

441-
/// Run a query on the Postgres server the connection is connected to.
441+
/// Run a simple text-only query on the Postgres server the connection is connected to.
442+
/// WARNING: This functions is not yet API and is incomplete.
443+
/// The return type will change to another stream.
442444
///
443445
/// - Parameters:
444446
/// - query: The simple query to run
@@ -448,7 +450,7 @@ extension PostgresConnection {
448450
/// - Returns: A ``PostgresRowSequence`` containing the rows the server sent as the query result.
449451
/// The sequence be discarded.
450452
@discardableResult
451-
public func simpleQuery(
453+
public func __simpleQuery(
452454
_ query: String,
453455
logger: Logger,
454456
file: String = #fileID,

Tests/IntegrationTests/AsyncTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class AsyncPostgresConnectionTests: XCTestCase {
3232

3333
try await withTestConnection(on: eventLoop) { connection in
3434
for _ in 0..<1_000 {
35-
let rows = try await connection.simpleQuery("SELECT version()", logger: .psqlTest)
35+
let rows = try await connection.__simpleQuery("SELECT version()", logger: .psqlTest)
3636
var iterator = rows.makeAsyncIterator()
3737
let firstRow = try await iterator.next()
3838
XCTAssertEqual(try firstRow?.decode(String.self, context: .default).contains("PostgreSQL"), true)
@@ -50,7 +50,7 @@ final class AsyncPostgresConnectionTests: XCTestCase {
5050
try await withTestConnection(on: eventLoop) { connection in
5151
for _ in 0..<1_000 {
5252
let nonExistentOID = 1928394819
53-
let rows = try await connection.simpleQuery("SELECT * FROM pg_class WHERE oid = \(nonExistentOID)", logger: .psqlTest)
53+
let rows = try await connection.__simpleQuery("SELECT * FROM pg_class WHERE oid = \(nonExistentOID)", logger: .psqlTest)
5454
var iterator = rows.makeAsyncIterator()
5555
let first = try await iterator.next()
5656
XCTAssertEqual(first, nil)

0 commit comments

Comments
 (0)