File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,7 @@ lincones.clienteSQLite.abrir().then(() => {
1717 console . table ( resultado . linhasRetornadas ) ;
1818 }
1919
20- if ( resultado . linhasAfetadas ) {
21- console . log ( `Linhas afetadas: ${ resultado . linhasAfetadas } ` ) ;
22- }
20+ console . log ( resultado . mensagemExecucao ) ;
2321
2422 if ( resultado . ultimoId ) {
2523 console . log ( `ID retornado pela operação: ${ resultado . ultimoId } ` ) ;
Original file line number Diff line number Diff line change @@ -3,8 +3,13 @@ export class RetornoComando {
33 ultimoId : any ;
44 linhasRetornadas : any [ ] = [ ] ;
55 comandoExecutado : string ;
6+ mensagemExecucao : string ;
67
78 constructor ( resultadoExecucao : any ) {
9+ if ( ! resultadoExecucao ) {
10+ return ;
11+ }
12+
813 if ( resultadoExecucao . changes ) {
914 this . linhasAfetadas = resultadoExecucao . changes ;
1015 }
@@ -15,10 +20,12 @@ export class RetornoComando {
1520
1621 if ( resultadoExecucao . stmt ) {
1722 this . comandoExecutado = resultadoExecucao . stmt ;
23+ this . mensagemExecucao = `Ok (${ this . linhasAfetadas || 0 } linhas afetadas)` ;
1824 }
1925
2026 if ( Array . isArray ( resultadoExecucao ) ) {
2127 this . linhasRetornadas = resultadoExecucao ;
28+ this . mensagemExecucao = `(${ this . linhasRetornadas . length } linhas retornadas)` ;
2229 }
2330 }
2431}
You can’t perform that action at this time.
0 commit comments