@@ -830,7 +830,7 @@ export class SnowflakeDriver extends BaseDriver implements DriverInterface {
830830 return ;
831831 }
832832
833- const hydrationMap = this . generateHydrationMap ( stmt . getColumns ( ) ) ;
833+ const hydrationMap = this . generateHydrationMap ( stmt . getColumns ( ) ?? [ ] ) ;
834834 const types : { name : string , type : string } [ ] =
835835 this . getTypes ( stmt ) ;
836836 if ( rows ?. length && Object . keys ( hydrationMap ) . length ) {
@@ -878,7 +878,7 @@ export class SnowflakeDriver extends BaseDriver implements DriverInterface {
878878 } ) ) ;
879879 const types : { name : string , type : string } [ ] =
880880 this . getTypes ( stmt ) ;
881- const hydrationMap = this . generateHydrationMap ( stmt . getColumns ( ) ) ;
881+ const hydrationMap = this . generateHydrationMap ( stmt . getColumns ( ) ?? [ ] ) ;
882882 if ( Object . keys ( hydrationMap ) . length ) {
883883 const rowStream = new HydrationStream ( hydrationMap ) ;
884884 stmt . streamRows ( ) . pipe ( rowStream ) ;
@@ -900,7 +900,7 @@ export class SnowflakeDriver extends BaseDriver implements DriverInterface {
900900 }
901901
902902 private getTypes ( stmt : RowStatement ) {
903- return stmt . getColumns ( ) . map ( ( column ) => {
903+ return ( stmt . getColumns ( ) ?? [ ] ) . map ( ( column ) => {
904904 const type = {
905905 name : column . getName ( ) . toLowerCase ( ) ,
906906 type : '' ,
@@ -931,6 +931,8 @@ export class SnowflakeDriver extends BaseDriver implements DriverInterface {
931931 if ( fnOrNull ) {
932932 hydrationMap [ column . getName ( ) ] = fnOrNull ;
933933 }
934+
935+ break ;
934936 }
935937 }
936938 }
@@ -960,7 +962,7 @@ export class SnowflakeDriver extends BaseDriver implements DriverInterface {
960962 }
961963
962964 if ( rehydrate && rows ?. length ) {
963- const hydrationMap = this . generateHydrationMap ( stmt . getColumns ( ) ) ;
965+ const hydrationMap = this . generateHydrationMap ( stmt . getColumns ( ) ?? [ ] ) ;
964966 if ( Object . keys ( hydrationMap ) . length ) {
965967 for ( const row of rows ) {
966968 for ( const [ field , toValue ] of Object . entries ( hydrationMap ) ) {
0 commit comments