@@ -904,20 +904,27 @@ void Statement::JS_new (v8::FunctionCallbackInfo <v8 :: Value> const & info)
904
904
if (handle == NULL ) {
905
905
return ThrowRangeError (" The supplied SQL string contains no statements" );
906
906
}
907
- for (char c; (c = *tail); ++tail) {
908
- if (IS_SKIPPED (c)) continue ;
907
+
908
+ for (char c; (c = *tail); ) {
909
+ if (IS_SKIPPED (c)) {
910
+ ++tail;
911
+ continue ;
912
+ }
909
913
if (c == ' /' && tail[1 ] == ' *' ) {
910
914
tail += 2 ;
911
915
for (char c; (c = *tail); ++tail) {
912
916
if (c == ' *' && tail[1 ] == ' /' ) {
913
- tail += 1 ;
917
+ tail += 2 ;
914
918
break ;
915
919
}
916
920
}
917
921
} else if (c == ' -' && tail[1 ] == ' -' ) {
918
922
tail += 2 ;
919
923
for (char c; (c = *tail); ++tail) {
920
- if (c == ' \n ' ) break ;
924
+ if (c == ' \n ' ) {
925
+ ++tail;
926
+ break ;
927
+ }
921
928
}
922
929
} else {
923
930
sqlite3_finalize (handle);
@@ -936,9 +943,9 @@ void Statement::JS_new (v8::FunctionCallbackInfo <v8 :: Value> const & info)
936
943
937
944
info.GetReturnValue ().Set (info.This ());
938
945
}
939
- #line 149 "./src/objects/statement.lzz"
946
+ #line 156 "./src/objects/statement.lzz"
940
947
void Statement::JS_run (v8::FunctionCallbackInfo <v8 :: Value> const & info)
941
- #line 149 "./src/objects/statement.lzz"
948
+ #line 156 "./src/objects/statement.lzz"
942
949
{
943
950
Statement * stmt = node :: ObjectWrap :: Unwrap < Statement > ( info . This ( ) ) ; ( ( void ) 0 ) ; sqlite3_stmt * handle = stmt -> handle ; Database * db = stmt -> db ; if ( ! db -> GetState ( ) -> open ) return ThrowTypeError ( "The database connection is not open" ) ; if ( db -> GetState ( ) -> busy ) return ThrowTypeError ( "This database connection is busy executing a query" ) ; if ( stmt -> locked ) return ThrowTypeError ( "This statement is busy executing a query" ) ; if ( ! db -> GetState ( ) -> unsafe_mode ) { if ( db -> GetState ( ) -> iterators ) return ThrowTypeError ( "This database connection is busy executing a query" ) ; } ( ( void ) 0 ) ; const bool bound = stmt -> bound ; if ( ! bound ) { Binder binder ( handle ) ; if ( ! binder . Bind ( info , info . Length ( ) , stmt ) ) { sqlite3_clear_bindings ( handle ) ; return ; } ( ( void ) 0 ) ; } else if ( info . Length ( ) > 0 ) { return ThrowTypeError ( "This statement already has bound parameters" ) ; } ( ( void ) 0 ) ; db -> GetState ( ) -> busy = true ; v8 :: Isolate * isolate = info . GetIsolate ( ) ; if ( db -> Log ( isolate , handle ) ) { db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ; } ( ( void ) 0 ) ;
944
951
sqlite3* db_handle = db->GetHandle ();
@@ -961,9 +968,9 @@ void Statement::JS_run (v8::FunctionCallbackInfo <v8 :: Value> const & info)
961
968
}
962
969
db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ;
963
970
}
964
- #line 172 "./src/objects/statement.lzz"
971
+ #line 179 "./src/objects/statement.lzz"
965
972
void Statement::JS_get (v8::FunctionCallbackInfo <v8 :: Value> const & info)
966
- #line 172 "./src/objects/statement.lzz"
973
+ #line 179 "./src/objects/statement.lzz"
967
974
{
968
975
Statement * stmt = node :: ObjectWrap :: Unwrap < Statement > ( info . This ( ) ) ; if ( ! stmt -> returns_data ) return ThrowTypeError ( "This statement does not return data. Use run() instead" ) ; sqlite3_stmt * handle = stmt -> handle ; Database * db = stmt -> db ; if ( ! db -> GetState ( ) -> open ) return ThrowTypeError ( "The database connection is not open" ) ; if ( db -> GetState ( ) -> busy ) return ThrowTypeError ( "This database connection is busy executing a query" ) ; if ( stmt -> locked ) return ThrowTypeError ( "This statement is busy executing a query" ) ; const bool bound = stmt -> bound ; if ( ! bound ) { Binder binder ( handle ) ; if ( ! binder . Bind ( info , info . Length ( ) , stmt ) ) { sqlite3_clear_bindings ( handle ) ; return ; } ( ( void ) 0 ) ; } else if ( info . Length ( ) > 0 ) { return ThrowTypeError ( "This statement already has bound parameters" ) ; } ( ( void ) 0 ) ; db -> GetState ( ) -> busy = true ; v8 :: Isolate * isolate = info . GetIsolate ( ) ; if ( db -> Log ( isolate , handle ) ) { db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ; } ( ( void ) 0 ) ;
969
976
int status = sqlite3_step (handle);
@@ -978,9 +985,9 @@ void Statement::JS_get (v8::FunctionCallbackInfo <v8 :: Value> const & info)
978
985
sqlite3_reset (handle);
979
986
db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ;
980
987
}
981
- #line 187 "./src/objects/statement.lzz"
988
+ #line 194 "./src/objects/statement.lzz"
982
989
void Statement::JS_all (v8::FunctionCallbackInfo <v8 :: Value> const & info)
983
- #line 187 "./src/objects/statement.lzz"
990
+ #line 194 "./src/objects/statement.lzz"
984
991
{
985
992
Statement * stmt = node :: ObjectWrap :: Unwrap < Statement > ( info . This ( ) ) ; if ( ! stmt -> returns_data ) return ThrowTypeError ( "This statement does not return data. Use run() instead" ) ; sqlite3_stmt * handle = stmt -> handle ; Database * db = stmt -> db ; if ( ! db -> GetState ( ) -> open ) return ThrowTypeError ( "The database connection is not open" ) ; if ( db -> GetState ( ) -> busy ) return ThrowTypeError ( "This database connection is busy executing a query" ) ; if ( stmt -> locked ) return ThrowTypeError ( "This statement is busy executing a query" ) ; const bool bound = stmt -> bound ; if ( ! bound ) { Binder binder ( handle ) ; if ( ! binder . Bind ( info , info . Length ( ) , stmt ) ) { sqlite3_clear_bindings ( handle ) ; return ; } ( ( void ) 0 ) ; } else if ( info . Length ( ) > 0 ) { return ThrowTypeError ( "This statement already has bound parameters" ) ; } ( ( void ) 0 ) ; db -> GetState ( ) -> busy = true ; v8 :: Isolate * isolate = info . GetIsolate ( ) ; if ( db -> Log ( isolate , handle ) ) { db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ; } ( ( void ) 0 ) ;
986
993
v8 :: Local < v8 :: Context > ctx = isolate -> GetCurrentContext ( ) ;
@@ -1001,9 +1008,9 @@ void Statement::JS_all (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1001
1008
if (js_error) db->GetState ()->was_js_error = true ;
1002
1009
db -> GetState ( ) -> busy = false ; db -> ThrowDatabaseError ( ) ; if ( ! bound ) { sqlite3_clear_bindings ( handle ) ; } return ;
1003
1010
}
1004
- #line 208 "./src/objects/statement.lzz"
1011
+ #line 215 "./src/objects/statement.lzz"
1005
1012
void Statement::JS_iterate (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1006
- #line 208 "./src/objects/statement.lzz"
1013
+ #line 215 "./src/objects/statement.lzz"
1007
1014
{
1008
1015
Addon * addon = static_cast < Addon * > ( info . Data ( ) . As < v8 :: External > ( ) -> Value ( ) ) ;
1009
1016
v8 :: Isolate * isolate = info . GetIsolate ( ) ;
@@ -1013,9 +1020,9 @@ void Statement::JS_iterate (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1013
1020
addon->privileged_info = NULL ;
1014
1021
if (!maybeIterator.IsEmpty ()) info.GetReturnValue ().Set (maybeIterator.ToLocalChecked ());
1015
1022
}
1016
- #line 218 "./src/objects/statement.lzz"
1023
+ #line 225 "./src/objects/statement.lzz"
1017
1024
void Statement::JS_bind (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1018
- #line 218 "./src/objects/statement.lzz"
1025
+ #line 225 "./src/objects/statement.lzz"
1019
1026
{
1020
1027
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1021
1028
if (stmt->bound ) return ThrowTypeError (" The bind() method can only be invoked once per statement object" );
@@ -1026,9 +1033,9 @@ void Statement::JS_bind (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1026
1033
stmt->bound = true ;
1027
1034
info.GetReturnValue ().Set (info.This ());
1028
1035
}
1029
- #line 229 "./src/objects/statement.lzz"
1036
+ #line 236 "./src/objects/statement.lzz"
1030
1037
void Statement::JS_pluck (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1031
- #line 229 "./src/objects/statement.lzz"
1038
+ #line 236 "./src/objects/statement.lzz"
1032
1039
{
1033
1040
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1034
1041
if (!stmt->returns_data ) return ThrowTypeError (" The pluck() method is only for statements that return data" );
@@ -1039,9 +1046,9 @@ void Statement::JS_pluck (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1039
1046
stmt->mode = use ? Data::PLUCK : stmt->mode == Data::PLUCK ? Data::FLAT : stmt->mode ;
1040
1047
info.GetReturnValue ().Set (info.This ());
1041
1048
}
1042
- #line 240 "./src/objects/statement.lzz"
1049
+ #line 247 "./src/objects/statement.lzz"
1043
1050
void Statement::JS_expand (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1044
- #line 240 "./src/objects/statement.lzz"
1051
+ #line 247 "./src/objects/statement.lzz"
1045
1052
{
1046
1053
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1047
1054
if (!stmt->returns_data ) return ThrowTypeError (" The expand() method is only for statements that return data" );
@@ -1052,9 +1059,9 @@ void Statement::JS_expand (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1052
1059
stmt->mode = use ? Data::EXPAND : stmt->mode == Data::EXPAND ? Data::FLAT : stmt->mode ;
1053
1060
info.GetReturnValue ().Set (info.This ());
1054
1061
}
1055
- #line 251 "./src/objects/statement.lzz"
1062
+ #line 258 "./src/objects/statement.lzz"
1056
1063
void Statement::JS_raw (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1057
- #line 251 "./src/objects/statement.lzz"
1064
+ #line 258 "./src/objects/statement.lzz"
1058
1065
{
1059
1066
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1060
1067
if (!stmt->returns_data ) return ThrowTypeError (" The raw() method is only for statements that return data" );
@@ -1065,9 +1072,9 @@ void Statement::JS_raw (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1065
1072
stmt->mode = use ? Data::RAW : stmt->mode == Data::RAW ? Data::FLAT : stmt->mode ;
1066
1073
info.GetReturnValue ().Set (info.This ());
1067
1074
}
1068
- #line 262 "./src/objects/statement.lzz"
1075
+ #line 269 "./src/objects/statement.lzz"
1069
1076
void Statement::JS_safeIntegers (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1070
- #line 262 "./src/objects/statement.lzz"
1077
+ #line 269 "./src/objects/statement.lzz"
1071
1078
{
1072
1079
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1073
1080
if ( stmt -> db -> GetState ( ) -> busy ) return ThrowTypeError ( " This database connection is busy executing a query" ) ;
@@ -1076,9 +1083,9 @@ void Statement::JS_safeIntegers (v8::FunctionCallbackInfo <v8 :: Value> const &
1076
1083
else { if ( info . Length ( ) <= ( 0 ) || ! info [ 0 ] -> IsBoolean ( ) ) return ThrowTypeError ( " Expected " " first" " argument to be " " a boolean" ) ; stmt -> safe_ints = ( info [ 0 ] . As < v8 :: Boolean > ( ) ) -> Value ( ) ; }
1077
1084
info.GetReturnValue ().Set (info.This ());
1078
1085
}
1079
- #line 271 "./src/objects/statement.lzz"
1086
+ #line 278 "./src/objects/statement.lzz"
1080
1087
void Statement::JS_columns (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1081
- #line 271 "./src/objects/statement.lzz"
1088
+ #line 278 "./src/objects/statement.lzz"
1082
1089
{
1083
1090
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1084
1091
if (!stmt->returns_data ) return ThrowTypeError (" The columns() method is only for statements that return data" );
@@ -1121,9 +1128,9 @@ void Statement::JS_columns (v8::FunctionCallbackInfo <v8 :: Value> const & info)
1121
1128
1122
1129
info.GetReturnValue ().Set (columns);
1123
1130
}
1124
- #line 314 "./src/objects/statement.lzz"
1131
+ #line 321 "./src/objects/statement.lzz"
1125
1132
void Statement::JS_busy (v8::Local <v8 :: String> _, v8::PropertyCallbackInfo <v8 :: Value> const & info)
1126
- #line 314 "./src/objects/statement.lzz"
1133
+ #line 321 "./src/objects/statement.lzz"
1127
1134
{
1128
1135
Statement* stmt = node :: ObjectWrap :: Unwrap <Statement>(info.This ());
1129
1136
info.GetReturnValue ().Set (stmt->alive && stmt->locked );
0 commit comments