@@ -10,17 +10,17 @@ public struct PostgresRowSequence: AsyncSequence, Sendable {
1010 typealias BackingSequence = NIOThrowingAsyncSequenceProducer < DataRow , Error , AdaptiveRowBuffer , PSQLRowStream >
1111
1212 private let backing : BackingSequence
13- private let stream : PSQLRowStream
13+ private let rowStream : PSQLRowStream
1414 var lookupTable : [ String : Int ] {
15- self . stream . lookupTable
15+ self . rowStream . lookupTable
1616 }
1717 var columns : [ RowDescription . Column ] {
18- self . stream . rowDescription
18+ self . rowStream . rowDescription
1919 }
2020
21- init ( _ backing: BackingSequence , stream : PSQLRowStream ) {
21+ init ( _ backing: BackingSequence , rowStream : PSQLRowStream ) {
2222 self . backing = backing
23- self . stream = stream
23+ self . rowStream = rowStream
2424 }
2525
2626 public func makeAsyncIterator( ) -> AsyncIterator {
@@ -72,9 +72,11 @@ extension PostgresRowSequence {
7272 return result
7373 }
7474
75- public func collectWithMetadata( ) async throws -> ( metadata: PostgresQueryMetadata ? , rows: [ PostgresRow ] ) {
75+ public func collectWithMetadata( ) async throws -> ( metadata: PostgresQueryMetadata , rows: [ PostgresRow ] ) {
7676 let rows = try await self . collect ( )
77- let metadata = PostgresQueryMetadata ( string: self . stream. commandTag)
77+ guard let metadata = PostgresQueryMetadata ( string: self . rowStream. commandTag) else {
78+ throw PSQLError . invalidCommandTag ( self . rowStream. commandTag)
79+ }
7880 return ( metadata, rows)
7981 }
8082}
0 commit comments