@@ -57,24 +57,18 @@ class SQLService extends DatabaseService {
5757 return super . init ( )
5858 }
5959
60- _changeToStreams ( columns , rows , one , compat ) {
60+ _changeToStreams ( columns , rows , one ) {
6161 if ( ! rows || ! columns ) return
6262 if ( ! Array . isArray ( rows ) ) rows = [ rows ]
63- if ( ! rows . length || ! Object . keys ( rows [ 0 ] ) . length ) return
64-
65- // REVISIT: remove after removing stream_compat feature flag
66- if ( compat ) {
67- rows [ 0 ] [ Object . keys ( rows [ 0 ] ) [ 0 ] ] = this . _stream ( Object . values ( rows [ 0 ] ) [ 0 ] )
68- return
69- }
63+ if ( ! rows . length || ! Object . keys ( rows [ 0 ] ) . length ) return
7064
7165 let changes = false
7266 for ( let col of columns ) {
7367 const name = col . as || col . ref ?. [ col . ref . length - 1 ] || ( typeof col === 'string' && col )
7468 if ( col . element ?. isAssociation ) {
75- if ( one ) this . _changeToStreams ( col . SELECT . columns , rows [ 0 ] [ name ] , false , compat )
69+ if ( one ) this . _changeToStreams ( col . SELECT . columns , rows [ 0 ] [ name ] , false )
7670 else
77- changes = rows . some ( row => ! this . _changeToStreams ( col . SELECT . columns , row [ name ] , false , compat ) )
71+ changes = rows . some ( row => ! this . _changeToStreams ( col . SELECT . columns , row [ name ] , false ) )
7872 } else if ( col . element ?. type === 'cds.LargeBinary' ) {
7973 changes = true
8074 if ( one ) rows [ 0 ] [ name ] = this . _stream ( rows [ 0 ] [ name ] )
@@ -141,23 +135,7 @@ class SQLService extends DatabaseService {
141135 if ( expand ) rows = rows . map ( r => ( typeof r . _json_ === 'string' ? JSON . parse ( r . _json_ ) : r . _json_ || r ) )
142136
143137 if ( ! iterator ) {
144- // REVISIT: remove after removing stream_compat feature flag
145- if ( cds . env . features . stream_compat ) {
146- if ( query . _streaming ) {
147- if ( ! rows . length ) return
148- this . _changeToStreams ( cqn . SELECT . columns , rows , true , true )
149- const result = rows [ 0 ]
150-
151- // stream is always on position 0. Further properties like etag are inserted later.
152- let [ key , val ] = Object . entries ( result ) [ 0 ]
153- result . value = val
154- delete result [ key ]
155-
156- return result
157- }
158- } else {
159- this . _changeToStreams ( cqn . SELECT . columns , rows , query . SELECT . one , false )
160- }
138+ this . _changeToStreams ( cqn . SELECT . columns , rows , query . SELECT . one )
161139 } else if ( objectMode ) {
162140 const converter = ( row ) => this . _changeToStreams ( cqn . SELECT . columns , row , true )
163141 const changeToStreams = new Transform ( {
0 commit comments