File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,7 +103,14 @@ export function transformBqrsResultSet(
103103 } ;
104104}
105105
106+ type BqrsKind = 'String' | 'Float' | 'Integer' | 'String' | 'Boolean' | 'Date' | 'Entity' ;
107+
108+ interface BqrsColumn {
109+ name : string ;
110+ kind : BqrsKind ;
111+ }
106112export interface DecodedBqrsChunk {
107113 tuples : CellValue [ ] [ ] ;
108114 next ?: number ;
115+ columns : BqrsColumn [ ] ;
109116}
Original file line number Diff line number Diff line change @@ -358,9 +358,12 @@ export class QueryEvaluationInfo {
358358 pageSize : 100 ,
359359 offset : nextOffset ,
360360 } ) ;
361- for ( const tuple of chunk . tuples ) {
362- out . write ( tuple . join ( ',' ) + '\n' ) ;
363- }
361+ const quotes = chunk . columns . map ( col => col . kind === 'String' ? '"' : '' ) ;
362+ chunk . tuples . forEach ( ( tuple ) => {
363+ out . write ( tuple . map ( ( v , i ) => {
364+ return `${ quotes [ i ] } ${ v } ${ quotes [ i ] } ` ;
365+ } ) . join ( ',' ) + '\n' ) ;
366+ } ) ;
364367 nextOffset = chunk . next ;
365368 }
366369 out . end ( ) ;
You can’t perform that action at this time.
0 commit comments